Train dispatcher
This chapter describes the actions that a script uses to coordinate with the Train Dispatcher, Model Train Script's traffic controller for shared track.
A script may hold at most one clearance at a time. Requesting a new clearance while one is already held is not supported; cancel the old one first.
Request clearance
Asks the dispatcher for permission to drive a path. If granted, the action sets the turnouts along the path and stores the clearance against the running script. If not granted, the action waits until another clearance is cancelled and then tries again (the script does not continue until permission is held).
| Setting | Description |
|---|---|
| Path positions | The sequence of layout items the path should pass through. The first item is the start, the last is the destination, anything in between is a waypoint. Configure this the same way as for Set path. |
| Path strategy | How to choose between multiple valid paths through the waypoints: shortest, first, or random. |
The action records the script's name as the clearance's owner, so you can identify who is holding what in the Clearances section of the automation tab.
INFO
If you also want the action to avoid physically occupied track (not just claimed clearances), use a Set path with require free path before requesting the clearance.
Cancel clearance
Releases the clearance currently held by the script. Other scripts (or manual moves) waiting on overlapping paths immediately retry their request, and typically one of them will now succeed.
This action takes no configuration. If the script does not currently hold a clearance, the action does nothing and the script continues normally.
INFO
Always pair a Request clearance with a Cancel clearance at the end of the section that needs the path. Forgetting to cancel leaves the path reserved indefinitely, blocking other trains. If a clearance does get stuck, you can always remove it manually from the Clearances section of the automation tab.

