CAPS KICK BAN

By sukhbira on Mar 13, 2013

The Excessive Caps Kicker can also be done in two ways. However the below method is generally the best:

ON ^1:TEXT:*:#:{
 IF ($nick !isreg $chan) { RETURN }
 ; Skip this remote if the nick is an op / voice / halfop of the channel
 VAR Ãps = $len($strip($1-)) 
 ; create a variable Ãps with the length of the text (strip out)
 Ãps = Ãps - $len($removecs($strip($1-),Q,W,E,R,T,Y,U,I,O,P,A,S,D,F,G,H,J,K,L,Z,X,C,V,B,N,M))
 ; calculate the capital letters used in the text by minus the caps filtered text with the the variable Ãps
 IF (Ãps >= 60) {
 ; check Ãps with the allowed limit
  IF ($me isop $chan) {
  ; get ready to get some butt if you are an op
   IF ($nick ison $chan) { .raw -q kick $chan $nick :CAPS Length Exceeded }
   ; if the nick is presence in the channel, kick him out
   mode $chan +b $mask($fulladdress,3)
   ; ban the user
  }
  haltdef 
  .ignore -u30 $mask($fulladdress,3)

  ; halt the default text and ignore the user for 30 secs.
 }
}
alias allowedcaps { RETURN 70 }
; This alias tells the following script that the allowed percentage for caps in a users
; text is 70 percent. Change the 70 to whatever suits you.
ON @*:TEXT:*:#:{ 
  ;this event will only trigger in any channel, and only if your are opped in that channel
  IF ($len($1-) < 10) { RETURN }
  ; First checks to make sure they said more than 10 letters.
  VAR Ãps.letters = $calc($len($1-) + 1 - $len($removecs(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)))
  ; sets the number of letters in the text, and filters out symbols, signs etc.
  VAR Ãps = $calc($len($1-) - $len($removecs($1-,($1-),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)))
  ; sets the number of caps in the text
  VAR Ãps.percent = $round($calc(Ãps / Ãps.letters * 100),0)
  ; sets the percentage of caps in the text
  IF ((Ãps.percent > $allowedcaps) && ($nick !isop #)) {
  ; checks to see if the percent of caps is over the limit, and that the user is not opped
  ban # $nick 2 
  kick # $nick Caps Allowed: $allowedcaps $+ $chr(37) Caps Used: Ãps $+ $chr(37)
  ; Kick/Bans the user from the channel
  } 
}
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))
  VAR %full.line = $len($strip($remove(%text,$chr(32))))
  VAR %percent = $calc(1 - (%non.caps / %full.line))
  IF (%percent >= 0.8) {
    kick #  $nick 12 Your text contains $calc(%percent * 100) percent caps. Turn caps OFF
  }
}

Comments

Sign in to comment.
MoonCrawlerVG   -  Nov 21, 2013

how can I change it so it only kicks when a user uses caps more than a certain number, other than kicking when a user types lowercase more than a certain number of letters

 Respond  
Hawkee   -  Mar 13, 2013

The first two code blocks look the same.

Sorasyn  -  Mar 14, 2013

It appears that "%" signs are being turned to "Ê" in places where variables are referenced. At least this is the case with the first three code blocks, or perhaps that's the way it was posted. Either way, odd.

ProIcons  -  Mar 14, 2013
%test

Probably something is wrong with his encoding options or smth

Sign in to comment

Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.