Originally Posted By: Bramzee
I went back and looked into this some more, because it peaked my interest a bit, and it helped me to learn a few things as well (as someone who's new to this) This IS tested AND working 100% however, after the raid is over, you will need to clear the raid.txt file manually (really you could add in a clear command as well, but I didn't mind just clearing it manually. If you want it, it's really not that hard to add in.

With this, only YOU will be able to add a raid.
Everyone in chat can use the !raid command.
And flood control is on (obviously) to protect your bot from getting banned for 20 messages in 30 seconds smile Hope this helped, startgame thanks for posting in here and reminding me I did this, as well as for helping out people that need it smile


Code:
on *:TEXT:!raid*:#: {
  if ((%floodraid) || ($($+(%,floodraid.,$2),2))) { return }
  set -u10 %floodraid On
  set -u30 %floodraid. $+ $nick On
  if ($2 == $null) msg # $read(raid.txt)
  if ($nick == yourchannelname) {
    write raid.txt Stream is over, be sure to go check out twitch.tv/ $+ $$2 add more message here
    msg $chan Stream is over, be sure to go check out twitch.tv/ $+ $$2 add more message here
  }
}


I am honestly not a fan of the method you use. Mainly because streamers enjoy choosing the person they wish to raid. Chances are too high that it would hit the same channel multiple times as I doubt that most broadcasters would fill it with random channels.

Also for your flood protection I'd recommend just putting it inside of an alias and calling from remote. This way you save the time of typing too much or copy/paste'ing all of that.

Here is the flood protection I made for my newest bot:
Code:
alias -l floodcheck {
if ((%flood.) || ($($+(%,flood.,$nick),2))) { echo -a Stopped | halt }
  else {
    set -z %flood. $+ $chan $1 
    set -z %flood. $+ $nick $2 
  } 
}


You can call that in an event by using:
Code:
floodwatch <channel time> <user time>

channel time = time before others can execute
user time = time before previous user can execute

Quick example:
Code:
on *:text:Flood:#:{
  floodcheck 5 10
  var %n = 1, %o = 5
  while (%n <= %o) {
    echo -a Current: %n
    inc %n
  }
}


Will halt the script from continuing with the command as usual.

Feel free to take and use as you please