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")Industries
Section titled “Industries”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.
getIndustryWarnings(industryId)
→ any[] industryId string Returns warnings for an industry. Throws if the industry isn’t found.
Industry Testing
Section titled “Industry Testing”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.
Interchanges
Section titled “Interchanges”getAllInterchangeIds()
→ string[] Returns the identifiers of all interchanges on the map.
getNextInterchangeServeTime()
→ float 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.
Operations
Section titled “Operations”Runs an immediate freight sweep across all industries, processing car loads/unloads and waybill assignments as if the scheduled sweep had occurred.
© 2026 Giraffe Lab LLC. All rights reserved.