mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Mar 2014
Posts: 65
E
Exuviax Offline OP
Babel fish
OP Offline
Babel fish
E
Joined: Mar 2014
Posts: 65
It would seem that every time I have

Code:
 
ON @*:TEXT:*:#: {


everything underneath that code doesn't seem to work anymore. Is there a certain way to get around this? Here is the code that is messing up.

Code:
ON @*:TEXT:*:#: {
  IF (($len($1-) < 9) || ($nick isop #)) { RETURN }
  VAR %text = $strip($remove($1-,$chr(32)))
  VAR %non.caps = $len($removecs(%text,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 %full.line = $len($strip($remove(%text,$chr(32))))
  VAR %percent = $calc(1 - (%non.caps / %full.line))
  IF (%percent >= 0.8) {
    msg # .timeout $nick 2
    msg # $nick Your text contains $calc(%percent * 100) percent caps. This is not acceptable
  }
}

ON @*:TEXT:*:#: {
  IF (%spamchar) { 
    IF ($nick isop #) { RETURN }
    IF ($len($strip($1-)) >= 180) {
      if ($($+(%,spam.,$nick),2)) {
        var %spamtimeout = $rand(1,5)
        if (%spamtimeout == 1) { 
          msg # .timeout $nick 120
          msg # $nick --> What do you not understand about keeping it below 180 characters? Take this time to think about your actions. (Timeout)
          unset %spam. $+ $nick On 
        }
        if (%spamtimeout == 2) {
          msg # .timeout $nick 120
          msg # $nick --> Really, your going to keep spamming that chat with your new novel? Keep it below 180 characters (Timeout)
          unset %spam. $+ $nick On 
        }
        if (%spamtimeout == 3) {
          msg # .timeout $nick 120
          msg # /me smacks $nick out of the chat! Keep it below 180 characters (Timeout)
          unset %spam. $+ $nick On 
        }
        if (%spamtimeout == 4) {
          msg # .timeout $nick 120
          msg # $nick --> Here, maybe this will help you understand! Keep it below 180 characters (Timeout)
          unset %spam. $+ $nick On 
        }
        if (%spamtimeout == 5) {
          msg # .timeout $nick 120
          msg # $nick --> !Spam Keep it below 180 characters (Timeout)
          unset %spam. $+ $nick On 
        }
      }
      else {
        var %spamwarning = $rand(1,5)
        if (%spamwarning == 1) { 
          msg # .timeout $nick 5
          msg # $nick --> Ain't nobody got time for that! Keep it below 180 characters (Warning)
          set -u120 %spam. $+ $nick On 
        }
        if (%spamwarning == 2) {
          msg # .timeout $nick 5
          msg # $nick --> Woooah, no one has time for that novel! Keep it below 180 characters (Warning)
          set -u120 %spam. $+ $nick On 
        }
        if (%spamwarning == 3) {
          msg # .timeout $nick 5
          msg # /me smacks $nick ! Keep it below 180 characters (Warning)
          set -u120 %spam. $+ $nick On 
        }
        if (%spamwarning == 4) {
          msg # .timeout $nick 5
          msg # $nick --> No. (Warnareno)
          set -u120 %spam. $+ $nick On 
        }
        if (%spamwarning == 5) {
          msg # .timeout $nick 5
          msg # $nick --> Why u post so much? Keep it below 180 characters (Warning)
          set -u120 %spam. $+ $nick On 
        }
      }
    }
  }
  else { RETURN }
}



Also, on a random other note. How do I make commands channel specific. As you probably know, this is a Twitch bot, so I am trying to make it working in multiple channels interdependently. Like so

Code:

 on *:TEXT:!spamchar on:#: {
  if ($nick isop #) {
    msg # I will now remove posts over 180 characters.
    set %spamchar ON
  }
}
on *:TEXT:!spamchar off:#: {
  if ($nick isop #) {
    msg # I will no longer remove posts over 180 characters.
    unset %spamchar
  }
}



I would like the variable to be channel specific. So if I do "!spamchar on" in one channel, the variable would show up as "%spamchar #theexuviax" then the the over 180 character removing script above would only work in certain channels.

Thanks in advanced.


I do things with stuff that makes other things do stuff.
Joined: Jan 2004
Posts: 1,358
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,358
That's by design. Only a single text event per script will ever trigger. You can put all the content under a single event, or put them in different files.

You can use dynamic variable names as so: %spam [ $+ [ # ] ]

Joined: Mar 2014
Posts: 65
E
Exuviax Offline OP
Babel fish
OP Offline
Babel fish
E
Joined: Mar 2014
Posts: 65
This may sound stupid, but how would I have multiple scripts running for one bot? Would I use text files? Or... Sorry, I am still learning mIRC, but I know the code pretty well.


Or better yet, what would be a better program to code a twitch bot in, I one day want to have this bot run off it's own server and setup by a website? (This would be the most help)

Last edited by Exuviax; 26/04/14 10:50 PM.

I do things with stuff that makes other things do stuff.
Joined: Jan 2004
Posts: 1,358
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,358
File > new

Joined: Mar 2014
Posts: 65
E
Exuviax Offline OP
Babel fish
OP Offline
Babel fish
E
Joined: Mar 2014
Posts: 65
That will create a new one, but it won't have both scripts working at once. At least, I don't know how.

Last edited by Exuviax; 26/04/14 11:09 PM.

I do things with stuff that makes other things do stuff.
Joined: Mar 2014
Posts: 65
E
Exuviax Offline OP
Babel fish
OP Offline
Babel fish
E
Joined: Mar 2014
Posts: 65
Got it working. Thanks


I do things with stuff that makes other things do stuff.
Joined: Mar 2014
Posts: 72
A
Babel fish
Offline
Babel fish
A
Joined: Mar 2014
Posts: 72
Does That Spam Filter Work For Caps and Stuff? Also Could I use it for my bot?

Joined: Mar 2014
Posts: 65
E
Exuviax Offline OP
Babel fish
OP Offline
Babel fish
E
Joined: Mar 2014
Posts: 65
Yes, It will remove all caps messages. Auto figure out what, and how much and remove it.

Last edited by Exuviax; 04/05/14 02:01 PM.

I do things with stuff that makes other things do stuff.
Joined: Mar 2014
Posts: 72
A
Babel fish
Offline
Babel fish
A
Joined: Mar 2014
Posts: 72
Cheers


Link Copied to Clipboard