e2 docs timer - wiremod/wire GitHub Wiki
Timer
Rv1)
interval(DEPRECATED. Use 'timer(sf)' (lambda timer) instead! Sets a one-time timer with name "interval" and delay in milliseconds (minimum delay for timers is 10ms) (20 ops)
Rv1,
Rv2)
timer(DEPRECATED. Use 'timer(sf)' (lambda timer) instead! Sets a one-time timer with entered name and delay in milliseconds (20 ops)
Rv1)
stoptimer(Stops a timer, can stop interval with stoptimer("interval") (5 ops)
= clk()
DEPRECATED. Use 'timer(sf)' (lambda timer) instead! Returns 1 if the current execution was caused by the interval (1 ops)
= clk(
Rv1)
DEPRECATED. Use 'timer(sf)' (lambda timer) instead! Returns 1 if the current execution was caused by the inserted name (1 ops)
= clkName()
DEPRECATED. Use 'timer(sf)' (lambda timer) instead! Returns the name of the timer that caused current execution (1 ops)
= getTimers()
Returns an array of all timers used in the E2 (1 ops)
stopAllTimers()
Stops all timers (1 ops)
Name,
Delay,
Repetitions, Function Callback)
timer(Creates a callback timer with the name S, delay of N seconds, N repeats and callback function F. NOTE: If the timer finished running, it will not exist (and you won't be able to restart/configure it) (10 ops)
= timer(
Delay,
Repetitions, Function Callback)
Creates a simple callback timer with delay of N seconds, N repeats and callback function F. Returns autogenerated name which you can use. NOTE: If the timer finished running, it will not exist (and you won't be able to restart/configure it) (10 ops)
= timer(
Delay, Function Callback)
Creates a simple callback timer delay of N seconds, 1 repeat(one-time timer) and callback function F. Returns autogenerated name which you can use. NOTE: If the timer finished running, it will not exist (and you won't be able to restart/configure it) (10 ops)
Name,
Delay, Function Callback)
timer(Creates a callback timer with the name S, delay of N seconds, 1 repeat(one-time timer) and callback function F. NOTE: If the timer finished running, it will not exist (and you won't be able to restart/configure it) (10 ops)
Name,
Delay)
timerSetDelay(Sets the delay of the timer with the name S to N seconds (5 ops)
= timerSetReps(
Name,
Repetitions)
Sets the number of repetitions of the timer with the name S to N (5 ops)
Name,
Delay,
Repetitions)
timerAdjust(Sets the delay and repetitions of the timer with the name S to N seconds and N repetitions (5 ops)
= timerGetDelay(
Name)
Returns the delay of the timer with the name S (1 ops)
= timerGetReps(
Name)
Returns the number of repetitions of the timer with the name S (1 ops)
Name)
Function = timerGetCallback(Returns the callback function of the timer with the name S (1 ops)
Name)
timerRestart(Restarts the callback timer with the name S. Uses the same amount of repetitions/delay/callback function as when was created. NOTE: If the timer finished running, it will not exist (and you won't be able to restart/configure it) (5 ops)
= timerExists(
Name)
Returns 1 if a callback timer with the name S exists. 0 otherwise (1 ops)
Name)
timerPause(Pauses the callback timer with the name S (1 ops)
Name)
timerResume(Resumes the callback timer with the name S (1 ops)
= timerToggle(
Name)
Toggles the callback timer with the name S. Returns 1 if timer is now resumed, 0 if paused (1 ops)
= timerRepsLeft(
Name)
Returns the number of repetitions left for the callback timer with the name S. (5 ops)
= timerTimeLeft(
Name)
Returns the time left for the callback timer with the name S until the next execution (5 ops)
= curtime()
Returns the current game time since server-start in seconds (1 ops)
= realtime()
Returns the current real time since server-start in seconds (1 ops)
= systime()
Returns a highly accurate time (also in seconds) since the server was started. Ideal for benchmarking (1 ops)
= date()
Returns the server's current time and date (10 ops)
= date(
Time)
Returns the specified unix time (10 ops)
= dateUTC()
Returns the server's current time and date in UTC (10 ops)
= dateUTC(
Time)
Returns the specified unix time in UTC (10 ops)
= time(
Component)
Returns numerical time/date info from the server. Possible arguments: "year", "month", "day", "hour", "min", "sec", "wday" (weekday, Sunday is 1), "yday" (day of the year), and "isdst" (daylight saving flag 0/1) (10 ops)
= time()
Returns the time in seconds (2 ops)
= time(
Data)
Attempts to construct the time from the data in the given table (same as lua's os.time). The table structure must be the same as in the date() functions. If any values are missing or of the wrong type, that value is ignored (it will be nil) (2 ops)