Difference between revisions of "$timer"

From Scriptwiki
Jump to: navigation, search
 
(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).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 00:27, 26 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 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.