mIRC Home    About    Download    Register    News    Help

Print Thread
[Twitch] Command, JOIN & Message Limit #257650 02/05/16 10:47 AM
Joined: Mar 2016
Posts: 50
T
TUSK3N Offline OP
Babel fish
OP Offline
Babel fish
T
Joined: Mar 2016
Posts: 50
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

Re: [Twitch] Command, JOIN & Message Limit [Re: TUSK3N] #257651 02/05/16 12:28 PM
Joined: Jun 2015
Posts: 84
F
Fonic_Artes Offline
Babel fish
Offline
Babel fish
F
Joined: Jun 2015
Posts: 84
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.

Re: [Twitch] Command, JOIN & Message Limit [Re: Fonic_Artes] #257655 02/05/16 05:26 PM
Joined: Mar 2016
Posts: 50
T
TUSK3N Offline OP
Babel fish
OP Offline
Babel fish
T
Joined: Mar 2016
Posts: 50
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
}

Re: [Twitch] Command, JOIN & Message Limit [Re: TUSK3N] #257666 03/05/16 05:13 PM
Joined: Sep 2005
Posts: 2,881
H
hixxy Offline
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
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.

Re: [Twitch] Command, JOIN & Message Limit [Re: hixxy] #257671 03/05/16 08:53 PM
Joined: Mar 2016
Posts: 50
T
TUSK3N Offline OP
Babel fish
OP Offline
Babel fish
T
Joined: Mar 2016
Posts: 50
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.

Re: [Twitch] Command, JOIN & Message Limit [Re: TUSK3N] #257675 04/05/16 04:47 PM
Joined: Sep 2005
Posts: 2,881
H
hixxy Offline
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
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.

Re: [Twitch] Command, JOIN & Message Limit [Re: Fonic_Artes] #257677 05/05/16 08:00 AM
Joined: Sep 2014
Posts: 259
S
Sakana Offline
Fjord artisan
Offline
Fjord artisan
S
Joined: Sep 2014
Posts: 259
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
  }
}








Last edited by Sakana; 05/05/16 08:02 AM.
Re: [Twitch] Command, JOIN & Message Limit [Re: Sakana] #257689 06/05/16 08:57 PM
Joined: Mar 2016
Posts: 50
T
TUSK3N Offline OP
Babel fish
OP Offline
Babel fish
T
Joined: Mar 2016
Posts: 50
shocked

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



THANK YOU.

Last edited by TUSK3N; 06/05/16 09:11 PM.
Re: [Twitch] Command, JOIN & Message Limit [Re: Sakana] #259354 10/11/16 10:44 AM
Joined: Mar 2016
Posts: 50
T
TUSK3N Offline OP
Babel fish
OP Offline
Babel fish
T
Joined: Mar 2016
Posts: 50
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.