I downloaded this script here and it works, but there is one mistake.
Code: Select all
#################################################
# #
# Anti Mass Letter Script by SilentStorm #
# #
#################################################
#
# Version 1.1
#
#################################################
#
# If a User writes more then x letters of the
# same type in a row (i.e spaaaaaaaaaaaam) then
# the User will be warned and after y warnings
# the User will be kicked out of the channel.
# Allows you to set Exceptions too so specified
# nicks wont be affected by this.
# Also offers a 'Hardcore Violation Mode' which
# will kick the User without any warnings. Useful
# for extreme violations and Spamming.
#
#################################################
# #
# CONFIGURATION #
# #
#################################################
#
# Every Nickname entered here will NOT be affected by this Script. So choose the Nicks you enter here carefully!
# Nicknames has to be seperated by a Space (i.e. User1 User2 User3)
set massmsg(except) "SilentStorm blueshadow"
# Here you can specify all channels which should be protected by this script.
# Make sure your Bot has at least HalfOp in all the channels you enter here in order to be able to kick
# Channels has to be seperated by a Space (i.e. Chan1 Chan2 Chan3) and must be entered without the preceding #
set massmsg(chans) "x-tec hellgate"
# This controls wether digits are punished as well or not. If set to 1 then 6666666 wont be treated as Spam
# and Users wont be warned (and therefore not kicked) when spamming lines full of digits
# Possible Settings are (0/1)
set massmsg(ignint) 0
# Here you can specify how often the users are warned before they receive a kick
set massmsg(warnings) 3
# Here you can specify how many following characters of the same type are allowed (if User exceeds this they'll be warned)
set massmsg(maxchr) 3
# This sets the amount of same characters in a row which will trigger the Hardmode (User will be kicked regardless of warnings)
set massmsg(hmchr) 10
# Here you can specify the messages for the warnings as well as for the kick message.
# %nick will be replaced by the nick of the warned/kicked user
# %cnt will be replaced by the amount of warnings the User received
set massmsg(warnmsg) "%nick du bist hiermit verwarnt. Dies ist deine %cnt Verwarnung."
set massmsg(kickmsg) "oO Stop Spamming. You've been warned %cnt times already."
####################################################
# !!DO NOT CHANGE ANYTHING BELOW!! #
####################################################
set massmsg(version) "V 1.1"
set massmsg(author) "SilentStorm"
####################
# Application Part #
####################
bind pubm - * check_massletter
proc check_massletter {nick uhost hand chan arg} {
global usrwarn
global massmsg
set maxstr 0
set spam 0
set check 0
set laststr ""
foreach n $massmsg(chans) {
if {([string tolower $chan] == [string tolower \#$n])} {
set check 1
}
}
if {$check != 1} {
# putlog "Aborting MassLetter. May not check for Channel $chan"
return
}
foreach n $massmsg(except) {
if {([string tolower $nick] == [string tolower $n])} {
# putlog "Aborting MassLetter. User $nick is on ExceptionsList"
return
}
}
if {![info exists usrwarn([nick2hand $nick])]} {
set usrwarn([nick2hand $nick]) 0
}
regsub -all "%nick" $massmsg(warnmsg) "$nick" wmsg
regsub -all "%nick" $massmsg(kickmsg) "$nick" kmsg
for {set cnt 0} {$cnt <= [string length $arg]} {incr cnt} {
if {([string index $arg $cnt] == $laststr)} {
if {$massmsg(ignint) == 1} {
if {([string match [string index $arg $cnt] 0] == 0) && ([string match [string index $arg $cnt] 1] == 0) && ([string match [string index $arg $cnt] 2] == 0) && ([string match [string index $arg $cnt] 3] == 0) && ([string match [string index $arg $cnt] 4] == 0) && ([string match [string index $arg $cnt] 5] == 0) && ([string match [string index $arg $cnt] 6] == 0) && ([string match [string index $arg $cnt] 7] == 0) && ([string match [string index $arg $cnt] 8] == 0) && ([string match [string index $arg $cnt] 9] == 0)} {
incr maxstr
}
} else {
incr maxstr
}
} else {
set maxstr 1
set laststr [string index $arg $cnt]
}
if {$maxstr > $massmsg(maxchr)} {
set spam 1
}
if {$maxstr > $massmsg(hmchr)} {
set spam 2
}
}
if {($spam == 1)} {
incr usrwarn([nick2hand $nick])
regsub -all "%cnt" $wmsg "$usrwarn([nick2hand $nick])" wmsg
putchan $chan $wmsg
}
if {($spam == 2)} {
incr usrwarn([nick2hand $nick])
regsub -all "%cnt" $wmsg "$usrwarn([nick2hand $nick])" wmsg
regsub -all "%cnt" $kmsg "$usrwarn([nick2hand $nick])" kmsg
putchan $chan $wmsg
putkick $chan $nick $kmsg
}
if {($usrwarn([nick2hand $nick]) > $massmsg(warnings))} {
putserv "PRIVMSG $chan : Kicking $nick (Kept Spamming)"
regsub -all "%cnt" $kmsg "$usrwarn([nick2hand $nick])" kmsg
set usrwarn([nick2hand $nick]) 0
putkick $chan $nick $kmsg
return
}
}
putlog "Anti Mass Letter Spam $massmsg(version) by $massmsg(author) loaded (SilentStorm)"
I set the warnings to "2" and I was warned 2 times, but at the third time I got kicked and then got warned again.
Means, the person who will spam, gets a third warning after he got kicked. Can somebody fix this ?[/code]