CAPS kicker on 2nd warning

CAPS kicker on 2nd warning

mIRC Snippet for channel protection - this script checks for abuse caps and warns + ban after 2,3 repeats.

Postat de Copyright Categorie Review user Vizualizari Data
BLKoldSUN Herino chanops Cod testat 507 2024-08-07 18:31:58

#caps On  
on @*:TEXT:*:#:{ 
  var %n 2
  if ($regex($nick($chan,$nick).pnick, /[~|@].*/) != 1) { 
    var %percentage 60
    if ($calc($regex($1-,/[A-Z]/g) / $len($1-) * 100) > %percentage) {
      if (%n < 3)  {
        inc $+(%,caps,.,$nick,.,$wildsite)
        var %i $($+(%,caps,.,$nick,.,$wildsite),2)
        if (%i <= %n) { 
          msg $chan You are currently using too many captial letters. This is the $ord(%i) time that you have broken this rule. Please stop this conduct or immidiate action will be taken against you.
        } 
        if (%i = 3) { 
          ban -ku120 # $nick You are using $calc($regex($1-,/[A-Z]/g) / $len($1-) * 100) percent caps. You have been warned before, you will now be banned.
          unset $+(%caps,.,$nick,.,$wildsite)
        }
      }
    }
  }
}

on @*:ACTION:*:#:{ 
  var %n 2
  if ($nick isreg $chan) { 
    var %percentage 60
    if ($calc($regex($1-,/[A-Z]/g) / $len($1-) * 100) > %percentage) {
      if (%n < 3)  {
        inc $+(%,caps,.,$nick,.,$wildsite)
        var %i $($+(%,caps,.,$nick,.,$wildsite),2)
        if (%i <= %n) { 
          msg $chan You are currently using too many captial letters. This is the $ord(%i) time that you have broken this rule. Please stop this conduct or immidiate action will be taken against you.
        } 
        if (%i = 3) { 
          ban -ku120 # $nick You are using $calc($regex($1-,/[A-Z]/g) / $len($1-) * 100) percent caps. You have been warned before, you will now be banned.
          unset $+(%caps,.,$nick,.,$wildsite)
        }
      }
    }
  }
}
#caps end

menu channel { 
  caps kicker $group(#caps).status:
  .On/off:$iif($group(#caps).status = off, enable #caps, disable #caps)
}