theo33500

Untitled

Oct 7th, 2018
217
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. reactor = peripheral.wrap("left")
  2. m = peripheral.find("monitor")
  3.  
  4. function mclear()
  5. m.clear()
  6. m.setCursorPos(1,1)
  7. end
  8.  
  9. while true do
  10. energy = reactor.getEnergyStored()
  11. print("energy = "..energy)
  12. if energy < 8000000 then
  13. reactor.setActive(true)
  14. print("true")
  15. status = "true"
  16. else
  17. reactor.setActive(false)
  18. print("false")
  19. status = "false"
  20. end
  21. max = "10000000"
  22. pourcent1 = energy/max
  23. pourcent2 = pourcent1*cent
  24. mclear()
  25. m.write("energy = "..energy)
  26. m.setCursorPos(1,2)
  27. m.write(status)
  28. m.setCursorPos(1,3)
  29. m.write(pourcent2.."%")
  30. sleep(1)
  31. end
Advertisement
Add Comment
Please, Sign In to add comment