Advertisement
Guest User

startup

a guest
Apr 26th, 2015
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.58 KB | None | 0 0
  1.  
  2. rednet.open("top")
  3.  
  4. r = peripheral.wrap("BigReactors-Reactor_1")
  5. t = peripheral.wrap("bottom")
  6.  
  7. rednet.open("back")
  8. m = peripheral.wrap("back")
  9.  
  10.  
  11. repeat
  12.   active = r.getActive()
  13.   level = (t.getEnergyStored() / 1000000) * 100
  14.  
  15.   level = math.floor(level + 0.5)
  16.            
  17.   print(active)
  18.   print(level)
  19.  
  20.   if active == true and level >= 85 then
  21.     r.setActive(false)
  22.   end    
  23.  
  24.   if active == false and level <= 15 then
  25.     r.setActive(true)
  26.   end
  27.  
  28.   m.transmit(0xBEEF, 0xBEEF, active)
  29.   m.transmit(0xBEF0, 0xBEF0, level)
  30.      
  31.   os.sleep(3)
  32.  
  33.  
  34. until false
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement