# Schedules & Timers

### Configuration File: `schedules.yml`

The `schedules.yml` file defines all scheduled and repeating tasks.

#### Example Structure

```yaml
schedules:
  daily_reward:
    enabled: true
    type: fixed
    time: "12:00" # 12:00 PM
    days: [MONDAY, WEDNESDAY, FRIDAY] # Only runs on these days
    actions:
      - "[console] say Daily reward executed!"

  xp:
    enabled: false
    type: repeatable
    interval: 300 # Every 300 seconds (5 minutes)
    actions:
      commands:
      - "[console] xp give %player% 5"
      - "[message] &aYou have received 5 Level XP!"
    variants:
      double_xp:
        permission: ultimaterewards.doublexp
        actions:
        - "[console] xp give %player% 10"
        - "[message] &aYou have received 10 Level XP!"

  hourly_announcement:
    enabled: true
    type: repeatable
    interval: 3600 # Every 3600 seconds (1 hour)
    actions:
      - "[console] broadcast A new challenge has started!"

  midnight_reset:
    enabled: true
    type: fixed
    time: "00:00" # Midnight
    actions:
      - "[console] say Midnight reset triggered!"
```

### Behavior

#### Fixed Tasks

* If no `days` are specified, the task runs **every day** at the given `time`.
* If `days` are specified, the task runs **only on those days** at the given `time`.

#### Repeatable Tasks

* Executes for **all online players** at the specified `interval`.
* Runs continuously at the defined interval unless manually disabled.

### Explanation of Fields

* **`type`**: Defines whether the task is executed at a specific time (`fixed`) or at regular intervals (`repeatable`).
* **`time`** *(only for fixed tasks)*: Specifies the execution time in `HH:mm` format.
* **`days`** *(optional, only for fixed tasks)*: If provided, the task will only execute on the specified days; otherwise, it runs daily.
* **`interval`** *(only for repeatable tasks)*: Defines the time interval in seconds between task executions.
* **`actions`**: A list of commands that will be executed when the task is triggered.
* `variants`: Permission based [variant(s)](/configuration/rewards/reward-features/reward-variants.md) of repeatable task.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://ultimaterewards.athelion.eu/configuration/schedules-and-timers.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
