HELP! What I have is a script that raises my blood pressure.

What I want is a simple bad channel kicker that searches for a few bad words in the channel names, then kicks/bans and tells WHAT ONE SINGLE CHANNEL caused the person to get kicked. Am I asking for TOO MUCH!?!?!?

I just want this script to work. And work correctly. <sigh>

Several other ops in my channel have no problems with this script. I am not 100% sure if maybe their version is ever-so-slightly different from mine (I don't believe they're any different).

The script fires when it's supposed to, it's the OUTPUT that is screwed up.

Here's the script... (sorry about the spacing...I haven't learned the "trick" yet)

=====

raw 319:*: {
set %chanchk $1-
set %chantest init
var %ix = 3
while %chantest != $null {
set %chantest $gettok(%chanchk,%ix,32)
if %chantest == $null return
if (badword1 isin $3-) || (badword2 isin $3-) {
var %z = $comchan($2,0)
msg $comchan($2,%z) $2 is being banned for being on %chantest
while (%z) {
if ($me isop $comchan($2,%z)) {
ban -ku3600 $comchan($2,%z) $2 11
}
dec %z
}
}
inc %ix
}
}

=====

For some reason, when it fires, it kicks (and notifies the channel) for not only the OFFENDING BAD CHANNEL, but EVERY STINKING SINGLE SOLITARY FRIGGIN CHANNEL the person is in. (Can you tell this ticks me off?)

Now as a test, I unloaded EVERY script except this one (to make sure some other script wasn't causing it to malfunction), and I replaced the msg and ban function of the script with /echo $2 would have been kicked for being in %chantest !!! and STILL got THIS:


OffendingNick would have been kicked for being in +#GoodChannel1 !!!
OffendingNick would have been kicked for being in +#GoodChannel2 !!!
OffendingNick would have been kicked for being in +#GoodChannel3 !!!
OffendingNick would have been kicked for being in @#BadEvilChannel !!!
OffendingNick would have been kicked for being in @#GoodChannel4 !!!


Any suggestions?

I know it's probably something simple, but I'm really not very good at debugging. No kidding, I know.

I'm gonna go have a nice big cup of DECAF while one of you scripting gods tears this script apart and posts a viable answer. Thanks in advance for any help.

~Gary~


* Now with 60% more subliminal messages!!!