caplock and ascii kicker regex

By AnDyWong on Jan 07, 2009

caplock and ascii kicker... using regex
just copy and paste in new remote..

alias addCaps {
  if (%capslockmode == off) { return no | halt }
  var %xcappcnt $calc($calc($regex($strip($3-),/[A-Z]/g)/$len($strip($3-))) * 100)
  if (%xcappcnt > %caplockmaxpcnt) {
    inc -u120 $+(%,caps.,$1,.,$2)
    if (%caplockwarning == off) && ($($+(%,caps.,$1,.,$2),2) = 2) { .ban $(-ku $+ %caplockbantime) $1 $2 1 12Caps Lock Kick::2 Turn off you Caps Lock 4[ $+ $round(%xcappcnt,0) $+ % $+ ][Ban time %caplockbantime $+ sec(s)] | unset $+(%,caps.,$1,.,$2) | halt
 }
    if ($($+(%,caps.,$1,.,$2),2) = 2) { msg $1 Warning 1 for $2 :: Turn off you Caps Lock $iif(c !isin $chan($1).mode,4) [ $+ $round(%xcappcnt,0) $+ % $+ ] | halt }
    if ($($+(%,caps.,$1,.,$2),2) = 4) { msg $1 Last Warning for $2 :: Turn off you Caps Lock or you are banned $iif(c !isin $chan($1).mode,4) [ $+ $round(%xcappcnt,0) $+ % $+ ] | halt }
    if ($($+(%,caps.,$1,.,$2),2) = 6) { .ban $(-ku $+ %caplockbantime) $1 $2 1 12Caps Lock Kick::2 Turn off you Caps Lock 4[ $+ $round(%xcappcnt,0) $+ % $+ ][Ban time %caplockbantime $+ sec(s)] | unset $+(%,caps.,$1,.,$2) | halt   }
    return yes
    halt
  }
  return no
}

alias Isasciikick {
  if (%asciikickmode == off) { return no | halt }
  if ($len($1-) < 5) { return no | halt }

  var %xasciicnt $calc($calc($regex($strip($1-),/[¢-ÿ]/g)/$len($strip($1-))) * 100)
  if (%xasciicnt >= %asciimaxpcnt) {
    return yes
    halt
  }
  return no
}

on 1:text:*:#:{

 if ($nick isop #) { return }
 if ($nick isvo #) { return }
  if ($me !isop #) { return }
  if ($addCaps(#,$nick,$1-) == yes) { halt }
  if ($Isasciikick($1-) == yes) {
    if ($($+(%,asciik,.,#),2) != $null) && ($istok($($+(%,asciik,.,#),2),$nick,32) == $true) { return }
    set -u3 $+(%,asciik,.,#) $addtok($($+(%,asciik,.,#),2),$nick,32)
    ban $(-ku $+ %asciikickbantime) # $nick 2Ascii kick:: 10Ascii Code $round($calc($calc($regex($strip($1-),/[¢-ÿ]/g)/$len($strip($1-))) * 100),1) $+ % ::5Max allowed less then %asciimaxpcnt $+ 7%
    halt
  }

}

on *:load:{
set %capslockmode on
set %caplockbantime 120
set %caplockmaxpcnt 65
set %caplockwarning off

set %asciikickmode on
set %asciimaxpcnt 65
set %asciikickbantime 120
}

menu channel {
Channel PRO
  .Caps Lock
  ..Mode- $+ $(%capslockmode):set %capslockmode $iif(%capslockmode == on,off,on)
  ..Max Percent- $+ $(%caplockmaxpcnt):/set %caplockmaxpcnt $$input(Percent 1-100,-e,Max,%caplockmaxpcnt)
  ..Ban Time(s)- $+ $(%caplockbantime):/set %caplockbantime $$input(Ban time(s),-e,Ban time,%caplockbantime)
  ..Warning- $+ $(%caplockwarning):/set %caplockwarning $iif(%caplockwarning == on,off,on)

  .Ascii Kick[162-255]
  ..Mode- $+ $(%asciikickmode):/set %asciikickmode $iif(%asciikickmode == on,off,on)
  ..Max Percent- $+ $(%asciimaxpcnt):/set %asciimaxpcnt $$input(Max Percent,-e,Percent 1-100,%asciimaxpcnt)
  ..Ban Time(s)- $+ $(%asciikickbantime):/set %asciikickbantime $$input(Ban time Sec(s),-e,Ban,%asciikickbantime)

}

Comments

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.