Skip to content

Schedules, timers and key-alls

Configured in schedule.yml.

Things that happen on a clock. Nothing here ships switched on: tips are off and every list is empty — what a server announces, and what its keys are, belong to it.

Times are read in the file's time-zone — "system" follows the host's clock; write yours ("Europe/Paris") so a host move does not shift everything.

Tips

A line of advice every few minutes:

schedule.yml
tips:
  # A line of advice every so often. Off by default: a message nobody asked for,
  # every few minutes, is something an operator has to go and turn off.
  # Players can switch tips off for themselves with /settings.
  enabled: false
  # At least 10.
  interval-seconds: 300
  # in-order, or random - which never shows the same tip twice running.
  order: in-order
  prefix: "{dark}[{warning}Tip{dark}] {muted}"
  messages:
    - "Type {secondary}/team help {muted}to see every team command."
    - "{secondary}/events {muted}lists what is running and what is coming."
    - "{secondary}/stats {muted}and {secondary}/leaderboard {muted}show how you are doing."

Set enabled: true to start them.

In random order, the same tip never shows twice running. Players can switch tips off for themselves with /settings.

Daily schedules

Announcements and console commands at fixed times, every day:

schedule.yml
# Announcements and commands at fixed times, every day. Each entry needs at least
# one time and a broadcast or a command; commands run from the console.
#
#   schedules:
#     evening-koth:
#       times: ["18:00", "21:00"]
#       broadcast: "&6A KOTH starts in 5 minutes!"
#       commands: []
#     nightly-restart-warning:
#       times: ["03:55"]
#       broadcast: "&cThe server restarts in 5 minutes."
schedules: {}

Each entry needs at least one time and a broadcast or a command. A time that passed while the server was off is not replayed.

Custom timers

Countdowns staff start by hand, shown on everyone's scoreboard (%timer_1% to %timer_3%, the one ending soonest first) and ending with a line in chat:

/timer start double-points 1h
/timer start event 30m &cEvent starts
/timer stop double-points
/timer                          # the timers running (aliases /timers, /customtimer)

Starting and stopping needs hcfcore.schedule.admin. A name described in schedule.yml gets its label, and can say and do something when it ends:

schedule.yml
# Countdowns started with /timer start <name> <duration> [label]. They show on
# the scoreboard (%timer_1% to %timer_3% in ui.yml) and end with a line in chat.
# A name listed here gets its label, and can say and do something when it ends.
# Any other name works too, with the label typed in the command.
#
#   timers:
#     double-points:
#       label: "&dDouble Points"
#       end-broadcast: "&dDouble points are over."
#       end-commands:
#         - "some-command %timer%"
#
# Timers live in memory: a restart ends them.
timers: {}

Any other name works too, with the label typed in the command. A running timer is not restarted by mistake. Timers live in memory: a restart ends them. The name keyall belongs to /keyall.

Key-all

/keyall runs the key-all commands once for every player online, from the console — now, or after a countdown everybody sees on their scoreboard:

/keyall          # now
/keyall 5m       # in five minutes
schedule.yml
key-all:
  # /keyall runs these commands once for every player online, from the console
  # (%player% is filled in). This plugin has no crates: point them at whatever
  # your crate plugin, economy or kit provides. Empty, /keyall refuses rather
  # than announcing a key-all that gives nothing.
  #
  #   commands:
  #     - "crates key give %player% vote 1"
  commands: []
  # Said once it has run; %count% is how many players received it.
  broadcast: "{primary}&lKEY-ALL! {muted}%count% players received a key."
  # The label of the countdown /keyall <duration> starts.
  label: "{primary}Key-All"

HCFCore has no crates: point the commands at your crate plugin, economy or kits. With no command configured, /keyall refuses rather than announcing a key-all that gives nothing. Needs hcfcore.schedule.admin.