Hi, im new to the forum and new to tcl, my main problem is that the Caps Check of chanpro, works perfect, except that it kicks user when they type for example "****************************************"
I only want the script to kick people using Letter Caps, ABCDEFGHIJKLMOPQRSTUVWXYZ , not other characters.
#Set the channels here where you wish the kick to be activated on.
#Usage set capschans "#channel1, #channel2, #channel3"
set capschans "#funchat"
#Set this to the minimum text size, before it will act
set capsmin 70
# Minimum percentage of CAPS detected from the full text
set capslen 65
#Set the bantime for the CAPS kick
set capsbantime 30
bind pubm - * pubm:capslock
proc pubm:capslock {nick uhost hand chan arg} {
global botnick capschans capsmin capslen capsbantime
if {[string length $arg] < $capsmin} {return 0}
set capsban "*!*@[lindex [split $uhost @] 1]"
set arg [ctrl:filter $arg]
set maxcaps "[string length $arg]"
regsub -all {[A-Z]} $arg "" counted
set countcaps [string length $counted]
set capsper [expr (($maxcaps - $countcaps) * 100) / $maxcaps]
if {(([lsearch -exact [string tolower $capschans] [string tolower $chan]] != -1) || ($capschans == "*"))} {
if {([botisop $chan]) && (![isop $nick $chan]) && (![isvoice $nick $chan]) && (![matchattr $hand mnf|mnf $chan]) && ([onchan $nick $chan]) && ($capsper > $capslen)} {
set capsrange "[string range $capsper 0 100]%"
putquick "MODE $chan +b $capsban"
putquick "KICK $chan $nick :0,1 Excessive CAPS Text Kick 12,0 - 12Exceeded the limit of2 $capslen% percent 12of caps by typing2 *$maxcaps* capital characters, 12at a rate of2 $capsrange percent. 12Please turn *off* your 2caps lock switch, 12which is located 2left to the 'A' button 12on your keyboard."
timer $capsbantime "pushmode $chan -b $capsban"
return 0
}
}
}
## Thanks to ppslim for this filter
proc ctrl:filter {str} {
regsub -all -- {\003[0-9]{0,2}(,[0-9]{0,2})?|\017|\037|\002|\026|\006|\007} $str "" str
return $str
}
·awyeah·
==================================
Facebook: jawad@idsia.ch (Jay Dee) PS: Guys, I don't accept script helps or requests personally anymore.
==================================