Skip to content
MSN

caps kick

A TG007 community discussion started by DalienX.

Discussion 4 posts
Page 1 of 1
Open
Topic #3070 · 4 published posts · 386 views

Hi all, i have this caps kick here but when i load it, the script stops seeing certain people. I can see them typeing in webchat but though the mirc screen its like they are not talking at all. It only happens when this script is loaded so i know the fault is in here somewhere.

 


on ^*:TEXT:*:#:{
 if ($level($address($nick,1)) == boss) halt
 if ($level($address($nick,1)) == friend) halt
 if ($level($address($nick,1)) == gold) halt
 if ($len($1-) < 20) { return }
 var %caps.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)))
 var %caps = $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)))
 var %caps.percent = $round($calc(%caps / %caps.letters * 100),0)
 if ((%caps.percent > $allowedcaps) && ($nick !isop #)) {   
   set -u260 %rl. [ $+ [ $address($nick,2) ] ] $calc( %rl. [ $+ [ $address($nick,2) ] ] + 1)
  ;the -u60 makes the variable unset after 60 secs without being used
   if (%rl. [ $+ [ $address($nick,2) ] ] == 1) /privmsg # $replace($nick,>,Guest_) We don't like caps in this room, please take you caps lock off, thankyou :)
   if (%rl. [ $+ [ $address($nick,2) ] ] == 2) /privmsg # $replace($nick,>,Guest_) ,If you continue to use caps you will be kicked from this room 
   if (%rl. [ $+ [ $address($nick,2) ] ] >= 3) {
     access $chan add deny $address 5 : caps kick $replace($nick,>,Guest_) added by $replace($me,>,Guest_) at $date @ $time
     access $chan add deny $nick 5 : caps kick $replace($nick,>,Guest_) added by $replace($me,>,Guest_) at $date @ $time
     kick # $nick i asked you nicely, not to use caps, maybe a 5 minute break will improve you listning skills (access ban 5 minutes)
   }
 }
}
on ^*:ACTION:*:#:{
 if ($level($address($nick,1)) == boss) halt
 if ($level($address($nick,1)) == friend) halt
 if ($level($address($nick,1)) == gold) halt
 if ($len($1-) < 20) { return }
 var %caps.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)))
 var %caps = $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)))
 var %caps.percent = $round($calc(%caps / %caps.letters * 100),0)
 if ((%caps.percent > $allowedcaps) && ($nick !isop #)) {   
   set -u60 %rl. [ $+ [ $address($nick,2) ] ] $calc( %rl. [ $+ [ $address($nick,2) ] ] + 1)
  ;the -u60 makes the variable unset after 60 secs without being used
   if (%rl. [ $+ [ $address($nick,2) ] ] == 1) /privmsg # Please do to use so many Caps $replace($nick,>,Guest_) first warning
   if (%rl. [ $+ [ $address($nick,2) ] ] == 2) /privmsg # Second and last warning $replace($nick,>,Guest_) ,If you continue to use caps you will be kicked from this room 
   if (%rl. [ $+ [ $address($nick,2) ] ] >= 3) {
     access $chan add deny $address 1 :caps kick $replace($nick,>,Guest_) added by $replace($me,>,Guest_) at $date @ $time
     access $chan add deny $nick 1 :caps kick $replace($nick,>,Guest_) added by $replace($me,>,Guest_) at $date @ $time
     kick # $nick You were warned about using caps (access ban 1 minute)
   }
 }
}
on ^*:NOTICE:*:#:{
 if (alien isin $nick) halt
 if ($nick isowner #) halt
 if ($len($1-) < 20) { return }
 var %caps.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)))
 var %caps = $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)))
 var %caps.percent = $round($calc(%caps / %caps.letters * 100),0)
 if ((%caps.percent > $allowedcaps) && ($nick !isop #)) {   
   set -u60 %rl. [ $+ [ $address($nick,2) ] ] $calc( %rl. [ $+ [ $address($nick,2) ] ] + 1)
  ;the -u60 makes the variable unset after 60 secs without being used
   if (%rl. [ $+ [ $address($nick,2) ] ] == 1) /privmsg # Please do to use so many Caps $replace($nick,>,Guest_) first warning
   if (%rl. [ $+ [ $address($nick,2) ] ] == 2) /privmsg # Second and last warning $replace($nick,>,Guest_) ,If you continue to use caps you will be kicked from this room 
   if (%rl. [ $+ [ $address($nick,2) ] ] >= 3) {
     access $chan add deny $address 1 : caps kick $replace($nick,>,Guest_) added by $replace($me,>,Guest_) at $date @ $time
     access $chan add deny $nick 1 : caps kick $replace($nick,>,Guest_) added by $replace($me,>,Guest_) at $date @ $time
     kick # $nick You were warned about using caps (access ban 1 minute)
   }
 }
}

alias allowedcaps { return 70 }

its what you get for taking coding out of another script and changing it for your own script, it looks very much like my coding out of kenobi, anyway put it in its own file and then load it, do NOT add it to an existing file

My code does NOT have bugs. It just develops random features.

I made this up as I went along. It works (tried & tested) but it may flood out.

on 1:text:*:#:{
 if ($capcheck(70,$1-) == true) { kick $chan $nick Excess caps }
 else { echo -a $ifmatch }
}
alias capcheck {
 if ((!$1) || ($1 !isnum)) || (!$2) { return Missing element }
 var %c = 65, %1 = $2-
 while (%c <= 90) {
   var %1 = $removecs(%1,$chr(%c))
   inc %c
 }
 if ($calc(($len(%1) / $len($2-)) * 100) => $1) { return true }
}

As you can see, it currently only accounts for one line but that's easily remedied. Feel free to edit it.

 

its what you get for taking coding out of another script and changing it for your own script, it looks very much like my coding out of kenobi, anyway put it in its own file and then load it, do NOT add it to an existing file

While ill admit i didnt write this code, i have never downloaded kenobi..

of course its always possible someone else robbed it from kenobi and posted it somewhere

Anyway, it is in its own file, and it used to work fine with vincular (wich makes sence since it was written for that), but there must be something in it that Nuclear doesnt like.