Advertisement
Guest User

startup

a guest
May 22nd, 2015
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.35 KB | None | 0 0
  1. local oReactor = peripheral.wrap("back")
  2. local oCell = peripheral.wrap("bottom")
  3. local iEnergy
  4. local lPurcent
  5.  
  6. while 1 do
  7.  
  8.   iEnergy = oCell.getEnergyStored()
  9.   lPurcent = iEnergy*100/80000000
  10.   print(lPurcent)
  11.   if lPurcent > 90 then
  12.     oReactor.setActive(false)
  13.   end
  14.   if lPurcent < 10 then
  15.     oReactor.setActive(true)
  16.   end
  17.   sleep(1)
  18. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement