Difference between revisions of "$timer"

From Scriptwiki
Jump to: navigation, search
Line 32: Line 32:
 
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.
 
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.
  
[[Category:TIMER]]
+
[[Category:Timer]]

Revision as of 14:42, 27 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:

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 window it was issued in, if this is done remotly, it's the 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 window it was issued in, if this is done remotly, it's the hwnd 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.