Hide Events?

Discussion about Perl, TCL or Python scripts and C/C++ plugins (using and writing them).

Hide Events?

Postby gastly » 26 Apr 2009 14:39

Hi all, my first post here :D

I've just migrated from mIRC to Xchat and I know a bit of perl so I thought I'd get going at scripting.

The thing is, I'm trying to make an opchat script (means you communicate via /notice to ops and voices).

I've accomplished the part that it sends messages to all the ops and voices, but it also shows the text event of every notice that is sent.

Eg: If there are 3 ops in the channel and I type /ov Hello (the command to send notice to all ops in the current channel), it shows like this:
->-Nick1- Hello
->-Nick2- Hello
->-Nick3- Hello

I'd rather that it display the notice something like this:
->-@#channel- Hello

Here's the code I'm using:
Code: Select all
$text = $_[1][1];
   my @userinfo = get_list("users");
   if(@userinfo == $NULL){ prnt("No users in channel! o_O");}
   else
   {   foreach my $user (@userinfo)
      {
         if($user->{'prefix'} eq '@')
         {
            command("notice $user->{'nick'} $text");
         }
      }
   }


I know just basic perl (not advanced stuff).

So, please help me out with this :)

I recall, that in mIRC you can write a '.' in front of a command and the text of that command does not show up anywhere, I want to accomplish a similar thing in my script.

There, I wrote it as detailed as I could :P

Please help! :)
gastly
 
Posts: 18
Joined: 26 Apr 2009 14:25

Postby Khisanth » 26 Apr 2009 21:16

You can use the /RAW command for that
Code: Select all
command("raw notice $user->{'nick'} :$text");


Note the colon before the text
Khisanth
 
Posts: 1724
Joined: 10 Jun 2004 05:23

Postby LifeIsPain » 27 Apr 2009 00:42

I have a feeling the other scripts aren't actually sending a notice to every op individually, they are doing something more along the lines of: /notice @#channelname here is the notice. I don't think this is in the actual RFC, but it works on most IRCds.

You can also notice a group of individuals in one line, using a comma separated list of nicks (no spaces). This way if the @# syntax doesn't work, you can send to multiple ops without flooding the server.
User avatar
LifeIsPain
 
Posts: 490
Joined: 25 Aug 2005 06:36

Postby Khisanth » 27 Apr 2009 04:25

does xchat split those messages correctly if it's too long?

In addition to /notice @#channel the other symbols also work, although that is ircd depenedant as well :)
Khisanth
 
Posts: 1724
Joined: 10 Jun 2004 05:23

Postby LifeIsPain » 27 Apr 2009 08:15

Huhm, nope, doesn't even split a normal /msg or /notice, so I guess having a huge long list would just limit how many chars you get.

But @#channel and +#channel work better anyway.
User avatar
LifeIsPain
 
Posts: 490
Joined: 25 Aug 2005 06:36

Postby gastly » 27 Apr 2009 14:59

Khisanth wrote:You can use the /RAW command for that
Code: Select all
command("raw notice $user->{'nick'} :$text");


Note the colon before the text


Cool, I was looking for something like this, it works like a charm! :D

LifeIsPain wrote:I have a feeling the other scripts aren't actually sending a notice to every op individually, they are doing something more along the lines of: /notice @#channelname here is the notice. I don't think this is in the actual RFC, but it works on most IRCds.

You can also notice a group of individuals in one line, using a comma separated list of nicks (no spaces). This way if the @# syntax doesn't work, you can send to multiple ops without flooding the server.


Awesome!! That did the trick, @#channel and +#channel...hehe stupid me, I didn't study the opchat script that I used on mIRC, deeply :oops:

I used ircu to test the @#channel command and it works perfectly :)

Thanks alot Khisanth and LifeIsPain!
Now I'm fully into Xchat! :D
gastly
 
Posts: 18
Joined: 26 Apr 2009 14:25

Postby Wesley » 03 Apr 2010 18:14

Sorry for the massive bump here, but I have a related question.

I'm familiar with the @#channel messages, but for some reason they show up as private messages from the user that sends them in xchat. Is there any settings to change this, if not can this be fixed using a script?
Wesley
 
Posts: 1
Joined: 03 Apr 2010 18:06


Return to Scripts and Plugins

Who is online

Users browsing this forum: No registered users and 2 guests