# Time tables

A timetable lets you schedule when scripts are started. By creating multiple timetables you can define different automation scenarios for your layout — for example, a busy morning schedule, relaxed afternoon freight traffic, or a night mode with minimal movement.

## Creating a timetable

Navigate to **Time tables** in your [profile](/docs/manual/profile.md) and tap the **+** button. Each timetable has the following settings:

* **Name** — A descriptive label (e.g. "Express schedule", "Freight operations").
* **Show in Throttle** — When enabled, the timetable appears in the automate tab of the [throttle](/docs/manual/throttle.md) for quick start/stop control.
* **Start script** (optional) — A script that runs automatically when the timetable is started. Useful for preparing your layout (e.g. setting initial turnout positions or activating lighting).
* **Stop script** (optional) — A script that runs when the timetable is stopped. Useful for cleanup (e.g. returning accessories to a neutral state).

## Entries

Each timetable contains one or more entries. An entry defines **when** something should happen and **what** should run.

### Time condition

Times are specified as **hour : minute** relative to when the timetable was started — not based on the system clock. This means the same timetable works regardless of when you start your session.

Both hour and minute support wildcards:

| Time   | Triggers                                     |
| ------ | -------------------------------------------- |
| `2:30` | Once, at 2 hours and 30 minutes after start. |
| `*:15` | Every hour at minute 15.                     |
| `0:*`  | Every minute during the first hour.          |

### Script selection

Each entry can run a script in one of two ways:

* **Specific script** — Always runs the same script.
* **Random script by tag** — Picks a random script from all scripts with a matching tag. Each time the entry triggers, a different script may run. This is a great way to add variety — for example, tag several departure scripts with `departures` and let the timetable pick one at random every few minutes.

## Running a timetable

Start a timetable from the timetable editor (play button) or from the automate tab in the [throttle](/docs/manual/throttle.md). The timetable requires track power to be on and automation to be enabled.

Once started, the timetable evaluates its entries every minute. When a time condition matches, the corresponding script is executed. Timetables run in the background and do not block manual control.

You can run multiple timetables simultaneously for complex scenarios, or stop any timetable individually at any time.


---

# 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://modeltrainscript.gitbook.io/docs/manual/automation/time-tables.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.
