WorldDMT commented on a Page, r_highlightspam.mrc Highlight Spam Blocker  -  Apr 29, 2010

hi
nice work Raccon but i have something about scripting

  • the braces makes the code slower
  • for the /var u can use just one /var %var1 x,%var2 x,%varN ...
  • u can use only one alias

and that is the code like i suggest so just a suggestion and explanation of my comment

alias -l CatchHighlightSpam {
  var %EXEMPT ~&!*@%+,%chan $1,%nick $2,%text $strip($3-)
  if !$nick(%chan,%nick,%exempt) {
    var %re /([][A-Za-z0-9`^|\\{}_-]{4,})/g
    noop $regex(%text,%re)
    var %n $regml(0),%cnt
    while %n {
      if ($regml(%n) ison %chan) inc %cnt
      if %cnt > 5 {
        if ($nick(%chan,$me,~!&@%)) ban -ku3600 %chan %nick 2 Who disturbs our slumber?
        else {
          echo -tic info %chan * Ignoring %nick for 5 minutes for highlight spam.
          .ignore -cntiu300 %nick 2
          haltdef
        }
      }
      dec %n
    }
  }
}
on ^*:TEXT:*:#:CatchHighlightSpam # $nick $1-
on ^*:ACTION:*:#:CatchHighlightSpam # $nick $1-
on ^*:NOTICE:*:#:CatchHighlightSpam # $nick $1-
CTCP ^*:*:#:CatchHighlightSpam # $nick $1-
 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.