Advertisement
Guest User

reactor

a guest
Sep 1st, 2015
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.82 KB | None | 0 0
  1. c = peripheral.find('tile_blockcapacitorbank_name')
  2. r = peripheral.find('BigReactors-Reactor')
  3. m = peripheral.find('monitor')
  4.  
  5. function online()
  6.   on = r.getActive()
  7.   if on == true then
  8.     acc = 'Online'
  9.   else
  10.     acc = 'Offline'
  11.   end
  12.   return acc
  13. end
  14.    
  15.  
  16. while true do
  17.   storedEn = c.getEnergyStored()
  18.   maxEn = c.getMaxEnergyStored()
  19.   perc = math.floor(storedEn / maxEn * 100)
  20.   r.setAllControlRodLevels(perc)
  21.   cont = r.getControlRodLevel(1)
  22.   out = r.getEnergyProducedLastTick()
  23.   print(perc)
  24.  
  25.  
  26.   online()
  27.   m.clear()
  28.   m.setCursorPos(1,1)
  29.   m.write('Energy Stored: '..storedEn)
  30.   m.setCursorPos(1,2)
  31.   m.write('The Reactor is '..acc)
  32.   m.setCursorPos(1,3)
  33.   m.write('Control Rods are '..cont..'% inserted')
  34.   m.setCursorPos(1,4)
  35.   m.write(out..' RF produced')
  36.   sleep(1)
  37.  
  38. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement