Flood Kick and Banner

By JordanCook on Apr 13, 2010

This will allow users to flood 5 lines in 5 seconds before it kicks them. If they flood again it will ban them.

on *:TEXT:*:#:{
  if ($nick isop $chan) { 
    halt
  }
  inc -u5 %flood. [ $+ [ $nick ] ]
  if ( %flood. [ $+ [ $nick ] ] >= 5 ) {
    if ( %flood. [ $+ [ $nick ] $+ ] .action == ban ) {
      ban -u300 $chan $address($nick, 1)
      kick $chan $nick Stop Flooding!  - 5 minute ban
      log $nick ( $+ $address($nick, 0) $+ ) Kicked Banned from $chan for 5 minutes for flooding by $me     
      halt
      } else {
      kick $chan $nick Stop Flooding!
      %flood. [ $+ [ $nick ]  $+ ] .action = ban
      log $nick ( $+ $address($nick, 0) $+ ) Kicked from $chan by $me for flooding
      halt
    }
  }
}

Comments

Sign in to comment.
WorldDMT   -  Apr 14, 2010

when he flood he must be out :p

 Respond  
Jethro   -  Apr 14, 2010

WorldDMT, maybe he wants it to ban the second time without kicking? Either way a person will get banned within 5 minutes and won't be able to come back again when kicked upon resuming the ordeal.

 Respond  
WorldDMT   -  Apr 14, 2010

/ban -ku300

 Respond  
Jethro   -  Apr 13, 2010
  1. Make sure the client that runs the code is opped in channel by adding @ prefix next to your text event.
  2. You can specify the type of address to ban, rather than using the $address identifier. Type 1 equals to $address($nick,1)
  3. Your script can be done like this:
on @*:text:*:#: {
  tokenize 32 $strip($1-)
  if (($nick !isop #) && ($($+(%,string,$wildsite,#,$cid),2) >= 5)) { 
    hinc -m c $nick | goto $iif($hget(c,$nick) = 1,kick,ban)
    :kick | kick # $nick Stop flooding! | halt
    :ban | ban -u300 # $nick 1 2nd offense - Banned! | hdel c $nick | halt
  }
  else { inc -u5 $+(%,string,$wildsite,#,$cid) }
}
 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.