OpenMods / OpenPeripheral

https://openmods.info
MIT License
67 stars 25 forks source link

Buildcraft pipe wire reader/writer support #80

Closed ghost closed 10 years ago

ghost commented 10 years ago

MiscPeripherals' version does not work with current Buildcraft.

theoriginalbit commented 10 years ago

Please elaborate some more on what you mean.

ghost commented 10 years ago

Ability to read and set pipe wire status. ie:

-- any buildcraft-compatible pipe, may or may not have wires on it
local pipe = peripheral.wrap("left")

-- assume said pipe has a red and green wire attached, with red wire ON
local wires = pipe.getWires()
for key, value in pairs(wires) do
  print(key .. " = " .. tostring(value))
  -- "red = true"
  -- "green = false"
end

pipe.setWire("green", true)
pipe.setWire("red", true)
pipe.setWire("blue", false) -- no effect

print( pipe.getWire("red") ) -- prints true