r_highlightspam.mrc Highlight Spam Blocker
Platform: mIRC
Published Apr 28, 2010
Updated May 02, 2010
Highlight Spam Blocker
Last updated: Version 1.0 -- 28-Apr-2010
This script will help you block the recent bout of spam IRC networks have been receiving, where spammers will flood a channel with user nicknames causing clients to highlight their name and draw attention to the spam. Use this script to bring peace again!
This script is highly commented for your convenience and safety.
Please examine every line of every script before you load it.
Instructions for installation:
Within mIRC, press ALT+R and click on the 'Remote' tab.
Goto 'File' > 'New' and paste in this script.
Goto 'File' > 'Save As...' and name the script: r_highlightspam.mrc
I can be found on EFnet in #raccoon
Enjoy.
~ Raccoon/EFnet.
; r_highlightspam.mrc 31-Mar-2010 by Raccoon/EFnet Version 1.0 28-Apr-2010
; This script has no dependencies. It goes in the Remotes tab in its own file.
;###############################################################################
;# Highlight Spam Blocker script for mIRC! by Raccoon on EFnet #
;# #
;# This script will ban or ignore users who spam the channel with several #
;# nicknames in a single line of text. It can be used to prevent complaints #
;# about being "woken up" by a client's highlighting features. #
;# #
;# The default settings will ban the user for 60 minutes if you have operator #
;# privlidges, or simply ignore the user for 5 minutes if you cannot ban them. #
;# You can modify this behavior in the section immediately below. Enjoy! #
;###############################################################################
; Actions to take against a user who Hightlight Spams.
ALIAS -l HighlightSpamTakeAction {
var %chan = $1
var %nick = $2
;# Ban user from channel! (if you have ops)
if $nick(%chan,$me,~!&@%) {
ban -ku3600 %chan %nick 2 Who disturbs our slumber?
}
;# Otherwise, ignore user instead.
else {
echo -tic info %chan * Ignoring %nick for 5 minutes for highlight spam.
.ignore -cntiu300 %nick 2
haltdef ; <- this hides the current line of text.
}
}
; Determine if user text is spammy.
ALIAS -l CatchHighlightSpam {
;# Maximum number of nicknames a user is allowed to say in their text.
var %MAXNICK = 5
;# Users with these prefixes are exempt. Eg, Channel Ops.
;# (~) Owner, (&) Admin, (*) Owner, (!) Admin, (@) Chan-Op, (%) Half-Op, (+) Voice
var %EXEMPT = ~&!*@%+
; ----- SCRIPT ----- Modify with care. -----
var %chan = $1
var %nick = $2
var %text = $strip($3-)
; abort if %nick has exempt status prefix.
if $nick(%chan,%nick,%exempt) { return }
; search for nicknames in user text string.
var %re = /([][A-Za-z0-9`^|\\{}_-]{4,})/g
noop $regex(%text,%re)
var %i = 1, %n = $regml(0), %cnt = 0
WHILE %i <= %n { ; loop through each word.
; is this word a nickname?
if ($regml(%i) ison %chan) inc %cnt
; have we found too many nicknames?
if (%cnt > %MAXNICK) {
HighlightSpamTakeAction %chan %nick
return $true
}
inc %i
}
return $false
}
; Channel text events.
On ^*:TEXT:*:#: { CatchHighlightSpam $chan $nick $1- }
On ^*:ACTION:*:#: { CatchHighlightSpam $chan $nick $1- }
On ^*:NOTICE:*:#: { CatchHighlightSpam $chan $nick $1- }
CTCP ^*:*:#: { CatchHighlightSpam $chan $nick $1- }
; Tell others about this script.
MENU Channel {
-
(Link) Highlight Spam Blocker: editbox -a Get this mIRC script to block highlight spammers. http://www.hawkee.com/snippet/7592/
}
; End of script.
; === Change Log ===
;
; v1.0 -- 28-Apr-2010
; * First public release of script for mIRC v6.35
;
; Check for updates and report bugs @ http://www.hawkee.com/snippet/7592/