You can set a variable every time you use /ycommand
which is automatically unset after 60 seconds. Then you can use an if statement around /ycommand
to check whether the variable is set and if it is, do nothing because the command was used within the last 60 seconds.
The hard part is using a different variable for each user. When setting a variable, use %xcommandused. $+ $nick
and the nick of the user will be a part of the variable name. For example, my nick is Kylar, so when I type .xcommand it will set %xcommandused.Kylar
to $true
.
It's not as simple when you want to read the value of the variable. You can use evaluation brackets like %xcommandused. [ $+ [ $nick ] ]
or $eval
like $eval(% $+ xcommandused. $+ $nick, 2)
.
If you have more questions, there's a good scripting community on the SwiftIRC network. Just connect to irc.swiftirc.net, join #mSL, explain your problem, and hope someone answers.
on *:TEXT:.xcommand:#: {
if (!%xcommandused. [ $+ [ $nick ] ]) {
set -u60 %xcommandused. $+ $nick $true
ycommand
}
}