Hey JuanAm,
Would you mind explaining it so i can work with it a bit?
and thank you very much for the help!
SBDOnslaught, I have given all the elements so you can work with the code.
You only need to modify the items marked in red.
#channel = channel where will the bot.
10 = the seconds expected the user running the command to rerun again .
The time must be modified in both places mentioned in the variable %lessnum and the timerAntiFlood.
$strip = ignores the format of colors, bold, underline, etc
[$ [$ Nick]] = customizes the timer for each user running the command.
dec = decrease the variable countdown to 1 second.
The timer message isn't for that command.. like a said, i have commands that have hour long timers on them and play along side with things, like points.
So when people keep spamming the command to earn points, and let's say there's 30 minutes left, at least they'll stop spamming the command for a sort period. or lets say someone recently join chat and tries to execute the command, they'll know it's already been used and they'll have to wait.
If you want the antiflood not be customized for each user running the command, being that when executed by a user can not do another user until after the scheduled time, you must remove the code, all identifiers [$ [$ Nick]].
30 minutes = 1800 seconds
Example:
On *:text:*:#channel:{
if ($strip($1) == !point) {
if ($timer(AntiFlood) == $null) { set %lessnums 1800 | .timerAntiFlood 1800 1 dec %lessnums }
else { msg # $nick the command has already been used, will be ready to use in $int($calc(%lessnums / 60)) minutes | return }
}
if (%lessnums != 0) {
msg $chan You can now use the !point.
halt
}
}
$int($calc(%lessnums / 60))= returns the integer part of the result of the arithmetic operation of dividing seconds between 60, to return me the minutes.
If you want to add more commands to antiflood, eg commands !play, !stats, you must change line 2.
if ($strip($1) == !point) || ($strip($1) == !play) || ($strip($1) == !stats) {
|| = or
I think it has all the elements to work with the code.
To learn how this code is assembled, I advise you to enter in your mIRC:
/help if then else
/help on text
/help timers
/help variables
/help identifiers