mIRC Homepage

[Twitch] Command, JOIN & Message Limit

Posted By: TUSK3N

[Twitch] Command, JOIN & Message Limit - 02/05/16 10:47 AM

I have read about this but is there a script that prevents the global ban?


If you send more than 20 commands or messages to the server within a 30 second period, you will get locked out for 8 hours automatically. These are not lifted so please be careful when working with IRC!

JOINs are rate-limited to 50 JOINs per 15 seconds. Additional JOINs sent after this will cause an unsuccessful login.


I havent found a script that prevents global ban on twitch I mean yes you could have flood protection but I still want to feel safe knowing that my bot cant get global banned.

I have found this that sets the rate limiting but its in python I think? :p
https://github.com/gempir/relaybroker

Would be nice to have some help! smile
Posted By: Fonic_Artes

Re: [Twitch] Command, JOIN & Message Limit - 02/05/16 12:28 PM

Well, the global was reduced to 2 hours, but as long as the bot is a Moderator it'll get a 100/20-30 rate limit.

Aside from that, flood protection is the greatest asset to limit your rates.

You can also try this which Majeye made. Majeye Pastebin

It's a line counter, so that may help.
Posted By: TUSK3N

Re: [Twitch] Command, JOIN & Message Limit - 02/05/16 05:26 PM

ok so I guess this is how you do it?

Code:
on *:text:*!test*:#: {
  if (%flood) { return }
  set -u4 %flood On
  msg $chan test
  LineCount
}
Posted By: hixxy

Re: [Twitch] Command, JOIN & Message Limit - 03/05/16 05:13 PM

Code:
on *:text:*!test*:#: {
  if (!%LineLimit) || (%LineLimit == off) {
    msg $chan test
    LineCount
  }
}


I have no idea whether that script was written specifically with Twitch in mind, but having looked at the code I think the above is how you should be using it.
Posted By: TUSK3N

Re: [Twitch] Command, JOIN & Message Limit - 03/05/16 08:53 PM

is it possible to do it like this

if $me msg LineCount

I dont know how that will look in code but
It would be easier if it just did a LineCount when it
sees that I have sent a msg in the channel.
Posted By: hixxy

Re: [Twitch] Command, JOIN & Message Limit - 04/05/16 04:47 PM

Code:
alias _msg { 
  if ($me ison $1) && ((!%LineLimit) || (%LineLimit == off)) { 
    msg $1-
    LineCount
  }
}
on *:input:#:{
  if ($left($1,1) !isin / $+ $readini($mircini,text,commandchar) || ($ctrlenter) || ($inpaste) { _msg # $1- }
}


Use /_msg instead of /msg.
Posted By: Sakana

Re: [Twitch] Command, JOIN & Message Limit - 05/05/16 08:00 AM

Originally Posted By: Fonic_Artes

You can also try this which Majeye made. Majeye Pastebin

It's a line counter, so that may help.


Actually, I made it ;P

Anyway that's an outdated version. I've since modified it to work better. Instead of just ignoring commands when the spam threshold is reached, this code should make the bot sleep for 5 seconds and then continue to execute queued commands after that.

Usage: Just insert a line with "LineCount" anywhere in your code before a "msg #"

Code:
alias pause {
  var %e = !echo $color(info) -a * /pause:
  if ($version < 5.91) {
    %e this snippet requires atleast mIRC version 5.91
  }
  elseif ($isid) {
    %e this snippet can only be called as a command.
  }
  elseif (!$regex(pause,$1-,/^m?s \d+$/Si)) {
    %e incorrect/insufficient parameters. Syntax: /pause <s|ms> <N>
  }
  elseif ($1 == ms) && ($os isincs 9598ME) {
    %e cannot use milliseconds parameter on OS'es beneath Win2k
  }
  elseif ($2 !isnum 1-) {
    %e must specify a number within range 1-
  }
  else {
    var %wsh = $+(wsh,$ticks,$r(1111,9999)), %cmd
    if ($1 == s) %cmd = ping.exe -n $int($calc($2 + 1)) 127.0.0.1
    else %cmd = pathping.exe -n -w 1 -q 1 -h 1 -p $iif($2 > 40,$calc($2 - 40),$2) 127.0.0.1
    .comopen %wsh wscript.shell
    if ($comerr) %e unable to open Wscript.Shell
    else .comclose %wsh $com(%wsh,run,1,bstr*,% $+ comspec% /c %cmd >nul,uint,0,bool,true)
  }
}

alias LineCount {
  if (%LineLimit) pause s 5
  if (!%LineCount) set %LineCount 0
  if (!%LineTimer) set %LineTimer $uptime
  inc %LineCount
  var %limit = 30
  if ($calc($uptime - %LineTimer) < 30 ) && (%LineCount >= %limit) {
    window -a @LineCount
    echo @LineCount $time - $date - SPAM LIMIT REACHED 
    unset %Line*
    set -u5 %LineLimit On
  }
  elseif ($calc($uptime - %LineTimer) > 30 ) && (%LineCount < %limit) {    
    set %LineCount 1
    set %LineTimer $uptime
  }
  elseif ($calc($uptime - %LineTimer) > 30 ) && (%LineCount >= %limit) {    
    set %LineCount 1
    set %LineTimer $uptime
  }
}







Posted By: TUSK3N

Re: [Twitch] Command, JOIN & Message Limit - 06/05/16 08:57 PM

shocked

Thank you a queue was exactly what I was looking for!



THANK YOU.
Posted By: TUSK3N

Re: [Twitch] Command, JOIN & Message Limit - 10/11/16 10:44 AM

So I would like a little help everytime it reaches the limit it pauses as it should but then when it unpauses it just sends all the messages at the same time that was in queue can I make it so it sends the messages in the queue every 2 seconds instead of spamming at the same time?

Now it works as
!hi
hi
!hi
hi
BOT PAUSE
!hi
!hi
!hi
hi
hi
hi

I would like it to have a pause between the messages

!hi
hi
!hi
hi
BOT PAUSE
!hi
!hi
!hi
hi
2 seconds
hi
2 seconds
hi
2 seconds etc.
© 2020 mIRC Discussion Forums