Difference between revisions of "$timer"
From Scriptwiki
(4 intermediate revisions by one other user not shown) | |||
Line 15: | Line 15: | ||
<tr><td>mmt</td><td>returns $true if timer is a multimedia timer</td></tr> | <tr><td>mmt</td><td>returns $true if timer is a multimedia timer</td></tr> | ||
<tr><td>anysc</td><td>returns $true if the /timer -i switch was specified</td></tr> | <tr><td>anysc</td><td>returns $true if the /timer -i switch was specified</td></tr> | ||
− | <tr><td valign="top">wid</td><td>returns window id of the status window of the connection the timer is related to</td></tr> | + | <tr><td valign="top">wid</td><td>returns 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</td></tr> |
<tr><td>cid</td><td>returns connection id of the timer</td></tr> | <tr><td>cid</td><td>returns connection id of the timer</td></tr> | ||
− | <tr><td valign="top">hwnd</td><td>returns the handle window of the status window of the connection the timer is related to</td></tr> | + | <tr><td valign="top">hwnd</td><td>returns 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</td></tr> |
</table> | </table> | ||
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 } | ||
} | } | ||
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 Commands and Identifiers]] |
Latest revision as of 00:14, 28 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 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 |
cid | returns connection id of the timer |
hwnd | returns 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.