MrDj200

ReactorControl mk2

Mar 1st, 2015
305
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        = "up"
  2. local bundCable = "left"
  3. local capBanks  = 2
  4.  
  5.  
  6. ---------------------
  7.  
  8. e       = peripheral.wrap(energy)
  9. maxd = e.getMaxEnergyStored(energy)
  10. max = maxd * capBanks
  11.  
  12.  
  13.  
  14. function on()
  15.         rs.setBundledOutput(bundCable, colors.white)
  16. end
  17.        
  18. function off()
  19.         rs.setBundledOutput(bundCable, 0)
  20. end
  21.  
  22. on()
  23.  
  24. while true do
  25.         atm     = e.getEnergyStored(energy) * capBanks
  26.         while atm < max do
  27.                 atm     = e.getEnergyStored(energy) * capBanks
  28.                 sleep(0.1)
  29.                 shell.run("clear")
  30.                 print("Current Level: "..atm)
  31.                 print("Max Level: "..max)
  32.                 on()
  33.         end
  34.         off()
  35. end
Advertisement
Add Comment
Please, Sign In to add comment