This is how I do it

Code:

ON @*:TEXT:*:#: {
  if ($($+(%,spamcaps.,$chan),2)) { 
    if ($($+(%,permit.,$nick),2)) { RETURN }
    ON @*:TEXT:*:#: {
      IF (($len($1-) < 55) || ($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.9) {
        if (%spamcheck) { msg # /timeout $nick 30 }
        msg # $nick --> Please don't type in all caps
        .timer[caps1] 1 1 msg # /timeout $nick 30
        set -u20 %spamcheck ON
      }
    }
  }
}



So if someone has been timed out for caps within 20 seconds of someone else being timed out, it won't message the channel, it will just time the out. But you have to be careful, on twitch, timeout messages also register as messages being sent. So you will notice I have ".timer[caps1] 1 1 " I have this across my scripts so the bot will wait 1 seconds after it sees spam before it removed it. Since my channel isn't that busy, only about 500 people, I don't need it to limit the amount of times it checks for spam and removes it, I need to block people from using commands, which can be done with a simple Flood variable.

Code:
 

on *:TEXT:!demon:#: {
  if ($chan == #bacon_donut) { RETURN }
  if ((%floodchat) || ($($+(%,floodchat.,$nick),2))) { return }
  set -u1 %floodchat On
  set -u3 %floodchat. $+ $nick On
  msg # &#9516;&#9472;&#9516;&#65279; &#65077; /(.&#9633;. \&#65289;
}



Notice the, "floodchat" variable that gets set on the $nick and the chat as a hole.

Hope that helps,


PS. This isn't 4chan, replying to your post doesn't "bump" it, just makes people not want to respond because on the main site it will say it already has a reply.


I do things with stuff that makes other things do stuff.