Train schedules are represented by a table in Lua. The table contains a list of entries where each entry has a single instruction and multiple conditions.
Each instruction and condition has a `data` table that stores specific data about the instruction or condition.
Conditions are stored in a list of lists of conditions. The inner lists contain conditions that get `AND`'ed together. They must all be met for that group to be true.
The outer list contains the `AND`'ed groups of conditions that get `OR`'ed together. Only one of the groups needs to be true for the schedule to move onto the next instruction.
| [`"create:delay"`](#createdelay) | Wait for a certain delay |
| [`"create:time_of_day"`](#createtimeofday) | Wait for a specific time of day |
| [`"create:fluid_threshold"`](#createfluidthreshold) | Wait for a certain amount of fluid to be on board |
| [`"create:item_threshold"`](#createitemthreshold) | Wait for a certain amount of items to be on board |
| [`"create:redstone_link"`](#createredstonelink) | Wait for a redstone link to be powered |
| [`"create:player_count"`](#createplayercount) | Wait for a certain amount of players to be on board |
| [`"create:idle"`](#createidle) | Wait for cargo loading inactivity |
| [`"create:unloaded"`](#createunloaded) | Wait for the current chunk to be unloaded |
| [`"create:powered"`](#createpowered) | Wait for the station to be powered |
---
### `"create:delay"`
Wait for a set delay. Can be measured in ticks, seconds or minutes.
**Data**
- _value:_ `number` The amount of time to wait for.
- _time_unit:_ `number` The unit of time. 0 for ticks, 1 for seconds and 2 for minutes.
---
### `"create:time_of_day"`
Wait for a time of day, then repeat at a specified interval.
**Data**
- _hour:_ `number` The hour of the day to wait for in a 24-hour format. Must be an integer within the range of [0..23].
- _minute:_ `number` The minute of the hour to wait for. Must be an integer within the range of [0..59].
- _rotation:_ `number` The interval to repeat at after the time of day has been met. Check the rotation table below for valid values. Must be an integer within the range of [0..9].
Wait for a certain amount of a specific fluid to be loaded onto the train.
**Data**
- _bucket:_ `table` The bucket item of the fluid.
- _threshold:_ `number` The threshold in number of buckets of fluid. Must be a positive integer.
- _operator:_ `number` Whether the condition should wait for the train to be loaded above the threshold, below the threshold or exactly at the threshold. 0 for greater than, 1 for less than, 2 for equal to.
- _measure:_ `number` The unit to measure the fluid in. This condition supports buckets as the only unit. Set to 0.
Wait for a certain amount of a specific item to be loaded onto the train.
**Data**
- _item:_ `table` The item.
- _threshold:_ `number` The threshold of items. Must be a positive integer.
- _operator:_ `number` Whether the condition should wait for the train to be loaded above the threshold, below the threshold or exactly at the threshold. 0 for greater than, 1 for less than, 2 for equal to.
- _measure:_ `number` The unit to measure the items in. 0 for items. 1 for stacks of items.
Wait for a certain amount of players to be seated on the train.
**Data**
- _count:_ `number` The number of players to be seated on the train. Must be a positive integer.
- _exact:_ `number` Whether the seated player count has to be exact to meet the condition. 0 for the exact amount of players seated, 1 for a greater than or equal amount of seated players.
---
### `"create:idle"`
Wait for a period of inactivity in loading or unloading the train. Can be measured in ticks, seconds or minutes.
**Data**
- _value:_ `number` The amount of idle time to meet the condition. Must be a positive integer.
- _time_unit:_ `number` The unit of time. 0 for ticks, 1 for seconds and 2 for minutes.
---
### `"create:unloaded"`
Wait for the chunk the train is in to be unloaded.
---
### `"create:powered"`
Wait for the station to be powered with a redstone signal.
---
## Items
In Lua, items are represented with an ID and a count.
- _count:_ `number` The amount of items in the stack. For the purposes of working with train schedules the count should always be 1. Must be an integer.