nicx321

Energy

Apr 30th, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.37 KB | None | 0 0
  1. local glas = peripheral.wrap("right")
  2. local wrap = peripheral.wrap("top")
  3. while true do
  4. glas.addBox(1,1,80,10,0,0.2)
  5. local energie = wrap.getEnergyStored()
  6. local max = wrap.getMaxEnergyStored()
  7. local p = (energie/max)*100
  8. glas.addText(5,2,"Bat: " .. p .. "%",0x00FF00)
  9. print(p,"%")
  10. glas.sync()
  11. os.sleep(0.1)
  12. glas.clear()
  13. term.clear()
  14. term.setCursorPos(1,1)
  15. end
Add Comment
Please, Sign In to add comment