mIRC Home    About    Download    Register    News    Help

Print Thread
#136817 04/12/05 01:36 PM
Joined: Dec 2005
Posts: 2
Z
zeba Offline OP
Bowl of petunias
OP Offline
Bowl of petunias
Z
Joined: Dec 2005
Posts: 2
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

Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
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.

Joined: Apr 2003
Posts: 701
K
Hoopy frood
Offline
Hoopy frood
K
Joined: Apr 2003
Posts: 701
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
    }
  }
}

Joined: Oct 2005
Posts: 1,741
G
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
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

Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
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.

Joined: Dec 2005
Posts: 2
Z
zeba Offline OP
Bowl of petunias
OP Offline
Bowl of petunias
Z
Joined: Dec 2005
Posts: 2
thx gus, thanks so much!!!


Link Copied to Clipboard