Skip to content

ComputerCraft

Plomph edited this page Sep 15, 2026 · 3 revisions

ComputerCraft

With CC: Tweaked installed, a Transmission next to a computer, or on a wired modem, is a transmission peripheral.

Methods

Method Returns
getGear() the current gear, 1 to 4
setGear(n) true, or false and a reason
shiftUp(), shiftDown() true, or false and a reason
getDirection() "forward", "reverse" or "neutral"
setDirection(d) true, or false and a reason
getGearSpeeds() the four gear speeds in RPM
setGearSpeed(n, rpm) the speed stored (kept within 1–256)
getInputSpeed(), getOutputSpeed() RPM

A direction set by a computer holds until a Forward or Reverse face is powered.

Refusal reasons:

Reason Meaning
cooldown shifted too recently
limit already in 1st or 4th gear
redstone_override a Forward or Reverse face is powered

Example

local t = peripheral.find("transmission")
t.setGearSpeed(1, 48)
t.setDirection("forward")
local ok, reason = t.setGear(2)
if not ok then print("refused: " .. reason) end
print(t.getGear(), t.getOutputSpeed() .. " RPM")

Clone this wiki locally