raccoon commented on a Page, r_highlightspam.mrc Highlight Spam Blocker  -  Apr 28, 2010

Abbreviated version of this script, by popular demand.

; r_highlightspam_short.mrc 31-Mar-2010 by Raccoon/EFnet Version 1.a 28-Apr-2010
;###############################################################################
;#      Highlight Spam Blocker script for mIRC!       by Raccoon on EFnet      #
;###############################################################################

On ^*:TEXT:*:#:   { CatchHighlightSpam $1- }
On ^*:ACTION:*:#: { CatchHighlightSpam $1- }
On ^*:NOTICE:*:#: { CatchHighlightSpam $1- }
CTCP ^*:*:#:      { CatchHighlightSpam $1- }

; Determine if user text is nick-spammy.
ALIAS -l CatchHighlightSpam {
  ;# Users with these prefixes are exempt.  Eg, Channel Ops.
  ;# (~,*) Owner, (&,!) Admin, (@) Chan-Op, (%) Half-Op, (+) Voice
  if $nick($chan,$nick,~&!*@%+) { return }

  ; search for nicknames in user text string.
  var %re = /([][A-Za-z0-9`^|\\{}_-]{4,})/g
  noop $regex($strip($1-),%re)
  var %n = $regml(0), %cnt = 0
  WHILE %n { ; loop through 'words'.
    if ($regml(%n) ison $chan) inc %cnt
    if (%cnt > 5) { ; Maximum number of nicknames in a sentence.
      if $nick($chan,$me,~!&@%) { ; have ops? ban!
        ban -ku3600 $chan $nick 2 Who disturbs our slumber?
      } | else { ; don't have ops? ignore!
        echo -tic info $chan * Ignoring $nick for 5 minutes for highlight spam.
        .ignore -cntiu300 $nick 2 | haltdef
      }
      return ; done. spam thwarted.
    }
    dec %n
} }

; End of script.
__________________________________________________________________________________
 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.