MrDj200

ReactorControl

Mar 28th, 2014
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.50 KB | None | 0 0
  1. local energy    = "bottom"
  2. local bundCable = "right"
  3.  
  4.  
  5. ---------------------
  6.  
  7. e   = peripheral.wrap(energy)
  8. max = e.getMaxEnergyStored(energy)
  9.  
  10.  
  11. function on()
  12.     rs.setBundledOutput(bundCable, colors.white)
  13. end
  14.    
  15. function off()
  16.     rs.setBundledOutput(bundCable, 0)
  17. end
  18.  
  19. on()
  20.  
  21. while true do
  22.     atm = e.getEnergyStored(energy)
  23.     while atm < max do
  24.         atm = e.getEnergyStored(energy)
  25.         sleep(0.1)
  26.         shell.run("clear")
  27.         print("Current Level: "..atm)
  28.         print("Max Level: "..max)
  29.         on()
  30.     end
  31.     off()
  32. end
Advertisement
Add Comment
Please, Sign In to add comment