portable_engine

A fuel-burning engine. Reports remaining burn time, fuel/superheat state, lit state, and the kinetic output it generates.

getBurnTime()Get the burn time remaining on the active fuel item.
getTotalBurnTime()Get the total burn time across the active fuel plus the inventory.
isSuperHeated()Check whether the engine is superheated.
isCurrentFuelInfinite()Check whether the active fuel is infinite.
isTotalFuelInfinite()Check whether the total fuel supply is infinite.
isLit()Check whether the engine is currently lit.
getGeneratedSpeed()Get the engine's generated speed (the speed the engine sources into its network when running, before kinetic-graph propagation).
getSelfId()Get this block's id.
getSourceId()Get the id of the block immediately driving this one, or nil if this block has no source.
getSubnetworkAnchorId()Get the id of this block's speed-zone anchor — the gearshift / clutch / speed controller / generator that defines the start of this speed zone.
getNetworkId()Get the id of this block's kinetic network.
getKind()Get this block's role on the kinetic graph: one of "generator", "split_shaft", "consumer", or "passthrough".
getSpeed()Get the local rotational speed at this block.
hasSource()Check whether this block is connected to a kinetic source.
isOverstressed()Check whether the block's network is overstressed.
getStressImpact()Get the stress impact of this block on its network — how much stress it draws while running.
getStressContribution()Get this block's contribution to its network's stress capacity.
getBurnTime()Source

Get the burn time remaining on the active fuel item. Burn time remaining on the currently-burning fuel item, in ticks. While lit, decrements by exactly 1 per game tick (20/s) regardless of signal, speed, stress, or superheating. Do not finite-difference this to "measure" a fuel rate: the rate is a game constant, and sampling across a refill event from the inventory will jump the value upward and make the naive rate look wrong.

Returns

  1. number The active fuel's remaining burn time in ticks.
getTotalBurnTime()Source

Get the total burn time across the active fuel plus the inventory. Total burn time across the currently-burning fuel plus the remaining stack in the inventory, in ticks. Divide by 20 for seconds of endurance; this is the right field to use for "how long until I run out" rather than getBurnTime(), which only covers the active item.

Returns

  1. number The total remaining burn time in ticks.
isSuperHeated()Source

Check whether the engine is superheated.

Returns

  1. boolean True if superheated.
isCurrentFuelInfinite()Source

Check whether the active fuel is infinite.

Returns

  1. boolean True if the active fuel is infinite.
isTotalFuelInfinite()Source

Check whether the total fuel supply is infinite.

Returns

  1. boolean True if the total fuel is infinite.
isLit()Source

Check whether the engine is currently lit.

Returns

  1. boolean True if lit.
getGeneratedSpeed()Source

Get the engine's generated speed (the speed the engine sources into its network when running, before kinetic-graph propagation).

Returns

  1. number The generated speed.
getSelfId()Source

Get this block's id. Other peripherals' getSourceId or getSubnetworkAnchorId return this same id when they refer to this block.

Returns

  1. string The block's id.
getSourceId()Source

Get the id of the block immediately driving this one, or nil if this block has no source.

Returns

  1. string The parent's id, or nil.
getSubnetworkAnchorId()Source

Get the id of this block's speed-zone anchor — the gearshift / clutch / speed controller / generator that defines the start of this speed zone. Two blocks share an anchor iff they're in the same speed zone. A generator or split-shaft returns its own getSelfId.

Returns

  1. string The anchor block's id, or nil.
getNetworkId()Source

Get the id of this block's kinetic network. Same value for every block on the same network regardless of how many speed zones lie between them. Nil if this block isn't on a network.

Returns

  1. string The network id, or nil.
getKind()Source

Get this block's role on the kinetic graph: one of "generator", "split_shaft", "consumer", or "passthrough".

Returns

  1. string The role string.
getSpeed()Source

Get the local rotational speed at this block. Signed; same value across a speed zone, changes across a split-shaft.

Returns

  1. number The local speed.
hasSource()Source

Check whether this block is connected to a kinetic source.

Returns

  1. boolean True if a source is connected.
isOverstressed()Source

Check whether the block's network is overstressed.

Returns

  1. boolean True if overstressed.
getStressImpact()Source

Get the stress impact of this block on its network — how much stress it draws while running. Speed-dependent; zero for sources and pure conduit blocks. Matches the "Stress Impact" value shown by goggles.

Returns

  1. number The stress impact.
getStressContribution()Source

Get this block's contribution to its network's stress capacity. Non-zero for sources only. Parallel to getStressImpact (per-block draw) and distinct from Create_Stressometer#getStressCapacity, which reports the network total.

Returns

  1. number The per-block stress contribution.