mIRC Home    About    Download    Register    News    Help

Print Thread
#254254 30/07/15 06:39 PM
Joined: Jul 2015
Posts: 13
K
Karotte Offline OP
Pikka bird
OP Offline
Pikka bird
K
Joined: Jul 2015
Posts: 13
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?

Last edited by Karotte; 30/07/15 06:41 PM.
Karotte #254300 02/08/15 09:04 AM
Joined: Jul 2015
Posts: 13
K
Karotte Offline OP
Pikka bird
OP Offline
Pikka bird
K
Joined: Jul 2015
Posts: 13
push

Karotte #254302 02/08/15 10:11 AM
Joined: Jan 2015
Posts: 168
P
Vogon poet
Offline
Vogon poet
P
Joined: Jan 2015
Posts: 168
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.
}


Joined: Jul 2015
Posts: 13
K
Karotte Offline OP
Pikka bird
OP Offline
Pikka bird
K
Joined: Jul 2015
Posts: 13
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

Last edited by Karotte; 03/08/15 08:24 AM.
Karotte #254322 03/08/15 11:28 AM
Joined: Jan 2015
Posts: 168
P
Vogon poet
Offline
Vogon poet
P
Joined: Jan 2015
Posts: 168
Yeah I did. When are you available?

Joined: Jan 2015
Posts: 168
P
Vogon poet
Offline
Vogon poet
P
Joined: Jan 2015
Posts: 168
Did you change the u5 and u1 in the script?

Last edited by powerade661; 03/08/15 11:39 AM.

Link Copied to Clipboard