Jump to content
coders-irc_Bot

$is_nickspam() - Nickname Highlight Spam Detection

Recommended Posts

  • Administrators
; $is_nickspam() - Nickname Highlight Spam Detector by Raccoon 2017.
; Parameters: $is_nickspam(<channel>,<text>,[M=6],[N=8])  eg: $is_nickspam($chan,$1-,6,8)  or just  $is_nickspam($chan,$1-)
;   Where M (>=2) is minimum nickname length to regard, and N (>=1) is number of matches considered as spammy.  Defaults: M = 6, N = 8.
; Returns: Number of positive nickname matches in the string, if it exceeds [N].  Returns 0 if less than [N]. 
; Note: This script looks at nickname parts that contain Letters, Numbers and Underscores, to detect variously decorated spam.
; Example Usage:  (Un-comment the next 5 lines to activate, and enjoy.)
; On @*:TEXT:????????????????????????????????????????????????????????????*:#: {
;   if ($nick !isop $chan) && (!$($+(%,_spamban.,$cid,$chan,$nick),2)) && ($is_nickspam($chan,$1-)) {
;     ban -k $chan $nick 2 Lame Highlight Spam Detected.
;     inc -z $+(%,_spamban.,$cid,$chan,$nick) 5
; } }
ALIAS is_nickspam { 
  var %chan = $$1, %text = $$2, %nicklen = $$iif($calc($3 -1) > 0,$v1,5), %nickspam = $$iif($calc($4) > 0,$v1,8)
  var %text = $mid($regsubex(is_nickspam,! %text !,/(*UTF8)(?:\W++|(?<!\w)(?:\w{1, $+ %nicklen $+ }|(\w++)(?=.*?\W\1(?:\W|$)))(?!\w))+/g,|),2,-1)
  if (%chan ischan) && ($numtok(%text,124) >= %nickspam) && ($fline(%chan,/(?<=^|\W)(?: $+ %text $+ )(?=\W|$)/i,0,3) >= %nickspam) { return $v1 }
  return 0
} ; by Raccoon 2017 Feb 28 - http://www.mpaste.com/p/Tu7NJh - http://hawkee.com/snippet/18055/

 

This script detects "Nickname Highlight Spam" in IRC. Works in both mIRC and AdiIRC.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...


×
×
  • Create New...