Mother DocsMother Docs
Buy me a Coffee
Steam Workshop
Discord
  • Mother OS (Ingame Script)
  • Mother GUI
  • Mother Autopilot System (MAPS)
  • Mother Core (Script Framework)
  • Cheatsheet
  • Brand Guidelines
Buy me a Coffee
Steam Workshop
Discord
  • Mother OS (Ingame Script)
  • Mother GUI
  • Mother Autopilot System (MAPS)
  • Mother Core (Script Framework)
  • Cheatsheet
  • Brand Guidelines
  • Cheatsheet
  • Mother OS (Ingame Script)
    • Getting Started

      • Upgrade Guide
      • Installation
      • Command Line Interface (CLI)
      • Configuration
      • Modules
    • Core Modules

      • Activity Monitor
      • Almanac
      • Block Catalogue
      • Intergrid Message Service
      • Local Storage
      • Merge Block Module
    • Extension Modules

      • Air Vent Module
      • Battery Module
      • Terminal Block Module
      • Cockpit Module
      • Connector Module
      • Display Module
      • Door Module
      • Gas Tank Module
      • Hinge Module
      • Landing Gear Module
      • Light Module
      • Piston Module
      • Programmable Block Module
      • Rotor Module
      • Screen Module
      • Sensor Module
      • Sorter Module
      • Sound Block Module
      • Thruster Module
      • Timer Block Module
      • Wheel Module
    • Compatibility
    • Examples
  • Mother GUI
    • Getting Started

      • Installation
      • Configuration
    • Commands
    • Menus
    • Views
  • Mother Autopilot System (MAPS)
    • Getting Started

      • Upgrade Guide
      • Installation
    • Modules

      • Flight Planning Module
      • Map Module
      • Flight Control Module
      • Attitude Module
      • Docking Module
  • Mother Core (Script Framework)
    • Getting Started

      • Upgrade Guide
      • Installation
      • Architecture Overview
      • Managing Script Size & Complexity
    • Building A Module
    • Mother CLI (Console)
    • Core Modules
      • Activity Monitor
      • Almanac
      • Block Catalogue
      • Clock
      • Command Bus
      • Configuration
      • Event Bus
      • Intergrid Message Service
      • Local Storage
      • Log
      • Terminal
    • Utilities

      • Color Helper
      • Number Helper
      • Security
      • Serializer
    • Tutorials
  • Powered By Mother
  • Brand Guidelines

Clock

  • Scheduling Repeating Work
  • Queueing Delayed Work
  • Running Coroutines
  • Useful Properties and Methods
  • Emitted Events

Clock is Mother's timing engine. It runs on Update10, which gives you about one tick every 0.166 seconds, and it supports three common patterns:

  1. Repeating work with Schedule().
  2. One-off delayed work with QueueForLater().
  3. Multi-step routines with AddCoroutine().

Scheduling Repeating Work

Use Schedule() for work that should repeat on a fixed interval.

TelemetryModule.cs
public override void Boot()
{
    Clock clock = GetModule<Clock>();
    clock.Schedule(UpdateTelemetry, 1);
    clock.Schedule(UpdateThreatAssessment, 5);
}

void UpdateTelemetry()
{
    Mother.Print($"Speed: {Mother.GetShipSpeed()}");
}

void UpdateThreatAssessment()
{
    // expensive scan here
}

Queueing Delayed Work

Use QueueForLater() when something should run once after a delay.

LaunchModule.cs
public void StartCountdown()
{
    Mother.Print("Launch in 10 seconds.");

    GetModule<Clock>().QueueForLater(() =>
    {
        Mother.Print("Ignition.");
        FireThrusters();
    }, 10);
}

Running Coroutines

Use AddCoroutine() when a task needs to yield across multiple cycles.

BootModule.cs
public override void Boot()
{
    GetModule<Clock>().AddCoroutine(SpinUpSequence());
}

IEnumerable<double> SpinUpSequence()
{
    Mother.Print("Opening blast doors...");
    OpenDoors();
    yield return 2.0;

    Mother.Print("Enabling reactors...");
    EnableReactors();
    yield return 1.0;

    Mother.Print("System ready.");
}

Useful Properties and Methods

MemberUse
QueuedTaskCountNumber of one-off delayed actions waiting to run
CoroutineCountNumber of active coroutines
GetLoader()Small / or \ activity indicator used by Terminal
Reset()Clears queued tasks, repeating tasks, and coroutines
ClearScheduledTasks()Clears only repeating scheduled tasks

Emitted Events

Clock does not emit any built-in events.

Last Updated: 5/2/26, 10:05 PM
Contributors: Luke Morrison, lukejamesmorrison, Copilot
Prev
Block Catalogue
Next
Command Bus