Difference between revisions of "$timer"
From Scriptwiki
(moo!) |
|||
Line 25: | Line 25: | ||
[[alias]] timertest { | [[alias]] timertest { | ||
[[timer]]foo 1 10 { [[echo]] -a moo } | [[timer]]foo 1 10 { [[echo]] -a moo } | ||
− | + | echo -a $timer(foo).com | |
echo -a $timer(foo).delay | echo -a $timer(foo).delay | ||
− | if ($timer(foo).mmt) { echo -a timer foo is a multimedia timer } | + | [[if]] ($timer(foo).mmt) { echo -a timer foo is a multimedia timer } |
else { echo -a timer foo is no multimedia timer } | else { echo -a timer foo is no multimedia timer } | ||
} | } |
Revision as of 23:27, 25 November 2005
Returns information about a timer.
$timer(N/name)
Returns the timer id of the Nth timer in the timers list or the one you have specified by its name.
$timer has the following properties:
property | explanation |
com | returns the command |
time | returns the time when the timer will be triggered (if you have specified one) |
reps | returns the repetitions the timer will have |
delay | returns the delay between two triggers |
type | returns online/offline status |
secs | returns number of seconds left before timer is triggered |
mmt | returns $true if timer is a multimedia timer |
anysc | returns $true if the /timer -i switch was specified |
wid | returns window id of the status window of the connection the timer is related to |
cid | returns connection id of the timer |
hwnd | returns the handle window of the status window of the connection the timer is related to |
Example
alias timertest { timerfoo 1 10 { echo -a moo } echo -a $timer(foo).com echo -a $timer(foo).delay if ($timer(foo).mmt) { echo -a timer foo is a multimedia timer } else { echo -a timer foo is no multimedia timer } }
This example will create an alias called timertest. The alias will at first make a new timer called foo and then echo some information about it. After ten seconds, you will get a "moo" in your active window, as the timer has been triggered then.