mIRC Home    About    Download    Register    News    Help

Print Thread
#245885 12/05/14 05:12 AM
Joined: May 2014
Posts: 13
O
Pikka bird
OP Offline
Pikka bird
O
Joined: May 2014
Posts: 13
I am currently trying to have a script that has a flood command to stop a command from being spammed in a large Twitch chat, but also send a message in chat when someone is currently not able to use said command.

My current script (which works perfectly fine):
Quote:
on *:text:!roulette:#omegazeron:{
if ((%floodcommands) || ($($+(%,floodcommands.,$nick),3))) { return }
set -u30 %floodcommands On
set -u30 %floodcommands. $+ $nick On
if ($nick isop #omegazeron) { msg #omegazeron $nick was shot, but it bounced off the mod armor! }
else {
var %rl = $rand(1,3)
if (%rl == 1) msg #omegazeron Roulette clicks...and misses! You survived the roulette!
if (%rl == 2) msg #omegazeron Roulette clicks...and misses! You survived the roulette!
if (%rl == 3) describe #omegazeron raises the gun to the head of $nick ...BANG!
if (%rl == 3) msg #omegazeron /timeout $nick }
}

I would like to know how to make it so during the 30 second downtime, people trying to use the command would get a response such as "You must wait 30 seconds before using this command"

Joined: Dec 2013
Posts: 779
N
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
Code:
if (%floodcommands) || ($($+(%,floodcommands.,$nick),3))) { msg # You can't use this yet. | return }

I assume this is for twitch.tv, doesn't this then negate the use of the flood? (To prevent your application from sending 20 messages in 30 seconds)


Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net
Joined: May 2014
Posts: 13
O
Pikka bird
OP Offline
Pikka bird
O
Joined: May 2014
Posts: 13
Hmm, yeah that does seem like a problem. I guess I'll just stick to not having a message, unless you can flood the flood message somehow.

Joined: Dec 2013
Posts: 779
N
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
Just increase a value and make an if statement saying that if the value is high enough then message the channel.

Code:
on *:text:text:#: { 
  if (%c == 3) { msg # Please wait another $duration(%cooldown) $+ . | unset %c }
  elseif (%cooldown) inc %c
  else {
    set -z %cooldown 30
    set %c 1
    msg # blablabla 
  }
}


Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net

Link Copied to Clipboard