Advertisement
Florian86

get_reactor_online

Apr 4th, 2016
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.60 KB | None | 0 0
  1. while true do
  2.     shell.run("clear")
  3.  
  4.     local reactor
  5.     reactor = peripheral.wrap("back")
  6.     connected = reactor.getConnected()
  7.  
  8.     if connected == true then
  9.         status = reactor.getActive() -- true if reactor is on
  10.         if status == true then
  11.             print("reactor still online!")
  12.         else
  13.             print("reactor offline!")
  14.             print("take it online...")
  15.             reactor.setActive(true)
  16.             print("reactor should be online!")
  17.         end
  18.        
  19.         print("")
  20.         write("RF-stored: ")
  21.         write(reactor.getEnergyStored())
  22.         print("")
  23.         write("RF-production: ")
  24.         write(reactor. getEnergyProducedLastTick())
  25.         print("")
  26.     end
  27.     sleep(10)
  28. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement