$timer

From Scriptwiki
Revision as of 23:27, 25 November 2005 by Doomie (talk | contribs) (moo!)

Jump to: navigation, search

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:

propertyexplanation
comreturns the command
timereturns the time when the timer will be triggered (if you have specified one)
repsreturns the repetitions the timer will have
delayreturns the delay between two triggers
typereturns online/offline status
secsreturns number of seconds left before timer is triggered
mmtreturns $true if timer is a multimedia timer
anyscreturns $true if the /timer -i switch was specified
widreturns window id of the status window of the connection the timer is related to
cidreturns connection id of the timer
hwndreturns 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.