Create_SequencedGearshift

Drop-in replacement for Create's Create_SequencedGearshift peripheral.

Preserved from Create (verbatim): rotate, move, and isRunning. Existing scripts that drive a gearshift keep working unchanged.

Added (Avionics) — queue programming: getInstructions, setInstructions, start, stop. Mirrors the in-game GUI's 5-row sequence editor.

Added (Avionics) — instruction readback: getRotationModifier, getProgress, getRemainingTicks, getCurrentInstruction. Pace autopilot moves against the active instruction.

Added (Avionics) — kinetic SCADA pack: getSelfId, getSourceId, getSubnetworkAnchorId, getNetworkId, getKind (returns "split_shaft"), getSpeed, hasSource, isOverstressed, getStressImpact, getStressContribution. Inherited from KineticScadaSurface via KineticPeripheral; not declared here. The gearshift is a speed-zone boundary, so its getSelfId is the anchor id every block downstream reports for getSubnetworkAnchorId.

Type stays Create_SequencedGearshift — atypical for Avionics (which uses snake_case) but required for script compatibility.

getInstructions()Get the full instruction queue.
setInstructions(instructions)Replace the instruction queue.
start()Start executing the instruction queue from index 0.
stop()Halt any running sequence and return to idle.
getRotationModifier()Get the current rotation modifier (output:input ratio).
getProgress()Get the active instruction's progress as a fraction in [0, 1].
getRemainingTicks()Get the number of ticks remaining on the active instruction.
getCurrentInstruction()Get the active instruction as a table, or nil when idle.
getInstructions()Source

Get the full instruction queue.

Returns up to 5 entries (the in-game GUI's capacity). The last entry is always end. Each entry is a table:

  • type: one of turn_angle, turn_distance, delay, await, end
  • value: configured target — degrees / blocks / ticks depending on type. 1 for types without a value parameter.
  • speed_modifier: -2..+2 for rotational instructions, FORWARD (1) otherwise.

Returns

  1. { { [string] = any }... } The instruction list.
setInstructions(instructions)Source

Replace the instruction queue.

Accepts a 1-indexed Lua list of up to 5 entries. Each entry is a table with:

  • type (required): turn_angle, turn_distance, delay, await, or end
  • value (required for turn_angle / turn_distance / delay): clamped to the type's range (turn_angle: 1..360°, turn_distance: 1..128 blocks, delay: 1..600 ticks)
  • speed_modifier (optional, rotational only): -2..+2, defaults to FORWARD (1)

Halts any running sequence (run(-1)) before applying. Auto-appends an end terminator if the last entry isn't already end. After this call, use start to begin executing the new queue.

Parameters

  1. instructions table A list of instruction tables.
start()Source

Start executing the instruction queue from index 0. Equivalent to a redstone rising edge on a non-computer-attached gearshift. No-op if the gearshift has zero kinetic input.

stop()Source

Halt any running sequence and return to idle.

getRotationModifier()Source

Get the current rotation modifier (output:input ratio). 0 when idle. Sign and magnitude track the active instruction's speed modifier (+2 = FORWARD_FAST, -1 = BACK, etc.).

Returns

  1. number The rotation modifier.
getProgress()Source

Get the active instruction's progress as a fraction in [0, 1]. Computed as progress / value in the instruction's native unit (degrees for turn_angle, blocks for turn_distance, ticks for delay). Returns 0 when idle. Returns 0 for await (which has no fixed duration). May briefly read > 1 because the sequencer overshoots by ~2 ticks before advancing.

Returns

  1. number The progress fraction.
getRemainingTicks()Source

Get the number of ticks remaining on the active instruction. Returns 0 when idle. Returns -1 for await (waits indefinitely for a redstone pulse). Note that the underlying duration is recomputed whenever the kinetic speed changes mid-instruction, so this value can jump if the input shaft speeds up or slows down.

Returns

  1. number The remaining ticks.
getCurrentInstruction()Source

Get the active instruction as a table, or nil when idle. Same shape as one entry in getInstructions: type, value, speed_modifier.

Returns

  1. { [string] = any } The current instruction table, or nil.