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.