Clock
The clock object represents the time of the world. There is only one clock object, it can be accessed using world.clock
.
Properties
freeze
≥ 0.2true
if clock is frozen, the clock does not tick.hour
≥ 0.2- Hour,
0
...23
. minute
≥ 0.2- Minute,
0
...59
. multiplier
≥ 0.2- Fast clock multiplier rate. That is, one minute in real time represents
multiplier
minutes of world time. running
≥ 0.2true
if clock is running,false
if the clock is frozen or the world is not running.time
≥ 0.2- Current time in ticks since midnight, each tick is one fast clock minute, e.g.
383
is6:23
(AM)
Events
on_freeze
≥ 0.2
Fired when the clock is frozen or stopped.
Handler:function (time, user_data)
time
- Current time in ticks since midnight.
user_data
- User data that was set or
nil
if no user data was set during connect.
on_resume
≥ 0.2
Fired when the clock resumes.
Handler:function (time, multiplier, user_data)
time
- Current time in ticks since midnight.
multiplier
- Fast clock multiplier rate.
user_data
- User data that was set or
nil
if no user data was set during connect.
on_tick
≥ 0.2
Fired when the clock ticks, once every fast clock minute.
Handler:function (time, user_data)
time
- Current time in ticks since midnight.
user_data
- User data that was set or
nil
if no user data was set during connect.