Advertisement
Guest User

cube

a guest
Aug 3rd, 2015
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.79 KB | None | 0 0
  1. cube = peripheral.wrap("back")
  2. mon = peripheral.wrap("top")
  3. mon.clear()
  4. mon.setBackgroundColor(colors.blue)
  5.  
  6. while true do
  7. energy = cube.getEnergyStored() / 2500000
  8. cap = cube.getMaxEnergy() / 2500000
  9. capacity = cube.getMaxEnergy() / 2500000000000
  10. ene = string.sub(energy/1000,0,7)
  11. mon.setCursorPos(1,1)
  12. mon.clearLine()
  13. mon.write("Energy stored: " .. ene .. "GRF")
  14. mon.setCursorPos(1,2)
  15. mon.clearLine()
  16. mon.write("Capacity: " .. capacity .. "TRF")
  17. mon.setCursorPos(1,3)
  18. mon.clearLine()
  19. percent = energy/cap*100
  20. mon.write("Percent: " .. string.sub(percent,0,5) .. "%")
  21. mon.setCursorPos(1,4)
  22. mon.clearLine()
  23. mon.write("Input: " .. cube.getLastInput()/2500 .. "KRF")
  24. mon.setCursorPos(1,5)
  25. mon.clearLine()
  26. mon.write("Output: " .. cube.getLastOutput()/2500 .. "KRF")
  27. sleep(0.45)
  28. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement