This page documents the BuildCraft integrations exposed to Lua by OpenComputers and Computronics. The available components cover transport pipes, heat-capable machines, drone docking stations, and controllable tiles.
- Dependency:
buildcraft - Label:
integration-required
bc_pipeheatable_tiledockingbc_controllable
- Inspecting pipe connectivity, gates, and wire state.
- Monitoring the heat window of BuildCraft machines.
- Docking drones to item pipes and dropping items into them.
- Reading and changing machine control modes.
bc_pipe is exposed on BuildCraft pipe tiles.
- Syntax:
getPipeType(): string | nil, string? - Purpose: Return the current pipe type name.
- Returns:
- The pipe type enum name on success.
nil, "none"if the underlying lookup fails.
- Usage notes:
- This is useful for distinguishing item, fluid, power, and structure pipe families.
- Syntax:
isPipeConnected(side: number): boolean - Purpose: Check whether the pipe is connected on the specified side.
- Parameters:
side: numberA ForgeDirection side index.
- Returns:
trueif that side is connected.falseif it is not connected or if the underlying lookup fails.
- Usage notes:
- Invalid side values do not surface a Lua-visible exception here. They simply fall back to
false.
- Invalid side values do not surface a Lua-visible exception here. They simply fall back to
- Syntax:
isWired(color: string): boolean - Purpose: Check whether the pipe has a wire of the specified color installed.
- Parameters:
color: stringThe exact BuildCraftPipeWireenum name, typically an uppercase color name.
- Returns:
trueif the wire is installed.falseif it is missing or the color name is invalid.
- Syntax:
isWireActive(color: string): boolean - Purpose: Check whether the specified pipe wire is currently active.
- Parameters:
color: stringThe exact BuildCraftPipeWireenum name, typically an uppercase color name.
- Returns:
trueif the wire is active.falseif it is inactive or the color name is invalid.
- Usage notes:
isWired()only checks presence.isWireActive()checks live state.
- Syntax:
hasGate(side: number): boolean - Purpose: Check whether the specified side has a gate installed.
- Parameters:
side: numberA ForgeDirection side index.
- Returns:
trueif a gate is present on that side.falseif it is missing or the lookup fails.
heatable_tile is exposed on BuildCraft tiles implementing IHeatable.
- Syntax:
getMinHeatValue(): number - Purpose: Return the minimum meaningful heat value.
- Returns:
- The lower bound where the machine starts entering its useful heat range.
- Syntax:
getIdealHeatValue(): number - Purpose: Return the ideal working heat value.
- Returns:
- The target heat level the machine prefers.
- Syntax:
getMaxHeatValue(): number - Purpose: Return the maximum safe heat value.
- Returns:
- The upper limit before heat should generally be treated as unsafe.
- Syntax:
getCurrentHeatValue(): number - Purpose: Return the machine's current heat.
- Returns:
- The live heat value.
- Usage notes:
- This is mainly intended for engines and other BuildCraft machines that operate within a heat window.
- In practice it is usually more useful to compare this value against
getIdealHeatValue()than only against the maximum.
docking is exposed by the Computronics drone docking upgrade for BuildCraft pipe docking stations.
- Syntax:
dock(): boolean[, string] - Purpose: Start docking the drone with a valid station, checking the block below first.
- Returns:
trueif docking has started successfully.false, reasonon failure.
- Usage notes:
- Returns
false, "drone is still moving"if the drone has not come to rest yet. - Returns
false, "no non-occupied station found"if no free station is available. - A successful call starts the docking process; it does not mean the drone is already fully docked in the same tick.
- Returns
- Syntax:
dropItem(slot: number[, maxAmount: number[, color: number]]): number[, string] - Purpose: Inject items from the drone inventory into the attached item pipe while docked.
- Parameters:
slot: numberDrone inventory slot, starting at1.maxAmount: numberMaximum number of items to inject. The driver clamps this to0..64, defaulting to64.color: numberOptional BuildCraft item color id. It only has an effect on tier 2 or higher drones.
- Returns:
- The number of items actually injected on success.
0, reasonon failure.
- Usage notes:
- This only works when the drone is already docked to an item pipe.
- Failure messages include
drone is still docking,drone is not docked,cannot inject items into pipe,invalid pipe type, andinvalid/empty slot. - If a color is supplied on a lower-tier drone, the color argument is ignored.
- Syntax:
release(): boolean[, string] - Purpose: Undock the drone from the station.
- Returns:
trueon success.0, reasonon failure.
- Usage notes:
- Returns
0, "drone is still docking"if docking has not finished yet. - Returns
0, "drone is not docked"if the drone is not currently docked.
- Returns
bc_controllable is exposed on BuildCraft tiles implementing IControllable.
- Syntax:
getControlMode(): string - Purpose: Return the current control mode name.
- Returns:
- The current BuildCraft
IControllable.Modeenum name.
- The current BuildCraft
- Syntax:
acceptsControlMode(mode: string): boolean - Purpose: Check whether the tile accepts the specified control mode.
- Parameters:
mode: stringExact BuildCraftIControllable.Modeenum name.
- Returns:
trueif the tile supports that mode.falseif it does not.
- Usage notes:
- Invalid enum names are not silently ignored here. They raise the underlying argument error.
- Syntax:
setControlMode(mode: string) - Purpose: Set the tile control mode.
- Parameters:
mode: stringExact BuildCraftIControllable.Modeenum name.
- Returns:
- This callback does not return an additional success flag.
- Usage notes:
modemust be accepted byIControllable.Mode.valueOf(...).- The safest workflow is to read the current value with
getControlMode(), validate candidates withacceptsControlMode(), and then apply the new mode.
local component = require("component")
if component.isAvailable("bc_pipe") then
local pipe = component.bc_pipe
print("Pipe type:", pipe.getPipeType())
print("North connected:", pipe.isPipeConnected(2))
end
if component.isAvailable("heatable_tile") then
local heatable = component.heatable_tile
print("Heat:", heatable.getCurrentHeatValue(), "/", heatable.getMaxHeatValue())
endrailcraftappeng