Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function updatePort(port,state)
- local col = port.color
- print(col)
- if state == true and port.invert == false then
- rednet.send(port.computer,65536+col)
- elseif state == false and port.invert == false then
- rednet.send(port.computer,col)
- elseif state == true and port.invert == true then
- rednet.send(port.computer,col)
- elseif state == false and port.invert == true then
- rednet.send(port.computer,65536+col)
- end
- end
- function updateBusses(device = nil)
- if device == nil then
- updateBus(device.BusA)
- updateBus(device.BusB)
- updateBus(device.BusC)
- end
- end
- function updateBus(bus)
- local states = {{"NA", p1=nil, p2=nil },
- {"ValveClosed", p1=false, p2=nil },
- {"ValveOpen", p1=true, p2=nil },
- {"PumpOff", p1=true, p2=nil },
- {"MonoPumpIn", p1=false, p2=nil },
- {"MonoPumpOut", p1=false, p2=nil },
- {"PumpIn", p1=false, p2=false},
- {"PumpOut", p1=false, p2=true }}
- updatePort(bus.Port1,states[bus.state].p1)
- updatePort(bus.Port2,states[bus.state].p2)
- end
- function updateRedstone()
- updateBusses(SmelteryA)
- updateBusses(SmelteryB)
- updateBusses(TankA)
- updateBusses(TankB)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement