Advertisement
Guest User

startup

a guest
Nov 25th, 2015
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.47 KB | None | 0 0
  1. reactor = peripheral.wrap("top")
  2. cube = peripheral.wrap("bottom")
  3.  
  4. actif = reactor.getActive()
  5. maxCube = cube.getMaxEnergy()
  6. while true do
  7. print("- Current Energy:")
  8. print(energystore)
  9.  
  10.         energystore = cube.getStored()
  11.         level = (energystore*100)/maxCube
  12.        
  13.         if actif then
  14.                 if level >= 90 then reactor.setActive(false) end
  15.          else
  16.                 if level <= 20 then reactor.setActive(true) end
  17.         end
  18.  sleep(1)
  19. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement