mIRC Home    About    Download    Register    News    Help

Print Thread
Having some trouble with *:TEXT:*: commands #245570 26/04/14 08:56 PM
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.
Re: Having some trouble with *:TEXT:*: commands [Re: Exuviax] #245571 26/04/14 10:13 PM
Joined: Jan 2004
Posts: 1,352
L
Loki12583 Online
Hoopy frood
Online
Hoopy frood
L
Joined: Jan 2004
Posts: 1,352
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 [ $+ [ # ] ]

Re: Having some trouble with *:TEXT:*: commands [Re: Loki12583] #245572 26/04/14 10:48 PM
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.
Re: Having some trouble with *:TEXT:*: commands [Re: Exuviax] #245573 26/04/14 10:59 PM
Joined: Jan 2004
Posts: 1,352
L
Loki12583 Online
Hoopy frood
Online
Hoopy frood
L
Joined: Jan 2004
Posts: 1,352
File > new

Re: Having some trouble with *:TEXT:*: commands [Re: Loki12583] #245574 26/04/14 11:06 PM
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.
Re: Having some trouble with *:TEXT:*: commands [Re: Exuviax] #245575 26/04/14 11:10 PM
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.
Re: Having some trouble with *:TEXT:*: commands [Re: Exuviax] #245586 28/04/14 05:50 PM
Joined: Mar 2014
Posts: 72
A
AllDayGrinding Offline
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?

Re: Having some trouble with *:TEXT:*: commands [Re: AllDayGrinding] #245712 04/05/14 02:00 PM
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.
Re: Having some trouble with *:TEXT:*: commands [Re: Exuviax] #245738 05/05/14 02:16 PM
Joined: Mar 2014
Posts: 72
A
AllDayGrinding Offline
Babel fish
Offline
Babel fish
A
Joined: Mar 2014
Posts: 72
Cheers