Inumel

Untitled

Oct 5th, 2013
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.61 KB | None | 0 0
  1. P1 = peripheral.wrap("batbox_7")
  2. P2 = peripheral.wrap("batbox_8")
  3. mon = peripheral.wrap("top")
  4. bridge = peripheral.wrap("right")
  5. PW1 = P1.getStored()
  6. PW2 = P2.getStored()
  7. power = PW1 + PW2
  8. PC1 = P1.getCapacity()
  9. PC2 = p2.getCapacity()
  10. capacity = PC1 + PC2
  11. percent = power / capacity * 100
  12. local function monitor()
  13.     mon.clear()
  14.     mon.setCursorPos(1,3)
  15.     mon.write("Energy is: "..power.."Out of: "..capacity.."("..percent.."%"..")")
  16. end
  17. local function bridgeD()
  18.     bridge.clear()
  19.     bridge.addText(1,12,"Energy is: "..power.."Out of: "..capacity.."("..percent.."%"..")",colors.magenta)
  20. end
  21. monitor()
  22. bridgeD()
Advertisement
Add Comment
Please, Sign In to add comment