mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Sep 2005
Posts: 4
G
GaSD Offline OP
Self-satisified door
OP Offline
Self-satisified door
G
Joined: Sep 2005
Posts: 4
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!!!
Joined: Jan 2004
Posts: 2,127
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 2,127
msg $comchan($2,%z) $2 is being banned for being on %chantest

This line is telling each channel you share with the bad person that they're being banned in %chantest - but only later checks if you are op in the other channel.

If you only want to ban them in 1 channel - then don't have the loop that checks to see all the $comchan's you share. I'm guessing none of your other ops share channels with the bad people?

Easies quick fix is to put the msg inside the loop that acts only when you're an op:


while (%z) {
if ($me isop $comchan($2,%z)) {
msg $comchan($2,%z) $2 is being banned for being on %chantest
ban -ku3600 $comchan($2,%z) $2 11
}

Joined: Sep 2005
Posts: 4
G
GaSD Offline OP
Self-satisified door
OP Offline
Self-satisified door
G
Joined: Sep 2005
Posts: 4
Thanks, maroon...will give it a shot. I'll add on to this post if it still acts stupid.

Thanks again.


* Now with 60% more subliminal messages!!!
Joined: Sep 2005
Posts: 4
G
GaSD Offline OP
Self-satisified door
OP Offline
Self-satisified door
G
Joined: Sep 2005
Posts: 4
Nope, those changes didn't effect a thing. When the script fires, it still shows in channel that the person was kicked for EVERY channel they were in, not JUST the bad channel that triggered the kick. It fired while I was at work yesterday and it showed the person as being kicked for being in eight separate channels, when only one of them was on our forbidden list.

Any thoughts would really help here.


* Now with 60% more subliminal messages!!!

Link Copied to Clipboard