Skip to content
You're reading the docs for Railroader 0.6 (the MoW Update), currently available on the Experimental branch.

Ops

The ops module (reached via world.ops) exposes freight operations: industry lookup and testing, interchange management, and locating cars by their operational context.

from railroader import world
var industry = world.ops.getIndustry("some-industry-id")

getAllIndustryIds()

→ string[]

Returns the identifiers of all industries on the map.

industryId string

Returns the industry with the given identifier. Throws if not found.

componentId string

Returns the industry component with the given identifier. Throws if not found.

getIndustryNextContractTiers()

→ Dictionary<string, int>

Returns the pending next-contract tier for every enabled and reachable industry that has one queued, keyed by industry identifier. Industries with no pending contract change, or that are disabled/unreachable, are omitted.

industryId string

Returns warnings for an industry. Throws if the industry isn’t found.

industryId string
tier int

Sets an industry’s active contract to the given tier directly, bypassing the normal contract negotiation flow. Throws if the industry isn’t found.

world.ops.setContractTier("some-industry-id", 3)
industryId string
seed int

Sets the random seed an industry uses for its random behavior (e.g. waybill generation). Useful for making industry testing deterministic. Throws if the industry isn’t found.

getAllInterchangeIds()

→ string[]

Returns the identifiers of all interchanges on the map.

Returns the in-game clock time of the next scheduled interchange service, as total seconds since day zero (day × 24 + hour, in seconds — not world.gameTime, which measures real time since the session started). If today’s service hour has already passed, returns the time for tomorrow’s service instead.

interchangeId string
enabled bool

Enables or disables an interchange. Throws if the interchange isn’t found.

industryId string

Returns every car currently sitting on track belonging to the given industry (across all of its components). Throws if the industry isn’t found.

Returns every car currently sitting on track belonging to any interchange.

Runs an immediate freight sweep across all industries, processing car loads/unloads and waybill assignments as if the scheduled sweep had occurred.