mIRC Home    About    Download    Register    News    Help

Print Thread
#36822 17/07/03 10:25 AM
Joined: Dec 2002
Posts: 339
F
Fjord artisan
OP Offline
Fjord artisan
F
Joined: Dec 2002
Posts: 339
Hello alls,

I've lately started scripting again, this time I'm trying to script a bad nick kicker on a on nick event, the code i scripted is the following:

on *:NICK:{
if ([censored] isin $newnick) || ([censored] isin $newnick) || (dick isin $newnick) || (whore isin $newnick) || (cunt isin $newnick) {
var %i = 0
while (%i < $comchan($newnick,0)) {
inc %i
if ($me isop $comchan($newnick,%i)) && ($comchan($newnick,%i) isin %fc.chans) {
ban $comchan($newnick,%i) * $+ $ifmach $+ *!*@*
kick $comchan($newnick,%i) $newnick Bad nick detected. -BadNickKick-
}
}
}
}
My problems i that I can't ban since the $ifmatch is not targeting in the first if-then-else event but in the sequend one but it needs to pass throght the 2nd one to find the channel... any idea how to script this?

#36823 17/07/03 10:28 AM
Joined: Dec 2002
Posts: 774
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Dec 2002
Posts: 774
Yes indeed... pasmal got it right.. Too much sleep...

Last edited by theRat; 17/07/03 10:30 AM.

Code:
//if ( khaled isgod ) echo yes | else echo no
#36824 17/07/03 10:29 AM
Joined: Dec 2002
Posts: 103
Vogon poet
Offline
Vogon poet
Joined: Dec 2002
Posts: 103
if (.....) {
var %reason = $ifmatch
while (....) {
ban $comchan($newnick,%i) * $+ %reason $+ *!*@*
}
}

#36825 17/07/03 10:33 AM
Joined: Mar 2003
Posts: 1,271
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Mar 2003
Posts: 1,271
I do see a problem with your loop, you need to reverse that. as for the $ifmatch, why not simply ban $newnick ? or somthing like this:

Code:
on *:NICK: {
  if (badwordcheck isin $newnick) {
   ; [color:green]if found, save the found word for later use[/color]
    var %badword $ifmatch
    var %i = $comchan($newnick,0)
    while (%i) {
     ; [color:green]ban using the previously saved badword converted to address format[/color]
      ban $comchan($newnick,%i) $+(*,%badword,*!*@*)
      kick $comchan($newnick,%i) $newnick kick-reason
      dec %i
    }
  }
}


DALnet #Helpdesk
I hear and I forget. I see and I remember. I do and I understand. -Confucius
#36826 17/07/03 10:56 AM
Joined: Dec 2002
Posts: 40
T
Ameglian cow
Offline
Ameglian cow
T
Joined: Dec 2002
Posts: 40
I use an alias that covers both on join bad nicks and on newnick changes in the channel

Code:
on *:Join:#:./NickKick $nick $fulladdress
on *:nick:/NickKick $newnick $fulladdress

alias NickKick {
  if ( badwordhere isin $1 ) .... etc to detect bad nicks for both scenarios
}
  


~ @#FunFactory / @#WorldChat ~ on DALnet ~
#36827 17/07/03 12:42 PM
Joined: Dec 2002
Posts: 339
F
Fjord artisan
OP Offline
Fjord artisan
F
Joined: Dec 2002
Posts: 339
/me looks at myself... stupid enough not to have think about setting a var lol sorry guys i was kinda sleeping when i posted my first post smile thanx all of you... didn't know about the $+(...,...,...,...), btw, not a bad idea about your code Time4aHoliday, I'm just too lazy to re-script and change it all smile

Thanx again guys,


Link Copied to Clipboard