Advertisement
RLPGhost

big reactor base control

Dec 25th, 2015
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.60 KB | None | 0 0
  1. local p = peripheral.wrap("BigReactors-Reactor_0")
  2. local mon = peripheral.wrap("left")
  3. while true do
  4.  
  5. term.clear()
  6. term.setCursorPos(1,1)
  7.  
  8. mon.clear()
  9. mon.setTextColor(colors.white)
  10. mon.setCursorPos(1,1)
  11. mon.write("Information:")
  12.  
  13. energy = p.getEnergyStored()
  14. percent = math.floor(energy/100000)
  15. print("Remplissage: "..percent.."%")
  16.  
  17. mon.setCursorPos(1,3)
  18. mon.write("Remplissage: ")
  19. mon.setTextColor(colors.red)
  20. mon.write(percent)
  21. mon.setTextColor(colors.white)
  22. mon.write(" %")
  23.  
  24. if percent < 30 then
  25. p.setActive(true)
  26. end
  27.  
  28. if percent > 60 then
  29. p.setActive(false)
  30. end
  31.  
  32. sleep(2)
  33. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement