Hey Mat,
I suggest you wrap you code in a code block;
like this.
Otherwise great code, but I’d like to offer an alternative.
Getting lots of timers can slow down mIRC if you ever think about expanding, making them per command, or thought this would be a great way to do something per user basis.
ON *:TEXT:!commands:#matt_thomas: {
if (%flood.matt_thomas == $null || %flood.matt_thomas + 5000 < $ticks) {
set %flood.matt_thomas $ticks
msg $chan !uptime; !stream
}
}
This wil not use timers, but instead just check the local time and compare it (in miliseconds).
the 5000 says 5 second delay.
If you want a per command basis I’d suggest creating an easily expandable script like this;
ON *:TEXT:*:#matt_thomas: {
// for easy naming - defines the the "response" for command $1
var %command= %command. [ $+ [ $1 ] ]
// stores the last use of command $1
var %floodcommand = %flood.matt_thomas. [ $+ [ $1 ] ]
// checks if %command exists, that is, the command var has a 'response' in it.
// then checks if the %floodcommand (of that specific command) is non existant or far enough back
if (%command && (%floodcommand == $null || %floodcommand + 5000 < $ticks)) {
//sets the flood command time to $ticks
set %flood.matt_thomas. [ $+ [ $1 ] ] $ticks
// sends the response
msg $chan %command
}
}
With that script, every command has a 5 Seconds own delay. You can now add commands by going into your variables and creating a command like this:
%command.!NAME ANSWER
for example:
%command.!commands !youtube, !Stream,!uptime
You don’t have to add anything to the function for more commands.
IE: hardcoding your ‘commands’ into the script isn’t nessecary. with this you can even let mods add commands.