Why putting $removecs, $isupper etc in a caps protection, when in a few lines you can code it with $regex :)
Simple efficient caps protection
You only have to change this line :
if (%percaps >= 60) {
if (%percaps >= 60) will kick a user who has 60% caps in text and more
if ($len($1-) >= 15) && ($nick isreg #) { <-- This will make the caps protection take action if text`s length is more than 15 or 15 letters and nick is a normal user on the channel :)
Thanks xDaeMoN for making the code look simpler and smaller
on @*:text:*:#:{
if ( $len($1-) >= 15 ) && ( $nick isreg # ) {
if ( $calc($regex($1-,/[A-Z]/g) / $regex($1-,/[A-Z]/gi) * 100) >= 60 ) kick # $nick $v1 $+ % Caps
}
}
Ok then lets base that on a few of yur posts then :
http://www.hawkee.com/snippet/4614/ <-- Incomplete code and untested before posting
http://www.hawkee.com/snippet/4526/ <-- * /if: \'iswn\' unknown operator also your event is messed up.Just my opinion of course.`-.-´
\"($nick isreg)\" won\'t work because it needs a channel. That should be \"($nick isreg #)\"
You can also minimize your code by not using variables like this:
on @:text::#:{
if ( $len($1-) >= 15 ) && ( $nick isreg # ) {
if ( $calc($regex($1-,/[A-Z]/g) / $regex($1-,/[A-Z]/gi) * 100) >= 60 ) kick # $nick $v1 $+ % Caps
}
}
I think checking if the length of the text typed is 100 or more is a bit high, I only put 15.