ravensniper72

RF Tools Power Display

Dec 11th, 2020 (edited)
514
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. local cell = peripheral.wrap("right")
  2. local mon = peripheral.wrap("top")
  3.  
  4. term.clear()
  5. term.setCursorPos(1,1)
  6. print("Displaying Power")
  7. mon.setTextScale(1)
  8.  
  9. while true do
  10.  
  11. local z = cell.getEnergy("unknown")
  12. local y = cell.getEnergyCapacity("unknown")
  13.  
  14. maxP = math.floor(y)
  15. nowP = math.floor(z)
  16.  
  17. mon.clear()
  18. mon.setCursorPos(1,1)
  19. mon.write("Current Power")
  20. mon.setCursorPos(1,2)
  21. mon.write(nowP)
  22. mon.setCursorPos(1,4)
  23. mon.write("Maximum Power")
  24. mon.setCursorPos(1,5)
  25. mon.write(maxP)
  26.  
  27. sleep()
  28. end
Add Comment
Please, Sign In to add comment