mIRC Home    About    Download    Register    News    Help

Print Thread
#191761 15/12/07 12:10 PM
Joined: Dec 2007
Posts: 5
W
woof Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
W
Joined: Dec 2007
Posts: 5
Make a script so it kicks people if they over use CAPS.

Like this

meow: This is well COOL! (Wouldn't kick)

}

meow: THIS IS WELL COOL! (Would kick)


After one sentence with 3 or more words in CAPS it kicks them.. Is this possible to do? And has anyone done it? i'm wondering how.

Joined: May 2007
Posts: 89
T
Babel fish
Offline
Babel fish
T
Joined: May 2007
Posts: 89
With
Code:
On $@*:Text:/(?:[[:upper:]]{2,}\b\s?){3,}/S:#channel:KICK # $nick CAPS abuse detected!

Or with
Code:
On @*:Text:*:#channel:{
  If ($regex($1-,/[[:upper:]]{1,}\b\s?/Sg) > 2) {
    KICK # $nick CAPS abuse detected!
  }
}

the desired action shall function.

Otherwise, there are methods with counts the total number of caps characters, then calculates a percentage. And for example, if it's bigger than 80%, sanction!

Code:
On @*:Text:*:#channel:{
  Var %d = $strip($1-) , %l = $len(%d)
  If ($calc($regex(%d,/[[:upper:]]/g) / %l) > 0.8) {
    KICK # $nick CAPS abuse detected!
  }
}


There may be for sure other (even better) methods out there. smile These are just examples.

Cordialement

nb: untested!


tropnul
Joined: Aug 2005
Posts: 1,052
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Aug 2005
Posts: 1,052
Theres also the $isupper command over regex

on @*:TEXT:*:#:{
if ($isupper($1-) == $true) { kick # $nick UPPERCASE Detected! }
}



Code:
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
Joined: Nov 2006
Posts: 1,559
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
Your first reg /(?:[[:upper:]]{2,}\b\s?){3,}/S works only for 3 (ore more) successive upper case words (of 2 or more letters), e.g. catching: SEE YA ALL, not catching: SEE YA @ALL, not catching: SEE - YA - ALL

I wish I could improve such regex method, but I cannot smile ... thus used more plain methods so far, like:
Code:
; calculate caps and caps percent (only upper letters count to caps)
  var %t = $remove($strip($1-),$chr(32),!,?), %l = $len(%t), %c = $regex(%t,/[A-ZÄÖÜ]/g), %p = $round($calc(%c / %l *  100),0)
  ; caps by regular user; and at least 70% of text
  if (($nick isreg $chan) && (%p > 70)) {
    ; at least 10 letters and 3 words; or 40 letters
    if (((%l > 10) && ($numtok($1-,32) >= 3)) || (%l > 40)) {

Last edited by Horstl; 15/12/07 05:34 PM.

Link Copied to Clipboard