Advertisement
Guest User

startup

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