mIRC Home    About    Download    Register    News    Help

Print Thread
#247286 26/07/14 07:48 PM
Joined: Jun 2014
Posts: 14
J
jbgrw Offline OP
Pikka bird
OP Offline
Pikka bird
J
Joined: Jun 2014
Posts: 14
On twitch there's a cap in how many messages you can send on irc before you get global banned for 8 hours.
The limit is 100 messages in 30 seconds.
I'm trying to figure out a way to make it so that if I'm about to reach this limit, say like it's only been 25 seconds and I've already sent 99 messages it would halt all scripts until it reaches 30 seconds.
This is for spam protections not commands btw.
Alternatively if you guys have a better way to circumvent this I'd appreciate it if you told me :p

Joined: Jun 2014
Posts: 14
J
jbgrw Offline OP
Pikka bird
OP Offline
Pikka bird
J
Joined: Jun 2014
Posts: 14
Nobody knows how to do this? There's got to be a way.

Joined: Mar 2014
Posts: 65
E
Babel fish
Offline
Babel fish
E
Joined: Mar 2014
Posts: 65
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.

Link Copied to Clipboard