mIRC Home    About    Download    Register    News    Help

Print Thread
#239377 21/10/12 07:50 PM
Joined: Oct 2012
Posts: 28
H
HeRiNo Offline OP
Ameglian cow
OP Offline
Ameglian cow
H
Joined: Oct 2012
Posts: 28
Hello,

I have one more question. I have this script its a caps warn/kick/ban. I fixed it with your help for an other script yesterday so it kicks the right users. However there is one other issue: The script should warn 2 times en kick the 3th time. It only warn the first time, the second time nothing happens and the 3th time it kick/bans the user. So it counts the second warning but doesnt show it. Can you please help me again?

Code:
#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)
}


I hope you cab help again.

Regards, Herman.

Joined: Jun 2007
Posts: 933
5
Hoopy frood
Offline
Hoopy frood
5
Joined: Jun 2007
Posts: 933
Looks like...

if (%i < %n) {

Should be...

if (%i <= %n) {

Joined: Oct 2012
Posts: 28
H
HeRiNo Offline OP
Ameglian cow
OP Offline
Ameglian cow
H
Joined: Oct 2012
Posts: 28
Hi 5618

great, it works now. Thank you verry much for your help and quick reply.

Regards, Herman.


Link Copied to Clipboard