Caps Kicker For A Bot

By napa182 on Aug 26, 2007

So what this one does is warns the user not to use caps and if they keep useing them it will kick them if they do it again, and if they still do it they will get banned..Load it in a new remote of a bot and set Ur self as bot owner by typing /owner Urnickhere

alias owner { auser owner $address($1,2) }
on owner:text:!caps*:#:{
  if (!$3) { msg $chan commands are !caps on #channel / !caps off #channel / !caps set number / !crooms }
  elseif ($2 == on) && ($istok(%capschan,$3,44)) {
    msg $chan My Caps Protection Is Already On For $3 
  }
  elseif ($2 == on) {
    set %capschan $addtok(%capschan,$3,44)
    msg $chan My Caps Protection Is Now ON In $3 
  }
  elseif ($2 == off) && (!$istok(%capschan,$3,44)) {
    msg $chan My Caps Protection Is Already OFF For $3 
  }
  elseif ($2 == off) {
    set %capschan $remtok(%capschan,$3,1,44)
    msg $chan My Caps Protection Is Now OFF In Room $3  
  }
  elseif ($2 == set) {
    set %caps $3
    msg $chan I Will Now Warn/Kick/Ban For %caps $+ % Caps.
  }
}
on owner:text:!crooms:#:{ 
  if (!%capschan) { msg $chan My Caps Protection Is NOT ON In Any Room's }
  else { msg $chan My Caps Protection Is On In Room's %capschan }
}
on *:load: { 
  echo 12 -a You Have Just Loaded Napa182's Caps Control. 
  echo 12 -a A Script0rs Inc. Production 
  echo -a 14,1(14,1¯15,1¯0,1¯0,1º $+($chr(171),$chr(164),$chr(88),$chr(167),$chr(199),$chr(174),$chr(238),$chr(254),$chr(116),$chr(48),$chr(174),$chr(167),$chr(88),$chr(164),$chr(187)) º0,1¯15,1¯14,1¯) $+ $chr(153)
}
on *:text:*:%capschan: {
  if ($nick(#,$nick,vr)) && ($len($1-) > 5) {
    var %percent $calc($regex($1-,/[A-Z]/g)/$len($1-)*100)
    if (%percent > %caps) {
      inc $+(%,caps,.,$nick,.,$chan)
      if ($($+(%,caps,.,$nick,.,$chan),2) == 1) { msg $chan $nick Please Dont Use Cap's Here.. $round(%percent,0) $+ % Of Ur Message Was In Caps! }
      if ($($+(%,caps,.,$nick,.,$chan),2) == 2) { kick $chan $nick Please Turn Caps Lock Off Or Next It's A Ban.. $round(%percent,0) $+ % Of Ur Message Was In Caps! } 
      if ($($+(%,caps,.,$nick,.,$chan),2) == 3) { ban -ku600 # $nick 2 you were warned Not To Use Caps Here. $round(%percent,0) $+ % Of Ur Message Was In Caps | unset $+(%,caps,.,$nick,.,$chan) }
    }
  }
}

Comments

Sign in to comment.
worldwide7477   -  May 17, 2012

Another great job napa i'm just gonna follow you to get hooked up !! much thanks once again.

 Respond  
Jethro   -  Jun 28, 2010

is there a way to make it so that when a an op types !caps on/off
you don't have to enter the channel name. it sets it off/on in the channel where !caps on/off was typed.Keon191, here you go:

on @*:text:*:#:nocaps $1-
on @*:action:*:#:nocaps $1-
on @*:notice:*:#:nocaps $1-
alias -l nocaps {
  if (($nick isop #) && ($regex($1-,/^!caps (on|off|set\s(\d+))/iS))) {
    goto $replace($regml(1),on,on,off,off,set,set) | :on
    if !$istok(%capschan,#,32) {
      set %capschan $addtok(%capschan,#,32)
      .msg # * My Caps Protection is now ON in: # | halt
    }
    else { .msg # * Caps Protection is already ON for the channel: # | halt }
    :off | if $istok(%capschan,#,32) {
      set %capschan $remtok(%capschan,#,1,32)
      .msg # * My Caps Protection is now OFF in: # | halt
    }
    else { .msg # * Caps Protection is either removed or already OFF for the channel: # | halt }
    :set | set %caps $regml(2) | .msg # * I Will Now Warn/Kick/Ban for %caps $+ % of Caps. | halt
  }
  else {
    if $findtok(%capschan,#,1,32) {
      var %percent $calc($regex($1-,/[A-Z]/g)/$len($1-)*100)
      if (($nick(#,$nick,vr)) && ($len($1-) > 5) && (%percent > %caps)) {
        inc $+(%,caps,.,$nick,.,#) | if $($+(%,caps,.,$nick,.,#),2) >= 3 {
          ban -ku600 # $nick 2 You were warned not to use caps. $&
            $round(%percent,0) $+ % of your message was in caps.
          unset $+(%,caps,.,$nick,.,#)
        }
        elseif $($+(%,caps,.,$nick,.,#),2) = 2 {
          kick # $nick Please turn caps lock off or next offense is going to be a ban. $&
            $round(%percent,0) $+ % of your message was in caps!
        }
        else {
          msg # $nick $+ , please DO NOT use caps. $round(%percent,0) $+ % of your message was in caps!
        }
      }
    }
  }
}
dma  -  Nov 23, 2015

very good

Sign in to comment

Keon191   -  Jun 28, 2010

jethro_ quick question. is there a way to make it so that when a an op types !caps on/off
you don't have to enter the channel name. it sets it off/on in the channel where !caps on/off was typed.

 Respond  
Jethro   -  Jun 28, 2010

I updated the script and removed the "written in caps" part of the message.

 Respond  
michealkenny   -  Jun 28, 2010

i know i'm asking for a lot but is there anyway that the bot can remove the message written in caps?

 Respond  
michealkenny   -  Jun 28, 2010

thank you! :D

 Respond  
Jethro   -  Jun 28, 2010

Opps, my bad. Actually my modification for napa182's script does not have those commands anymore.

All the commands you need currently are:

!caps on #chan <- This is to add the channels you want the script to work in. You can add as many as you want.

!caps off #chan <- This is to remove the script from working in the channels that you've set initially.

!caps set NumberHere <- This is to set the caps percentage allowance.Only ops can initiate these commands, and they won't be affected by the script. This script will only watch for voiced and regular users.

 Respond  
michealkenny   -  Jun 28, 2010

thank you so much, are you like a mod here, i see you everywhere, lol

Edit: when I type /owner username, it says unknown command? and !crooms doesn't work...

 Respond  
Jethro   -  Jun 28, 2010

is there any way for this to warn the user 1 time and then just kick him every time he uses caps aftermichealkenny, here you go:

on @*:text:*:#:nocaps $1-
on @*:action:*:#:nocaps $1-
on @*:notice:*:#:nocaps $1-
alias -l nocaps {
  if (($nick isop #) && ($regex($1-,/^!caps (on|off|set) (\43\S+|\d+)/iS))) {
    goto $replace($regml(1),on,on,off,off,set,set) | :on
    if !$istok(%capschan,$regml(2),32) {
      set %capschan $addtok(%capschan,$regml(2),32)
      .msg # * My Caps Protection is now ON in: $regml(2) | halt
    }
    else { .msg # * Caps Protection is already ON for the channel: $regml(2) | halt }
    :off | if $istok(%capschan,$regml(2),32) {
      set %capschan $remtok(%capschan,$regml(2),1,32)
      .msg # * My Caps Protection is now OFF in: $regml(2) | halt
    }
    else { .msg # * Caps Protection is either removed or already OFF for the channel: $regml(2) | halt }
    :set | set %caps $regml(2) | .msg # * I Will Now Warn/Kick/Ban for %caps $+ % of Caps. | halt
  }
  else {
    if $findtok(%capschan,#,1,32) {
      var %percent $calc($regex($1-,/[A-Z]/g)/$len($1-)*100)
      if (($nick(#,$nick,vr)) && ($len($1-) > 5) && (%percent > %caps)) {
        inc -e $+(%,caps,.,$nick,.,#) | if $($+(%,caps,.,$nick,.,#),2) > 1 {
          kick # $nick You were warned one time not to use caps.
        }
        else {
          msg # $nick $+ , please DO NOT use caps.
        }
      }
    }
  }
}
 Respond  
michealkenny   -  Jun 28, 2010

is there any way for this to warn the user 1 time and then just kick him every time he uses caps after, I don't want to give my bot the ability to ban somebody, if a user is a serious problem, then the mods can ban him

 Respond  
Jethro   -  Jun 22, 2010

Please delete.

 Respond  
Keon191   -  Jun 22, 2010

@Jethro_ i did what you said but it seems anyone can use the commands
!caps on #channel / !caps off #channel / !caps set number / !crooms.

 Respond  
napa182   -  Jun 22, 2010

lol yes it does =P maybe one day I will...

 Respond  
Jethro   -  Jun 22, 2010

Keon191,

Just remove the alias owner

Then under those two text events, change them to:

The 1st text event:

[i]on :text:!caps:#:{
if ($nick isop $chan) && (!$3) {[/i]

The 2nd text event:

[i]on *:text:!crooms:#:{
if ($nick isop $chan) && (!%capschan) {[/i]

The rest remain the same.

All the text events can be combined into one. But I doubt napa182 will update this, as he said this snippet bores him. :/

 Respond  
Keon191   -  Jun 22, 2010

Hey i was wondering is there is there a way to make this work for op's instead of owners. what i mean is instead of setting an owner can you make this work for all op's.

 Respond  
napa182   -  Jan 14, 2010

@Klasic Kumputerz why are you asking the same thing in ever Cap snippet ffs wait for someone to reply instead of asking over and over. this is such an old snippet and il
prob never rewrite it so if you would read the command line in the f'n script it would tell you.

Yes i know this is n old snippet an needs to be redone but it bores me

 Respond  
Klasic Kumputerz   -  Jan 14, 2010

Sorry for asking the same question on those three just wondered if it would be basicaly the same for each one.

 Respond  
Jethro   -  Jan 14, 2010

You really need to take a look at mirc's help file for the on text event first before asking the same question repeatedly as a troll: /help on text

 Respond  
Klasic Kumputerz   -  Jan 14, 2010

How do you make this script channel specific so you don't take it into every channel you are open on?

Example:

on owner:text:!caps*:#channelname:{

 Respond  
LaTiNo   -  Oct 25, 2009

I cannot to use your CAPS PROTECTION.. :S!
Make more easy to use it ! On a Dialog.. is best
I don't understand nothing

 Respond  
fire_wizard1   -  Dec 04, 2008

ik that, it was a typo ok

 Respond  
napa182   -  Dec 04, 2008

fire_wizard1 said:

so for example, if i type !caps 5 it will kick or warn the person if the person uses five words that have been caped then??

Well if you did " !caps set 5 " it would kick for 5% of caps. You are better off doing " !caps set 50 "

 Respond  
fire_wizard1   -  Dec 04, 2008

it works well for me

 Respond  
fire_wizard1   -  Nov 29, 2008

so for example, if i type !caps 5 it will kick or warn the person if the person uses five words that have been caped then??

 Respond  
napa182   -  Nov 16, 2008

um not anyone only the addy that is added as owner can trigger the commands. it's for uses as a bot code so you have to use it on a bot unless you make it an on input or an alias to use for ur self.

for this code to be triggered the person has to have typed a $len count of 5 so it wont go off for LOL.

what you do is load the code into ur bot's remote. then on ur bots side type /owner nick_you_want_as_owner
then on users side type !caps on #room_for_it_to_work_on
!caps set 50 for 50%

 Respond  
Swoop   -  Nov 16, 2008

OK, I got it sorted out.

APPARENTLY I, as the /owner, can NOT set the parameters myself! I have to login with another client to manage it.

Does this mean anyone can do "!caps off" if they want?

I logged in remotely with another computer as just a regular user, not added to the /owner list, and was able to do "!caps set 30" and "!caps off" and it worked.

I thought only OPS could update it, or the owner? When I (after doing /owner Swoop) type "!crooms" I get nothing.

Lastly, is it possible to check word count for CapsKicker to only do its work on sentances with more than two words? I don't want "LOL" for example to ban someone even though that's 100% caps.

Thanks.

 Respond  
Swoop   -  Nov 16, 2008

Thanks, that was quick!
I load it and the banner comes up saying it was loaded so that's good.
Then I run /owner nick and i get echoed back I was added, that's good...

  • Added !@c-76-110-244-47.hsd1.fl.comcast.net to user list
    But then if I type A SENTANCE ALL IN CAPS, or someone else in the room does, nothing.
    I'm using mIRC V 6.35 and set as an Op.
    What command gives me the crooms report for example, and how do I verify it's running?
    Again, thanks!!
 Respond  
napa182   -  Nov 16, 2008

Load it in a new remote of a bot and set Ur self as bot owner by typing /owner Urnickhere

 Respond  
Swoop   -  Nov 15, 2008

How do I use this? It loads, but it won't work. I been out of IRC for a few years, but the !caps on command does not work. Help me out if you don't mind, thanks!!

 Respond  
xplo   -  Nov 02, 2008

This is Awesome :)

I implemented id on my bot, keep it up ;)

 Respond  
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.