Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- P1 = peripheral.wrap("batbox_7")
- P2 = peripheral.wrap("batbox_9")
- mon = peripheral.wrap("top")
- bridge = peripheral.wrap("right")
- tank = peripheral.wrap("iron_tank_valve_0")
- while true do
- local tableInfo = tank.getTanks("unknown")
- for k,v in pairs(tableInfo) do
- for x,y in pairs(v) do
- if x == "amount" then
- amount = y
- end
- if y == "Lava" then
- type = y
- end
- end
- end
- PW1 = P1.getStored()
- PW2 = P2.getStored()
- power = PW1 + PW2
- PC1 = P1.getCapacity()
- PC2 = P2.getCapacity()
- capacity = PC1 + PC2
- PUF = power / capacity * 100
- percent = math.floor(PUF)
- local function monitor()
- mon.clear()
- mon.setCursorPos(1,3)
- mon.write("Energy is: "..power.." Out of: "..capacity.."("..percent.."%"..")")
- mon.setCursorPos(1,5)
- mon.write("Tank is currently holding: "..type.."The amount is: "..amount)
- end
- local function bridgeD()
- bridge.clear()
- bridge.addText(1,12,"Energy is: "..power.." Out of: "..capacity.."("..percent.."%"..")",colors.magenta)
- end
- monitor()
- bridgeD()
- sleep(1)
- end
Advertisement
Add Comment
Please, Sign In to add comment