mIRC Homepage
Posted By: FunChatter on nick bad nick kicker - 17/07/03 10:25 AM
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?
Posted By: theRat Re: on nick bad nick kicker - 17/07/03 10:28 AM
Yes indeed... pasmal got it right.. Too much sleep...
Posted By: Pasmal Re: on nick bad nick kicker - 17/07/03 10:29 AM
if (.....) {
var %reason = $ifmatch
while (....) {
ban $comchan($newnick,%i) * $+ %reason $+ *!*@*
}
}
Posted By: LocutusofBorg Re: on nick bad nick kicker - 17/07/03 10:33 AM
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
    }
  }
}
Posted By: Time4aHoliday Re: on nick bad nick kicker - 17/07/03 10:56 AM
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
}
  
Posted By: FunChatter Re: on nick bad nick kicker - 17/07/03 12:42 PM
/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,
© mIRC Discussion Forums