mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Apr 2014
Posts: 31
G
Ameglian cow
OP Offline
Ameglian cow
G
Joined: Apr 2014
Posts: 31
Hi, just managed to get my bot globally banned for 8 hours. Is there a simple script that you can add to scripts to make them not pass the threshold? Streamer told me to add a huge text emoticon to the auto timeout due to it being spammed, and it ended with the bot getting globally banned due to exceeding the threshold by typing /timeout.

P.S: I knew about the threshold, but assumed that was text only. Not / commands.

Twitch Admin:
It's a global limit and the 100 threshold only applies if you are only sending messages in channels you are a mod in.
For example: You send 50 messages to a channel where you are modded and then send 1 message to a channel where you are not modded within 30 seconds. Since 50 + 1 = 51 and 51 > 20, you will have exceeded the limit for non-modded channels and be locked out globally for 8 hours.

Last edited by Gargantuan; 17/02/15 10:31 PM.
Joined: Sep 2014
Posts: 259
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Sep 2014
Posts: 259
I wrote this some time ago. The pause alias I found on Hawkee. You can use halt instead of pause if you want, but it seems better to queue up commands instead of just halting everything. You'll need to add a call to the linecount alias anywhere in your scripts where you have msg #.

Let me know if it actually works, because I haven't tried it in practice



Code:

alias LineCount {
  if (%LineLimit) pause s 5
  if (!%LineCount) set %LineCount 0
  if (!%LineTimer) set %LineTimer $uptime
  inc %LineCount
  echo -a %LineCount lines in $calc($uptime - %LineTimer) seconds
  if ($calc($uptime - %LineTimer) < 30 ) && (%LineCount >= 49) {
    echo -a Limit reached
    unset %Line*
    set -u5 %LineLimit On
  }
  elseif ($calc($uptime - %LineTimer) > 30 ) && (%LineCount < 49) {
    echo -a Limit not reached, resetting counter
    set %LineCount 1
    set %LineTimer $uptime
  }
  elseif ($calc($uptime - %LineTimer) > 30 ) && (%LineCount >= 49) {
    echo -a Limit not reached, resetting counter
    set %LineCount 1
    set %LineTimer $uptime
  }
}


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)
  }
}




Last edited by Sakana; 18/02/15 10:08 AM.
Joined: Apr 2014
Posts: 31
G
Ameglian cow
OP Offline
Ameglian cow
G
Joined: Apr 2014
Posts: 31
Decided not to use it, quick question though. I need to search for a specific username and then check if that user is an OP.

Checks if the person who triggered the event is an OP.
if $nick isop # {

Need it to check if X person is a OP.
if X isop # {

Joined: Sep 2014
Posts: 259
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Sep 2014
Posts: 259
Found something else? The standard anti-flood scripts don't seem sufficient if you have a bot in many channels, but maybe I'm overlooking something simple..

What is X? It could be anything. $2, %var, $readini, etc.

It's a good idea to use ( ) around your IF statements. You can sometimes get errors for not using them, and it's a bit harder to read

Joined: Apr 2014
Posts: 31
G
Ameglian cow
OP Offline
Ameglian cow
G
Joined: Apr 2014
Posts: 31
X is the name of the user. But I can't find a function that does this =<

if Sakana isop #sakana {

Last edited by Gargantuan; 21/02/15 03:33 AM.
Joined: Sep 2014
Posts: 259
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Sep 2014
Posts: 259
What...? laugh

if (Sakana isop #sakana) {
<-------- that's completely valid, but also static.

What exactly are you trying to do?:

Joined: Dec 2013
Posts: 779
N
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
Inside the IF parentheses you state a value, an operator and another value.

If ($nick isop #) will translate from mIRC code
$nick == Nillen - #Nillen

So it will literally look like this:
If (Nillen isop #Nillen)

You can put whatever value you want there instead of $nick, your X.

var %user $2
var %channel #Nillen
if (%user isop %channel)

Useful reads:
/help aliases
/help variables
/help $nick (the first one)
/help if then else


Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net
Joined: Apr 2014
Posts: 31
G
Ameglian cow
OP Offline
Ameglian cow
G
Joined: Apr 2014
Posts: 31
Ahh okay, thought there was some kind of $nick(nillens) that I never managed to find but guess there isn't. So variables it is. Thanks for the response =D


Link Copied to Clipboard