Skip to content
DerelictDrone edited this page May 28, 2025 · 5 revisions

Jump to table of contents

Timer

interval(Number Rv1)

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)

timer(String Rv1, Number Rv2)

DEPRECATED. Use 'timer(sf)' (lambda timer) instead! Sets a one-time timer with entered name and delay in milliseconds (20 ops)

stoptimer(String Rv1)

Stops a timer, can stop interval with stoptimer("interval") (5 ops)

Number = clk()

DEPRECATED. Use 'timer(sf)' (lambda timer) instead! Returns 1 if the current execution was caused by the interval (1 ops)

Number = clk(String Rv1)

DEPRECATED. Use 'timer(sf)' (lambda timer) instead! Returns 1 if the current execution was caused by the inserted name (1 ops)

String = clkName()

DEPRECATED. Use 'timer(sf)' (lambda timer) instead! Returns the name of the timer that caused current execution (1 ops)

Array = getTimers()

Returns an array of all timers used in the E2 (1 ops)

stopAllTimers()

Stops all timers (1 ops)

timer(String Name, Number Delay, Number Repetitions, Function Callback)

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)

String = timer(Number Delay, Number 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)

String = timer(Number 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)

timer(String Name, Number Delay, Function Callback)

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)

timerSetDelay(String Name, Number Delay)

Sets the delay of the timer with the name S to N seconds (5 ops)

Number = timerSetReps(String Name, Number Repetitions)

Sets the number of repetitions of the timer with the name S to N (5 ops)

timerAdjust(String Name, Number Delay, Number Repetitions)

Sets the delay and repetitions of the timer with the name S to N seconds and N repetitions (5 ops)

Number = timerGetDelay(String Name)

Returns the delay of the timer with the name S (1 ops)

Number = timerGetReps(String Name)

Returns the number of repetitions of the timer with the name S (1 ops)

Function = timerGetCallback(String Name)

Returns the callback function of the timer with the name S (1 ops)

timerRestart(String Name)

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)

Number = timerExists(String Name)

Returns 1 if a callback timer with the name S exists. 0 otherwise (1 ops)

timerPause(String Name)

Pauses the callback timer with the name S (1 ops)

timerResume(String Name)

Resumes the callback timer with the name S (1 ops)

Number = timerToggle(String Name)

Toggles the callback timer with the name S. Returns 1 if timer is now resumed, 0 if paused (1 ops)

Number = timerRepsLeft(String Name)

Returns the number of repetitions left for the callback timer with the name S. (5 ops)

Number = timerTimeLeft(String Name)

Returns the time left for the callback timer with the name S until the next execution (5 ops)

Number = curtime()

Returns the current game time since server-start in seconds (1 ops)

Number = realtime()

Returns the current real time since server-start in seconds (1 ops)

Number = systime()

Returns a highly accurate time (also in seconds) since the server was started. Ideal for benchmarking (1 ops)

Table = date()

Returns the server's current time and date (10 ops)

Table = date(Number Time)

Returns the specified unix time (10 ops)

Table = dateUTC()

Returns the server's current time and date in UTC (10 ops)

Table = dateUTC(Number Time)

Returns the specified unix time in UTC (10 ops)

Number = time(String 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)

Number = time()

Returns the time in seconds (2 ops)

Number = time(Table 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)

Expression 2 ⚙️

Getting Started 🕊

Guides (In learning order) 🎓

Tools 🛠️

Click To Expand

Advanced

Beacon 💡

Control 🎛️

Data 💿

Detection 👀

Display 💻

Render 🖌

I/O 🔌

Physics 🚀

Utilities 🛠️

RFID 💳

Wireless 🛜

Gates 🚥

Click To Expand

TBD

Extras 🔭

Clone this wiki locally