Guest User

startup

a guest
Jan 9th, 2015
349
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. cell = peripheral.wrap("left")
  3.  
  4. actif = reactor.getActive()
  5. maxCell = cell.getMaxEnergy()
  6.  
  7. while true do
  8.  
  9.   energystore = cell.getStored()
  10.   level = (energystore*100)/maxCell
  11.  
  12.   if actif then
  13.     if level >= 90 then reactor.setActive(false) end
  14.   else
  15.     if level <= 5 then reactor.setActive(true) end
  16.   end
  17.  
  18.  
  19.   sleep(1)
  20. end
Advertisement
Add Comment
Please, Sign In to add comment