PuNkTuReD commented on a Page, spam protection (bot)  -  Dec 25, 2008

this should work if you dont want it kicking ops, halfops or voiced users

on *:TEXT:*:#: { 
  if ($nick isop $chan) || ($nick ishop $chan) {
    if (!sp == $strip($1)) { 
      if (!$2) { eis | .msg $chan ?spam command: ?spam on/off/status }
      if ($regex($strip($1-),/on|off/i)) { set $+(%,sp,$chan) $2 | .msg $chan Spam Protect is now $($+(%,sp,$chan),2) $+ . }
      if ($strip($2) == status) { .msg $chan Spam Protect is currently $($+(%,sp,$chan),2) }
  } }
  if ($regex($strip($1-),/http|www|com|org|net/i)) && ($($+(%,sp,$chan),2) == on) { 
    if ($nick isop $chan) || ($nick ishop $chan) || ($nick isvoice $chan) { halt }
    else {
      if ($+(%,spam,$nick) == $null) { set $+(%,spam,$nick) 1 }
      else { inc $+(%,spam,$nick) 1 }
      if ($($+(%,spam,$nick),2) == 3) { unset $+(%,spam,$nick) | ban -k $chan $nick 2 Spam/Advertising. | .notice $nick You have been banned from $chan for Spam/Advertising. }
      .msg $chan $nick - Spamming is not allowed in this channel.
    }
} } 
 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.