Scheduler
The Scheduler helps you automate recurring admin work on your server.
Instead of running changes manually every day or every week, you can create tasks once and let dzbot run them at the right time.
What you can automate
The Scheduler currently supports three categories:
Server tasks
- Server Restart: queue a restart at a planned time.
- Vehicle Wipe: prepare a vehicle wipe cycle.
- Change server settings: apply selected setting changes automatically.
Mods tasks
- Install/uninstall mods: switch mod configurations on or off.
- Change mod configuration: update selected config fields on a mod setup.
Actions tasks
- Enable/disable action: switch an action on or off.
- Change action configuration: update selected action config values.
- Custom Action: write a Lua script that runs directly on the schedule you define.
Custom Action
Custom Action tasks let you write arbitrary Lua code that is executed on a schedule — without being tied to a specific log event. The script has access to all action functions (discord, server, player, faction, math) but does not receive data or config globals since there is no event context and no configuration schema.
This is useful for recurring maintenance work, for example:
- Paying out daily or weekly rewards to all players in a group
- Sending scheduled announcements to a Discord channel
- Applying balance changes based on faction membership or activity
-- Example: weekly salary for all active faction members
local members = player.list({ in_faction = true, last_online_after = "-7d" });
for _, p in ipairs(members) do
player.change_balance(p.username, 500, "Weekly faction salary");
end
Use print() inside your script to write debug output to the task log.
Run modes and schedule options
Each task can be created in one of two run modes:
- Run once: executes one time at the exact date/time you choose.
- Recurring: keeps running on a repeating schedule.
Recurring schedules support:
- Hourly
- Daily (one or multiple times per day)
- Weekly (selected weekdays, optional interval in weeks)
- Monthly by day of month
- Monthly by weekday (for example, first Monday or last Friday)
You can also set an optional start date to delay when a recurring schedule becomes active.
How the scheduler behaves
- Tasks can be paused. Paused tasks are skipped until unpaused.
- Run now immediately queues a task and unpauses it.
- Recurring tasks are automatically moved to the next run after success.
- One-time tasks finish after one execution.
- You can duplicate a task to reuse the same setup quickly.
- Each task has a log history so you can review what happened.
Statuses you will see
- Pending: waiting for execution.
- Running: currently in progress.
- Succeeded: finished successfully.
- Failed: finished with an error.
- Canceled: stopped because no valid next schedule could be calculated.
- Paused: manually paused by an admin.
Timezone handling
The scheduler uses your server timezone from Settings.
If run times look off, check the server timezone first, then verify the task's scheduled time.
Discord notifications
Each task can send a message to Discord after it runs.
To use this:
- Make sure your Discord bot is installed on the server.
- Enable Discord notification in the task.
- Select a Discord text channel.
- Add a notification message.
Optional: enable Only notify on success if you want the message only to be send when the task succeeded.
Recommended workflow for admins
- Start with one clear, narrow task (for example weekly restart).
- Save it as paused and double-check schedule/timezone.
- Use Run now once to validate behavior.
- Review logs and adjust if needed.
- Unpause when you are ready for full automation.
Good operational practices
- Keep task descriptions clear so your team understands purpose and impact.
- Test risky tasks (mod changes, action config changes) once manually before making them recurring.
- Use duplicate when creating variants to avoid setup mistakes.
- Review failed tasks regularly so automation stays reliable.
Operational checks
If a task does not run, verify:
- the task is not paused
- the schedule/time is valid
- the server timezone is configured correctly in the server settings
If Discord notifications are missing, verify:
- bot installation and Discord connection on the server
- a channel and message are set in the task
- "Only notify on success" behavior (failed runs will not notify)