Code that kicks a user with more than 65 percent caps and ten characters.
Probably done a million times before but I decided to use hash tables in this so it has a bit of original quality to it.
on @!*:text:*:#:{
if ($nick isreg $chan && $len($remove($1-,$chr(32))) > 10) {
if ($calc($regex($1-,/[A-Z]/g) / $v2 * 100) > 65) {
if (!$hget(capshash)) { hmake capshash }
hinc capshash $+(caps,.,$nick,.,$wildsite) 1
if ($hget(capshash,$+(caps,.,$nick,.,$wildsite)) < 3) {
msg $chan $nick $+ , this is your $ord($v1) time you have used excessive capital letters. No more of this conduct or you will be banned.
}
if ($hget(capshash,$+(caps,.,$nick,.,$wildsite)) = 3) {
ban -ku300 $chan $nick Your text contains $calc($regex($1-,/[A-Z]/g) / $len($remove($1-,$chr(32))) * 100) percent caps. You have been warned $ord($v1) times.
hdel capshash $+(caps,.,$nick,.,$wildsite)
}
}
}
}
How would you modify this so that it wouldnt active on certain words like..(www./youtube.com/.com/http://)Just add an if check under the text event:
if (!$regex($$1-,/(http\72\/\/|w{3}\.)youtube\.com.*/iS)) {