Edit: sorry, the last code I posted was nonsense. Follow this post instead..As said above, you'd need $comchan() for ON QUIT (and any other events that don't fill $chan (#), i.e. ON NICK).
The code below shows the same method as _D3m0n_'s one (although my loop decreases rather than increasing), however I'd prefer using $istok() for these things:
on !*:QUIT:{
var %i = $comchan($nick,0)
while (%i) {
var %chan = $comchan($nick,%i)
if ([color:red]$istok([color:brown]#Santharia #greyhawk #ooc[/color], %chan, 32)[/color]) {
describe %chan watches as someone leaves the channel. $&
4"Ready to talk behind $nick $+ 's back?"
}
dec %i
}
}
In this case, $istok() would look if %chan is in "#Santharia #greyhawk #ooc" (only if separated by spaces, hence the "32", which is the ASCII code for space (/help token identifiers, /help $asc, /help $chr)).
If you need more $istok() examples, feel free to ask..
Also, 2 tips:
- I noticed you use "Gararion" in some parts, I assume it would be better if you used "$me"..?
- You have some repeated parts in your ON PART code, you can avoid them if you want:
on !*:PART:[color:red]#Santharia,#greyhawk,#ooc[/color]:{
describe # watches as $nick leaves the channel. $&
7"Why they leave? If they wanted to quit why didn't they just quit instead of leaving the channel $&
first then quiting." [color:red]$me[/color] just doesn't understand why people can't make things simple for themselves.
}