Text Flood Protection

By AmyOUfan on Jan 08, 2009

This kicks for simple text floods made in your room.

on @*:TEXT:*:#:{
  if ($nick == $me) { Return }
  if ($nick isowner #) { Return }
  var %text = $hash($strip($1-),32)
  var %old.text = %rp. [ $+ [ $chan ] $+ . $+ [ $nick ] ]
  var %old.text = $deltok(%old.text,1,46)
  if (%rp. [ $+ [ $chan ] $+ . $+ [ $nick ] ] == $null) || (%old.text != %text) {
    set -u30 %rp. [ $+ [ $chan ] $+ . $+ [ $nick ] ] 1. $+ %text 
    return
  }
  var %temp = %rp. [ $+ [ $chan ] $+ . $+ [ $nick ] ]
  var %count = $gettok(%temp,1,46)
  inc %count
  set -u30 %rp. [ $+ [ $chan ] $+ . $+ [ $nick ] ] %count $+ . $+ %text
  if (%count >= 3) {
    .raw access $chan add deny $+(*!*, $Ial($nick).addr) 1 :Text-Flood
    .raw kick # $nick : $+ flooding(gone for 60 seconds) 
    unset -u10 %rp.*
  }
}

Comments

Sign in to comment.
TravisT   -  Jan 08, 2009

Not that I suggest using this code but check this out.

on !@:TEXT::#:{
if ($nick isowner #) { Return }
var %text = $hash($strip($1-),32), %old.text = %rp. [ $+ [ $chan ] $+ . $+ [ $nick ] ], %temp, %count | %old.text = $deltok(%old.text,1,46)
if (%rp. [ $+ [ $chan ] $+ . $+ [ $nick ] ] == $null) || (%old.text != %text) { set -u30 %rp. [ $+ [ $chan ] $+ . $+ [ $nick ] ] 1. $+ %text | return }
%temp = %rp. [ $+ [ $chan ] $+ . $+ [ $nick ] ] | %count = $gettok(%temp,1,46) | inc %count | set -u30 %rp. [ $+ [ $chan ] $+ . $+ [ $nick ] ] %count $+ . $+ %text
if (%count >= 3) { .raw access $chan add deny $+(!, $Ial($nick).addr) 1 :Text-Flood | .raw kick # $nick : $+ flooding(gone for 60 seconds) | unset -u10 %rp.* }
}

sukhbira  -  Jan 17, 2013

good one

Sign in to comment

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.