antibotflood

By weaver on Oct 10, 2006

This small script is mainly for a channel bot although it can be used as a regular user script.What this script does is prevent a flood of joins by keeping a constant watch of the users in the channel and keeping a limit of five more then the users in the channel. it watches quit and part events to adjust accordingly.

another option is to set +j in IRC but this is something if users wanted something a little cooler for their channel or wanted to use every now and again as the user can just type !limit on and !limit off in the channel to trigger it on and off.

another cool thing is that once activated it cant be switched off by other users and will send then a gentle notice that they cant swich it off. after four attempts though it will ban the user from the channel.

to set yourself owner over it type
//set -s %master $address(nick,5)

and you can add users by going to your varibales tab and adding the users full address seperated by a space so you can have a few users.

change #yourchannel in the code to the channel its on

load the code and type /enable #limit
/disable #limit to switch off

for remote bot use type !limit on or !limit off

;made by weaver/shy irc.hackthissite.org #noobs
;many thanks to those at mirc.com who have helped me so much with my scripting.

#limit off
ON *@:JOIN:#yourchannel: {
  set -u4 %limitcheck. [ $+ [ $wildsite ] ]
  names $chan
  .timer_preventbotflood 1 12 /mode $chan +l $calc($nick($chan,0)+5))
}
ON *@:PART:#yourchannel: {
  names $chan
  if (%limitcheck. [ $+ [ $wildsite ] ] == $null) {
    .timer_partcheck 1 3 /limit $chan $nick
  }
}
ON *@:KICK:#yourchannel: {
  .timer_kickcheck 1 8 /limit $chan $knick
}

ON *:QUIT:/.timer_quitcheck 1 2 /limit #yourchannel $nick

on *!@:MODE:#yourchannel: {
  if (!$istok(%master,$fulladdress,32)) {
    if ($1 == -l) || ($1 == +l) {
      mode $chan +l $calc($nick(#,0)+5))
      .notice $nick The channel is now in moderation mode. ask one of my owners to type !limit off if you would like it off.
      INC -u30 %limitstop. [ $+ [ $wildsite ] ]
      if (%limitstop. [ $+ [ $wildsite ] ] > 4) {
        ban -ku50 # $nick I warned you in a notice four times already.
      }
    }
  }
}
alias limit {
  if ($2 !ison $1) {
    mode $1 +l $calc($nick($1,0)+5)) 
  }
}
#limit end

on *:TEXT:!limit*:#: {
  if ($istok(%master,$fulladdress,32)) {
    if ($2 == on) {  enable #limit | mode $chan +l $calc($nick($chan,0)+5)) }
    if ($2 == off) { disable #limit | mode $chan -l }
  }
}

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.