Very Simple Flood Protection

By PoiXon on Apr 11, 2005

Simple Flood protection: ive seen this wanted in the forums so heres a very simple flood protection

all you need to do is replace #YOURCHANNEL with your channel and then when someone floods 5 lines in 5 seconds it will kick them

This Works for me ( there may be parts of the script that you dont need ( as i dont know alot about Hash Tables =S ))

on *:start: {
  ;makes a hash table with 150 slots when u start ur mIRC
  hmake flood 150
}
on *:text:*:#YOURCHANNEL: {
  if ($me isop $chan) {
    ;checks if im op
    hinc -u5 flood $nick 1
    ;this increases the value of amount of texts that user that used 
    ;the -u5 will unset that count after 5 seconds
    if ($hget(flood,$nick) > 5) {
      ;checks if the user has typed 5 lines 
      ban -u300 $chan $nick
      ;bans them the -u300 means it will unban after 300 seconds ( 5mins )
      kick $chan $nick 5 min Ban For Flooding!
      ;kicks the user
      hdel flood $nick
      ;unsets the users counts
    }
  }
}

Comments

Sign in to comment.
bhagshoy   -  Aug 30, 2007

Hi I just want to ask when i omitted the yourchannel \"on :text::#YOURCHANNEL:\" and leave to # then why is the user get banned when you have 5 common channels when he/she used \"/amsg\" the last channel to be sent the script banned and kicked him out..

 Respond  
|MELIORITE|   -  Apr 27, 2007

Ok, I know this one was done some time ago but I thought I\'d have a look at it since there are some recent anti-flood snippets come in. #Yourchannel could easily be left as # since it operates in channels where the user is an op, and the line:

if ($me isop $chan)

is not necessary if the text line is given as:

on @*:text:*:#:

Otherwise, I like it, even if i am looking at it 2 years after it was first added.

 Respond  
xDaeMoN   -  Jul 12, 2005

What errors did you receive? Did you change the channel?

 Respond  
Lord Kiam   -  Jul 12, 2005

lol it isnt working anywayz :D

 Respond  
Lord Kiam   -  Jul 12, 2005

cool script im gonna use it

 Respond  
DarthReven   -  Apr 20, 2005

nice little script there

 Respond  
supergeo   -  Apr 11, 2005

Nice Job :)

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.