mIRC Home    About    Download    Register    News    Help

Print Thread
#151719 21/06/06 04:27 AM
Joined: Dec 2002
Posts: 417
O
Othello Offline OP
Fjord artisan
OP Offline
Fjord artisan
O
Joined: Dec 2002
Posts: 417
is it possible to pick up a notice from someone else who is
sending a notice about another channel that is not the same channel that you are both in?


on ^*:NOTICE:*:*: {
var %l = $1-
if ( # isin %l ) && ( $comchan($nick,1) !isin %l ) {
echo -s $1- $nick wrong chan
}
}




Intelligence: It's better to ask a stupid question, then to prove it by not asking....
#151720 21/06/06 05:05 AM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
No. In order for the notice to be recognized by the code, both the person sending the notice and the person/bot that has the code must be in the same channel. The only exception to this that I can think of (and I'm not even positive of this) is if one or the other has IRCop (or higher) status on the server.

#151721 21/06/06 08:47 AM
Joined: Apr 2004
Posts: 759
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Apr 2004
Posts: 759
You need to loop trough $comchan($nick,N)

$comchan($nick,1) only returns the first channel he is on but not the 2nd or 3rd or 4th you catch my drift :tongue:.

you should use $istok rather than isin as well

Code:
on ^*:NOTICE:*:*: {
  var %chans = $replace($regsubex($1-,/(?:\s|^)([^#]+?)?(?:$|\s)/g,$chr(44)),$chr(32),$chr(44)), %x = 1 
  while ($comchan($nick,%x)) {
    var %chan = $comchan($nick,%x)
    if ($istok(%chans,%chan,44)) %chan = $deltok(%chans,%chan,44)
    inc %x
  }
  if ($numtok(%chans,44) > 0) echo -a user in the wrong channel(s) %chans
}

though untested :tongue:

Last edited by Mpdreamz; 21/06/06 08:48 AM.

$maybe
#151722 21/06/06 10:22 PM
Joined: Dec 2002
Posts: 417
O
Othello Offline OP
Fjord artisan
OP Offline
Fjord artisan
O
Joined: Dec 2002
Posts: 417
Thanks RusselB your suggestion worked. I made a mistake of using isin instead of ison in my original script

I would of used Mpdreamz suggestion but I am not that formiliar with Regex expressions, yet.




Intelligence: It's better to ask a stupid question, then to prove it by not asking....

Link Copied to Clipboard