- set -u20 %do.this 1
inc -u20 %do.this (Does the same thing in this case.)
Both set the variable "%do.this" to 1, for
20 seconds.
Triggers if "%do.this" doesn't exist (or its value is "$false", "$null" or "0")
on *:text:!do:#:{
if !%do.this {
; if %do.this is 0 or not set, this will trigger
do stuff
; and set the var
set -u20 %do.this 1
}
; else nothing happens, the var is set, doesn't need anything more
}
Another way
on *:text:!do{
if !%do.this {
do whatever
set -z %do.this [color:blue]20[/color]
}
else echo # !do must wait another $!(%do.this,1) secs
}
This time, the
-z means %do.this is set to
20 and reduced by 1 each second, until it is 0, when it is unset. You can know how long until it is unset this way.