Schedulers

Explanation of scheduler functionality & format.

This wiki page contains information about schedulers.

What is a scheduler?

Schedulers are used to reset or back up a world at a specific time. You can add as many schedulers as you wish- they will communicate with each other to not initialize multiple resets or rollbacks at the same time.

The schedulers will initialize each time the server boots up. Any scheduler with an interval will continue after a reboot even if the date is in the past.

In 2.0.0, schedulers have become a lot easier to use with a lot less restrictions and more flexibility. Any schedulers from previous versions can still be used with this system!

Scheduler elements

Each timer can have as little as one and up to three unique elements. These elements include a date, time, and interval.

  • Intervals Intervals specify the amount of time between resets. These include prefixes with the amount and suffixes with the initial for the interval type. For example: ‘2d’ means ‘2 days’. These can be stacked to include multiple intervals: ‘2d12h30m45s’ would be every 2 days, 12 hours, 30 minutes and 45 seconds. If no interval is included, the timer will only run once.

    Acceptable interval suffixes include:

    • s - seconds.
    • m - minutes.
    • h - hours.
    • d - days.
    • w - weeks.
    • M - months.
  • Dates A date specifies when a world reset should first occur. If the date is in the past and there is an interval, it will continue at that interval without stopping. A date must include at least month and day, but can also include year: '09-24' or '2022-09-24'. The date must be shown using dashes - and not slashes /. If no date is specified, the current date will be used.

    WARNING: It is highly recommended to specify the date. In the case you dont include this information and decide to restart your server, it will parse the current date instead of the date that was parsed before your server shut off.

    Acceptable dates (MM = month number, dd = day, yyyy = year):

    • ‘MM-dd’ - month & day
    • ‘yyyy-MM-dd’ - year, month, & day
  • Times Similar to dates, a time specifies when a world reset will first occur. If the time is in the past and there is an interval, it will continue at that interval without stopping. A time must include a colon : separating the hour and minute. An option AM or PM suffix can be included (with no space between): '4:00AM' or '8:00PM'. If no suffix is included, resort to using military time standards. If no time is included, it will automatically parse 00:00 or 12:00AM.

    Acceptable times (HH = hour, mm = minute):

    • ‘HH:mm’ - HH:mm
    • ‘18:30’ - 6:30 PM
    • ‘06:30’ - 6:30 AM
    • ‘2:00PM’ - 2:00 PM
    • ‘2:00AM’ - 2:00 AM

Asterisks * can also be used in the data/time to specify the time when the timer is initialized. Please do not use these!

Examples

Sometimes having an example is a good way to get a grasp of how things work. Below are a few good and bad examples:

Good:

  • 15m - Every 15 minutes.
  • 1:00PM - Daily at 13:00.
  • 2022-08-15 - 15 August, 2022 at midnight, no repeat.
  • 08-15 3d1h - 15 August at midnight and repeats every 3 days, 1 hour after.
  • 08-12 13:00 - 12 August at 13:00, no repeat.
  • 2022-08-12 13:00 1d2h5m - 12 August, 2022 at 13:00 and repeats every 1 day, 2 hours, 5 minutes.

Bad:

  • 2:00PM 2h30m - Every 2 hours, 30 minutes starting at 2PM.
  • 13:00 3d - every 3 days at 13:00.
  • ****-**-** 00:00 - stars can be used to represent current time/date.

How can I tell if my scheduler is good?

Imagine you restarted your server randomly. Would the scheduler shift and change the reset time? If yes, don’t use it. More details on this soon. When in doubt, ask a XWR developer in our Discord server.


Placeholders