Documentation on the lua peripherals and their functions implemented as CC: Tweaked compat.
Available on most blocks that have an internal inventory of gas (some exceptions apply, which are gas-storing blocks with their own custom peripheral)
getGasDetails(gasName: string) -> tableReturns a table representing the gas properties, in the following format:
{
name = <string>
density = <number>
viscosity = <number>
specificHeatCapacity = <number>
thermalConductivity = <number>
sutherlandConstant = <number>
adiabaticIndex = <number>
}Throws if the gasName (resource location) is not found in the gas registry
getGasMass() -> table<string, number>Returns a table of each gas name to its mass in the node. Will contain every gas name, even if the node does not contain that gas.
getHeatEnergy() -> numberReturns the total heat energy in the node, in Joules
getPressure() -> numberReturns the pressure of the node, in Pascals
getTemperature() -> numberReturns the temperature of the node, in Kelvin
pushGas(toName: string, gasName: string, amount: number | nil)Push the gas of type gasName from this node to the node with the peripheral name toName.
If amount is not specified, it will move the entire amount of gasName in the node.
Throws if:
toNameis not found as a peripheraltoNameis not a gas node peripheralgasNameis not found in the gas registryamountis<=0amountis larger than the amount ofgasNamein the nodecheatKelvinPeripheralis not enabled in the server config (disabled by default)
pullGas(fromName: string, gasName: string, amount: number | nil)The same as pushGas, documented above, except the gas is being moved from the fromName into this node.
pushTemperature(toName: string, amount: number | nil)Push amount of Kelvin from this node to the node peripheral named toName.
If amount is not specific, it will transfer all heat from this node into toName.
Throws if:
toNameis not found as a peripheraltoNameis not a gas node peripheralamountis<=0amountis larger than the temperature in the nodecheatKelvinPeripheralis not enabled in the server config (disabled by default)
pullTemperature(fromName: string, amount: number | nil)The same as pushTemperature, documented above, except the temperature is being moved from the fromName into this node.
Peripheral type: cw_phys_bearing
assemble()Sets the physics bearing to assemble on the next tick
disassemble()Sets the physics to disassemble as soon as possible (not necessarily on the same tick)
setFollowAngleMode()Sets the bearing mode to FOLLOW_ANGLE
setUnlockedMode()Sets the bearing mode to UNLOCKED
setAngle(angle: number)Sets the current angle of the physics bearing
isBeingDisassembled() -> boolWhether the physics bearing is currently trying to disassemble (aka trying to align to the grid)
isActive() -> boolIs the physics bearing assembled
isInFollowAngleMode() -> boolIs the physics bearing currently in FOLLOW_ANGLE mode
getConnectedToShip() -> numberReturns the numeric ship id this bearing is controlling. Will be -1 if the bearing is not currently assembled / has no ship id.
getTargetAngle() -> numberThe current target angle the bearing is trying to get to
getActualAngle() -> numberThe current angle the bearing is actually at
getTargetAngleChangeSpeed() -> numberThe current speed the bearing is moving at to get to the target angle
getRPM() -> numberThe current Create RPM being given to the bearing
getFacingDirection() -> stringThe name of the direction the bearing block is rotated.
Possible values: up, down, north, south, east, west
Peripheral type: cw_gas_nozzle
setPointer(value: number)Sets the gas nozzle "power" (the dial on the front). Equivalent to using create rotation on the side of the nozzle.
value should be between 0.0 and 1.0, and represent a percentage of max power.
getPointer() -> numberReturns a number between 0.0 and 1.0 of the gas nozzles current "power"
getPointerSpeed() -> numberReturns the current speed the gas nozzle power dial is moving at because of Create rotation.
hasBalloon() -> boolWhether the gas nozzle currently has a balloon air pocket attached/detected.
getPocketTemperature() -> numberGets the total temperature of the attached air pocket, in Kelvin. If no air pocket is attached, will return 0.0
getTargetTemperature() -> numberGets the current target temperature the gas nozzle is trying to achieve. Affected by both the gas nozzles current gas temperature, and the "power" dial.
getDuctTemperature() -> numberGets the current internal temperature of the gas nozzle (not the pocket!) in Kelvin.
getBalloonVolume() -> numberThe total volume (in metres cubed) of the attached air pocket. If no air pocket is attached, will return 0.0.
getLeaks() -> numberReturns the number of leaks found in the air pocket. If no air pocket is attached, will return 0.0.
Peripheral type: cw_flap_bearing
isSmart() -> boolWhether the flap bearing is a smart flap bearing
getAngle() -> numberThe current angle the bearing is at. Will be within the range -22.5 .. 22.5
setAngle(angle: number, locked: bool | nil)Sets the angle the bearing is currently at. angle must be in the range -22.5 .. 22.5.
If locked is not specified, the bearing will be "locked"
and no longer respond to any redstone input (only computer input) until setLocked is used.
If locked is specified as false, the bearing will not be locked, and will respond to redstone input, but will also reset every tick.
Throws if:
- The peripheral is not a smart flap bearing
- The flap bearing is not being provided rotational power (enable
cheatFlapBearingPeripheralin the server config to bypass this) - Flap bearing is not assembled
isLocked() -> boolWhether the flap bearing is currently locked, and will only respond to computer input (not redstone).
setLocked(locked: bool)Set the flap bearing to locked true/false. If true, the flap bearing will only respond to computer angle input.
If false, the computer can accept redstone or computer input, but will reset the computer input each tick.
isRunning() -> boolIs the flap bearing currently assembled
assemble() -> boolAssembles the flap bearing.
Returns true, unless the bearing was already assembled, in which case it will return false
disassemble() -> boolDisassembles the flap bearing.
Returns true, unless the bearing was already disassembled, in which case it will return false
Peripheral type: cw_prop_bearing
isBrass() -> boolWhether the propeller bearing is a brass propeller bearing (false if it is a jury rigged bearing)
getAngle() -> numberThe current angle the bearing is at. Will be within the range -360 .. 360
setBladeAngle(angle: number, locked: bool | nil)Sets the blade angle of any blade controllers on the bearing. angle must be in the range -180 .. 180.
If locked is not specified, the bearing will be "locked"
and no longer respond to any redstone input (only computer input) until setLocked is used.
If locked is specified as false, the bearing will not be locked, and will respond to redstone input, but will also reset every tick.
Throws if:
- The peripheral is not a brass propeller bearing
- The propeller bearing is not assembled
isLocked() -> boolWhether the propeller bearing is currently locked, and will only respond to computer input (not redstone).
setLocked(locked: bool)Set the propeller bearing locked to true/false. If true, the propeller bearing will only respond to computer blade angle input.
If false, the propeller bearing can accept redstone or computer input, but will reset to the redstone input each tick.
isRunning() -> boolIs the propeller bearing currently assembled
assemble() -> boolAssembles the propeller bearing.
Returns true, unless the bearing was already assembled, in which case it will return false
disassemble() -> boolDisassembles the propeller bearing.
Returns true, unless the bearing was already disassembled, in which case it will return false
Peripheral type: cw_alt_meter
getHeight() -> numberReturns the current height the altimeter is at. If the altimeter is on a ship, the height is automatically transformed from the shipyard into worldspace.
getOutput() -> numberGets the current redstone signal strength the altimeter is outputting, in the range 0..15.
getTargetHeight() -> numberReturns the target height the altimeter is currently set to.
setTargetHeight(height: number)Sets the target height of the altimeter. If height has decimals, they will be truncated.
getSensitivity() -> numberReturns the sensitivity the altimeter is currently set to.
setSensitivity(sensitivity: number)Sets the sensitivity of the altimeter. If sensitivity has decimals, they will be truncated.
getDirection() -> stringReturns the current direction mode of the altimeter. Will be one of: UP, DOWN or BOTH.
setDirection(direction: string)Sets the current direction mode of the altimeter. Not uppercase sensitive.
Throws if direction is not one of: UP, DOWN or BOTH.
This page is still a work in progress.
Spot an error, or want to add extra information? Then feel free to contribute to this page with a pull request