schedule
The calendar of data/schedule.toml: whether a seasonal event is on, the list of events, switching one on or off like the .event command, and when a timed task runs next. A script cannot add entries to the calendar: a custom action is a task with action = "lua".
Source: src/Moongate.Server.Ultima/Modules/ScheduleModule.cs
Functions
Section titled “Functions”active
Section titled “active”schedule.active() -> tableThe seasonal events that are on now, as an array of { id, name, mode }, mode being auto, on or off. An empty array when none is.
Returns table.
events
Section titled “events”schedule.events() -> tableEvery seasonal event of data/schedule.toml in file order, as an array of { id, name, from, to, mode, active }: from and to are the first and last day of the window as month-day, mode is auto, on or off, active is whether it is on now.
Returns table.
is_active
Section titled “is_active”schedule.is_active(id) -> booleanTrue when the seasonal event is on now, by its dates or because the staff forced it on; false when it is off and for an id that is not in data/schedule.toml.
| Parameter | Type | Default |
|---|---|---|
id | string |
Returns boolean.
schedule.next(id) -> integer?The Unix time in seconds of the next run of the timed task, the stop for a shutdown task; nil for an id that is not a task of data/schedule.toml, an event's included.
| Parameter | Type | Default |
|---|---|---|
id | string |
Returns integer?.
set_event
Section titled “set_event”schedule.set_event(id, mode) -> booleanSets the mode of the event to auto (follow the dates), on or off, as the .event command does, and runs its on_start or on_end hook if its state changes. True when done; false for an unknown id or mode. The module does not check who calls it: a script that is for the staff checks world.is_staff first. The mode is kept across restarts.
| Parameter | Type | Default |
|---|---|---|
id | string | |
mode | string |
Returns boolean.
Made with ❤️ by Tom
