MrDj200

ReactorControll Mk3

Jan 17th, 2016
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.71 KB | None | 0 0
  1. local energy        = "left"
  2. local capBanks  = 1
  3. local reactor = "back"
  4.  
  5.  
  6. ---------------------
  7.  
  8. r = peripheral.wrap(reactor)
  9.    
  10. e       = peripheral.wrap(energy)
  11. maxd = e.getMaxEnergyStored()
  12. max = maxd * capBanks
  13.  
  14.  
  15.  
  16. function on()
  17.         r.setActive(true)
  18. end
  19.        
  20. function off()
  21.         r.setActive(false)
  22. end
  23.  
  24. on()
  25.  
  26. while true do
  27.         atm     = e.getEnergyStored(energy) * capBanks
  28.         while atm < max do
  29.                 atm     = e.getEnergyStored(energy) * capBanks
  30.                 sleep(0.1)
  31.                 shell.run("clear")
  32.                 print("Current Level: "..atm)
  33.                 print("Max Level: "..max)
  34.                 on()
  35.         end
  36.         off()
  37. end
Advertisement
Add Comment
Please, Sign In to add comment