mIRC Homepage
Posted By: zeba nick flood protection!!!!! - 04/12/05 01:36 PM
gus, i really need some help.some1 started flooding in my chanel and i cannot stop it. can u help me? may be some1 can show me an example of nick flood protection script or give me a link where i can see it and write smth like that by myself?
it suppose to be like if some1 changing the nickname more than 2 times per sec must be kicked and banned.thx alot
Posted By: RusselB Re: nick flood protection!!!!! - 04/12/05 03:26 PM
Code:
 on *:nick:{
  inc $+(%,nick.,$address)
  if $calc($ctime - $($+(%,ctime.,$address),2)) < 1 && $($+(%,nick.,$address),2) > 1 {
    var %chan = $comchan($newnick,0)
    while %chan {
      if ($me isop $comchan($newnick,%chan)) {
        .ban -k $comchan($newnick,%chan) $newnick Nick Flood Protection
      }
      dec %chan
    }
  }
  else set %ctime $+(%,ctime.,$address)
}


That code will work as is. I realize that you didn't ask for the specific code, but it was easier to give you the code rather than try to explain what needed to be done without actually giving the code.
Posted By: Kelder Re: nick flood protection!!!!! - 04/12/05 03:45 PM
Paste this in a new script file in remotes window (alt-r twice then file->new). It will ban on every channel where you have op status people who change their nicks more than 2 times in 4 seconds, or more than once a minute after that. Add 60 seconds for each nickchange, if the counter reaches 116 it'll ban them. Counters decrease with 1 each second. Ban is done in *!*user@*.host format.

Code:
on !*:NICK:{
  inc -z $+(%,nickchange.,$address) 60
  if ($($+(%,nickchange.,$address),2) > 116) {
    var %i = 1
    unset $+(%,nickchange.,$address)
    while ($comchan($newnick,%i)) {
      if ($me isop $v1) ban -k $v2 $newnick 3
      inc %i
    }
  }
}
Posted By: genius_at_work Re: nick flood protection!!!!! - 04/12/05 05:39 PM
The problem that I can see with those scripts is that if the person is changing nicks several times per second, then by the time your mIRC sees it and reacts, their nick has already changed. It may be that the server will automatically redirect the kick to their new nickname, but that's not guaranteed.

Some servers provide a mode (+N on my server) to prevent users from changing nicks in your channel. You could set that mode in your channel permanently, or a few lines could be added to one of the above scripts. If the script sees someone nick flooding, ban the user, set +N in the channel, wait a second or two, and then kick the user out.

-genius_at_work
Posted By: RusselB Re: nick flood protection!!!!! - 04/12/05 06:31 PM
I've found that with the networks that I'm on, if you try to change your nick too quickly, then you get a Target change too fast message from the server. I found this by accident when I had two scripts that kept changing my nick between my main nick & my alternate.
Posted By: zeba Re: nick flood protection!!!!! - 05/12/05 06:37 AM
thx gus, thanks so much!!!
© mIRC Discussion Forums