Protections

By BoZzInDaHouse on Jan 27, 2010

I have scripted some nice Protections for my Bot.

This are 3 nice Protections which have to be in every good bot.

  1. Join Part Protection

  2. Nickflood Protection

  3. Channelflood Protection

Have Fun with this Addon

For any Problems send a mail to BushidoTheOne@aol.com or visit #mIRC-Support on IrCQnet irc.icq.com

Greetz BoZzInDaHouse

*************************************************************************************************
                                          Protections
*************************************************************************************************
on *:load: {
set %joinparts 3
set %floodnicks 3
set %floodtime 3 
set %floodmaxlines 4
}

*************************************************************************************************
Join Part Protection
*************************************************************************************************

on *:join:#:{ 
  if (%Join/Part [ $+ [ $network ] $+ [ # ] $+ [ $address($nick,2) ] ] == $null) {
  set -u20 %Join/Part [ $+ [ $network ] $+ [ # ] $+ [ $address($nick,2) ] ] 1 }
  else {
    inc %Join/Part [ $+ [ $network ] $+ [ # ] $+ [ $address($nick,2) ] ]
    if (%Join/Part [ $+ [ $network ] $+ [ # ] $+ [ $address($nick,2) ] ] == %joinparts) { 
      ban -ku14400 # $nick 2 14Banned: Join/Part Flood 09::14 $fulldate 09:: 
    }
  } 
}

*************************************************************************************************
NickFlood Protection
*************************************************************************************************

on *:nick:{ 
  if (%NickFlood [ $+ [ $network ] $+ [ $address($newnick,2) ] ] == $null) {
  set -u120 %NickFlood [ $+ [ $network ] $+ [ $address($newnick,2) ] ] 1 }
  else {
    inc %NickFlood [ $+ [ $network ] $+ [ $address($newnick,2) ] ]
    if (%NickFlood [ $+ [ $network ] $+ [ $address($newnick,2) ] ] == %floodnicks) { 
      nickflood $newnick
    }
  } 
}
alias nickflood {      
  var %nickflood1 = $comchan($1,0)
  while (%nickflood1) {
    writeini Banlist.ini Global $address($1,2) Nick Flood (Set by $me on $fulldate $+ )
    ban -ku14400 $comchan($1,%nickflood1) $1 2 14Banned: Nick Flood 09::14 $fulldate 09::
    dec %nickflood1 
  }
}

*************************************************************************************************
Flood Protection
*************************************************************************************************

on *:text:*:#:{
  if (($nick isop #) || ($nick ishop #)) { halt }
  else {
    if (%textFlood [ $+ [ $network ] $+ [ # ] $+ [ $address($nick,2) ] $+ [ text ] ] == $null) {
      set -u [ $+ [ %Floodtime ] ] %textFlood [ $+ [ $network ] $+ [ # ] $+ [ $address($nick,2) ] $+ [ text ] ] 1 
    }
    if (%textFlood [ $+ [ $network ] $+ [ # ] $+ [ $address($nick,2) ] $+ [ text ] ] < %floodmaxlines) {
      inc %textFlood [ $+ [ $network ] $+ [ # ] $+ [ $address($nick,2) ] $+ [ text ] ] 
    }
    else {
      if (%textFlood [ $+ [ $network ] $+ [ # ] $+ [ $address($nick,2) ] $+ [ text ] ] == %floodmaxlines) {
        inc %textFlood [ $+ [ $network ] $+ [ # ] $+ [ $address($nick,2) ] ]    
        if (%textFlood [ $+ [ $network ] $+ [ # ] $+ [ $address($nick,2) ] ] == 1) { 
          notice $nick Please stop flooding 
          unset %textFlood [ $+ [ $network ] $+ [ # ] $+ [ $address($nick,2) ] $+ [ text ] ] 
        }
        if (%textFlood [ $+ [ $network ] $+ [ # ] $+ [ $address($nick,2) ] ] == 2) { 
          kick # $nick No Flood. 
          unset %textFlood [ $+ [ $network ] $+ [ # ] $+ [ $address($nick,2) ] $+ [ text ] ] 
        }
        if (%textFlood [ $+ [ $network ] $+ [ # ] $+ [ $address($nick,2) ] ] == 3) { 
          unset %textFlood [ $+ [ $network ] $+ [ # ] $+ [ $address($nick,2) ] $+ [ text ] ]
          unset %textFlood [ $+ [ $network ] $+ [ # ] $+ [ $address($nick,2) ] ]
          ban -ku14400 # $nick 2 14Banned: Flood 09::14 $fulldate 09:: 
        }
      }
    }
  }
}

Comments

Sign in to comment.
Souljaa   -  Feb 10, 2010

Very nice. Kudos to ya. Nice scripting bud.

More
 Respond  
TophBeiFong   -  Jan 27, 2010

10/10 good work >_>

More
 Respond  
BoZzInDaHouse   -  Jan 27, 2010

i know +f ;) but i`m no friend of this :P Id like to Use my own ones cuz ive removed some lines in this codes which i`ve to use for my Banlists ;)

More
 Respond  
SnoooP   -  Jan 27, 2010

I wasn't trying to say anything bad about your script either, I was merely suggesting and demonstrating for those who do not know about those modes.

-=-

I tested the join/part worked fine..haven't got round to the other two yet.

More
 Respond  
SnoooP   -  Jan 27, 2010

If you use unrealircd channels modes +f and +j can effictively protect against the three this script does.

/mode # +j 5:20
would allow any single nick join 5 times in 20 seconds. this prevents revolving doors or join/part floods -=- /mode # +f [20j#i5,70m#m2,15n#N5]:15 -=- :15 = In 15 seconds -=- 20j#i5 = 20joins in :15 seconds leads to +i invite only for 5 minutes this is helpful against a mass join flood. -=- 70m#m2 = 70 channel messages in :15 seconds leads to +m voice only for 2 minutes -=- 15n#N5 = 15 nick changes in :15 seconds leads to +N no nick changes for 5 minutes

You could also use +f [20j#R5]:15 which set mode +R instead of i. this would allow registered users only to join.

More
 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.