mIRC Homepage
Posted By: Karotte twitch bot help - 30/07/15 06:39 PM
hey guys http://pastebin.com/qhb2A7J0

this code above makes my bot writing "command was not found etc..." when someone writes a command that doesnt exist..

how can i include a flootprotection that my bot doesnt spam this sentence when somebody is spamming commands that don't exist?

for example:

user: !res
bot: Command doesnt exist, try !commands to see a list.
user: !graphics
bot: Command doesnt exist, try !commands to see a list.

and so on... how can i stop the bot doing this for some seconds?
Posted By: Karotte Re: twitch bot help - 02/08/15 09:04 AM
push
Posted By: powerade661 Re: twitch bot help - 02/08/15 10:11 AM
This should give you what you are needing. Below the ontext you will notice a script that detects flooding. It does this by setting a variable for the user that is flooding. "set u1 %floodcommand on" prevents the channel from using it for a second, "set u5 %floodcommand. $+ $nick" prevents the user from running that command for 5 seconds. This can be changed to your liking, but just showing you an example. smile

Code:
on *:text:!*:#: {
 if ((%floodcommand) || ($($+(%,floodcommand.,$nick),2))) { return }
  set -u1 %floodcommand On
  set -u5 %floodcommand. $+ $nick
  var %command = $1
  var %i = 1
  while (%i <= %commandID) {
    if ($readini(%commandFile, %i, name) == %command) && ($readini(%commandFile, %i, channel) == $chan) {
      var %msg = $readini(%commandFile, %i, message)
      // If the message has an @ symbol, $checkMsgAt will convert the @ back into a $
      %msg = $checkMsgAt(%msg)
      // Now we have to write the message to a .ini file then read from it, otherwise the bot will output as "$nick" instead of
      // the person's actual username.
      writeini -n %tempComFile command message %msg
      var %newMsg = $readini(%tempComFile, command, message)
      msg $chan %newMsg
      return
    }
    inc %i
  }
  msg $chan Command ( %command ) was not found $nick . Write !commands to see a list.
}

Posted By: Karotte Re: twitch bot help - 03/08/15 08:07 AM
i guess you used my script and did edit it with the flooding one?

thanks mate i'll test it later smile

EDIT: i don't think its working smirk i'll leave my bot open, maybe you can test it when you read this message

twitch tv/kar0ttenp0wer
Posted By: powerade661 Re: twitch bot help - 03/08/15 11:28 AM
Yeah I did. When are you available?
Posted By: powerade661 Re: twitch bot help - 03/08/15 11:39 AM
Did you change the u5 and u1 in the script?
© mIRC Discussion Forums