AntiFlood - Kick - Devoice - Ban

By essebi on May 13, 2008

Hi all
This is my fist script ever, so please don't flame me for the poor programming
I've started my work from this snippet: http://www.hawkee.com/snippet/2247/ it don't work for an error on line 5 so i've rewrited it for my purpose.
The function is simple: 5 lines typed in 4 second is the limit and could be edited on line 2 and 3:
-u4 are the seconds
== 5 are the lines

the first time you flood the chan you'll be kicked, the second time you'll be devoiced for 1 minute and the last time you'll be banned for 5 minutes. Of course need to be loaded on a +m chan.

I'm on the basic of the scripting, so i'm happy if someone can suggest me a better way to write it and save some lines:)

Cheers
essebi

on @*:TEXT:*:#:{ 
  inc -u4 $+(%,flood.,$nick) 
  if $($+(%,flood.,$nick),2) == 5 { goto rules }
  halt
  :rules
  if ($nick isop $chan) { 
  halt
  }
  .inc $+(%,flood.kick.,$nick)
  if $($+(%,flood.ban.,$nick),2) == 1 { goto ban }   
  if $($+(%,flood.devoice.,$nick),2) == 1 { goto devoice }
  if $($+(%,flood.kick,$nick),2) == 1 { goto kick }
  :kick
  .kick $chan $nick Don't Flood!! Next time you'll be devoiced  
  .inc $+(%,flood.devoice.,$nick)
  unset $+(%,flood.kick.,$nick)
  halt
  :devoice
  .mode $chan -v $nick | msg $chan $nick is flooding again: Devoiced for 1 minute!
  .inc $+(%,flood.ban.,$nick)
  unset $+(%,flood.devoice.,$nick)
  unset $+(%,flood.kick.,$nick)
  .timer 1 60 /mode $chan +v $nick 
  .timer 1 61 notice $nick you've been revoiced, dont flood again or you'll be banned 
  halt
  :ban
  .ban -u300 $chan $nick 
  .kick $chan $nick 5 minutes ban for multiple flooding on $chan 
  unset $+(%,flood.ban.,$nick)
  unset $+(%,flood.kick.,$nick)
  halt
}

Comments

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.