# Model Train Script

**Automate your model railroad — no computer required.**

Model Train Script makes model train automation as easy as possible. Create simple sequential automation scripts right on your iPhone, iPad or Mac and bring your layout to life. Besides automation, it also provides manual control of your layout with a graphical track diagram, including occupancy feedback and RailCom vehicle detection.

[![image-text](https://developer.apple.com/assets/elements/badges/download-on-the-app-store.svg)](https://apps.apple.com/nl/app/modeltrainscript/id6444422153?l=en)

<div><figure><img src="https://4224524483-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAjZj7d8De4optEMsLAji%2Fuploads%2Fek9ovKWbHnC1pn1uyNda%2FSimulator%20Screenshot%20-%20iPhone%2016%20Pro%20-%202025-09-15%20at%2012.35.36.png?alt=media&#x26;token=a589abb1-71e7-4d52-8f97-585dd9b42d23" alt="" width="188"><figcaption></figcaption></figure> <figure><img src="https://4224524483-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAjZj7d8De4optEMsLAji%2Fuploads%2FrCBhBMmlJpxrBbmrPIlC%2FSimulator%20Screenshot%20-%20iPhone%2016%20Pro%20-%202025-09-15%20at%2012.35.49.png?alt=media&#x26;token=0509b9a4-d002-4573-8cf4-729f9f4eaa8d" alt="" width="188"><figcaption></figcaption></figure> <figure><img src="https://4224524483-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAjZj7d8De4optEMsLAji%2Fuploads%2FvenaBYnguOBMrVggW3AH%2FSimulator%20Screenshot%20-%20iPhone%2016%20Pro%20-%202025-09-15%20at%2012.35.59.png?alt=media&#x26;token=0728ba12-fee8-4ead-9933-283c61e40677" alt="" width="188"><figcaption></figcaption></figure></div>

{% hint style="info" %}
Model Train Script supports [ESU ECoS](https://esu.eu/) and all command stations using the [Z21](https://www.z21.eu/) protocol.
{% endhint %}

## Features

<table data-view="cards"><thead><tr><th></th><th></th></tr></thead><tbody><tr><td><strong>Automation</strong></td><td>Automate your layout with easy-to-build scripts, time tables, routes and flags</td></tr><tr><td><strong>Track diagram</strong></td><td>Control accessories, monitor feedback and see RailCom vehicle positions at a glance</td></tr><tr><td><strong>Vehicle catalog</strong></td><td>Manage your locomotive collection with functions, speed profiles and images</td></tr><tr><td><strong>Camera support</strong></td><td>Use your iPhone/iPad camera or an ESP32-CAM module for vehicle detection</td></tr><tr><td><strong>iCloud sync</strong></td><td>All data is synced across your Apple devices via iCloud</td></tr><tr><td><strong>Feedback</strong></td><td>RBus, CBus, LBus (LocoNet) and RailCom occupancy detection</td></tr></tbody></table>

## Demo

{% embed url="<https://youtu.be/qzRbPDqkwg0>" %}

## Quick links

<table data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>Getting started</strong></td><td>Set up your profile and connect to your command station</td><td><a href="manual/profile">profile</a></td></tr><tr><td><strong>Manual</strong></td><td>Full reference for all features</td><td><a href="manual">manual</a></td></tr><tr><td><strong>Automation</strong></td><td>Learn how to create scripts, routes and time tables</td><td><a href="manual/automation">automation</a></td></tr></tbody></table>

## Contribute

Model Train Script is free software without any profit in mind.

<figure><img src="https://4224524483-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAjZj7d8De4optEMsLAji%2Fuploads%2FpExFOeOfXKBoasujchE8%2Fpaypal.png?alt=media&#x26;token=3d8ac748-e833-4935-a981-89eebacd4f3c" alt=""><figcaption></figcaption></figure>

Donations to help covering the costs of hosting and development are highly appreciated and can be done via PayPal via this [link](https://www.paypal.com/donate/?business=SNVA6CA2F8UDS\&no_recurring=0\&item_name=Your+donation+will+help+development+of+ModelTrainScript+and+allows+us+to+build+new+exciting+features+in+the+future%21\&currency_code=EUR). Thank you!

***

## Privacy[​](https://modeltrainscript.app/about/#privacy) <a href="#privacy" id="privacy"></a>

{% file src="<https://4224524483-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAjZj7d8De4optEMsLAji%2Fuploads%2FPAzLsNWxnumUlvJ694vK%2Fprivacy-policy.pdf?alt=media&token=02e92cda-96a5-4678-8430-65a47fe60e1b>" %}

## Disclaimer[​](https://modeltrainscript.app/about/#disclaimer) <a href="#disclaimer" id="disclaimer"></a>

This app is not affiliated with ESU, Roco or Fleischmann. The ESU brand is owned by ESU electronic solutions ulm GmbH & Co. KG, the Z21 brand is owned by Modelleisenbahn GmbH, all rights reserved to them.

The makers of this app are NOT RESPONSIBLE for any damage caused by runaway trains. Always be there while the scripts are running and make sure a throttle is available for quick stop of operations.

***

© 2026 Arjan Pragt

<figure><img src="https://4224524483-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAjZj7d8De4optEMsLAji%2Fuploads%2Fafhf6Nv5TCcPXs6zLHQx%2Feurope-small.png?alt=media&#x26;token=862bebb4-0e08-4110-a192-111765492bdc" alt="made in europe" width="64"><figcaption></figcaption></figure>
