on @*:TEXT:*:#: {
if ($len($1-) < 9) || ($nick isop #) return
var %text = $strip($remove($1-,$chr(32)))
var %non.caps = $len($removecs(%text,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z))
; %non.caps counts number of non-caps - note how it uses $removeCS (Case SenSiTiVE)
var %full.line = $len($strip($remove(%text,$chr(32))))
; %full.line counts total length of line (with spaces removed)
var %percent = $calc(1 - (%non.caps / %full.line))
;This %percent is set to how much of the text is actually caps. This used to be a lot harder to do,
;but Khaled then added $removeCS which allowed you to remove letters by their case. So if you compare
;the length of text with the length of text with the uppercase words removed, you can calculate how
;much of the text as a percentage was caps
if (%percent >= 0.8) {
;This if statement checks the percent of text that is caps,
; and if its greater or equal to 0.8 then it will kick the person
;percent can range from 0.0 to 1.0
ban -u60 # $nick 11
kick # $nick Your text contains $calc(%percent * 100) percent caps. This is not acceptable
}
}