Advertisement
CptEpic

BigReactor

Feb 19th, 2017
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.19 KB | None | 0 0
  1. local m = peripheral.wrap('monitor_0')
  2. local r = peripheral.wrap('BigReactors-Reactor_0')
  3. local oldTerm = term.redirect(m)
  4.  
  5. term.redirect(m)
  6.  
  7. m.setTextScale(1)
  8. m.setCursorPos(1, 1)
  9. m.setBackgroundColor(colors.black)
  10. m.clear()
  11.  
  12. function draw()
  13.     m.setCursorPos(5, 2)
  14.     if(r.getActive()) then
  15.         m.setTextColor(colors.green)
  16.         print('ACTIVE')
  17.     else
  18.         m.setTextColor(colors.red)
  19.         print('INACTIVE')
  20.     end
  21.  
  22.     m.setTextColor(colors.white)
  23.  
  24.     m.setCursorPos(5, 4)
  25.     print('ENERGY')
  26.     energybar = (46 / 10000000) * r.getEnergyStored()
  27.     m.setCursorPos(15, 4)
  28.     print(math.ceil(energybar/0.46))
  29.     paintutils.drawLine(5, 5, 46, 5, colors.gray)
  30.     paintutils.drawLine(5, 5, energybar, 5, colors.green)
  31.     m.setBackgroundColor(colors.black)
  32.  
  33.     m.setCursorPos(5, 7)
  34.     print('FUEL')
  35.     fuelbar = (46 / r.getFuelAmountMax()) * r.getFuelAmount()
  36.     m.setCursorPos(15, 7)
  37.     print(math.ceil(fuelbar/0.46))
  38.     paintutils.drawLine(5, 8, 46, 8, colors.gray)
  39.     paintutils.drawLine(5, 8, fuelbar , 8, colors.green)
  40.     m.setBackgroundColor(colors.black)
  41.  
  42.     m.setCursorPos(5, 10)
  43.     print('RF/TICK')
  44.     m.setCursorPos(5, 11)
  45.     print(r.getEnergyProducedLastTick())
  46. end
  47.  
  48. while true do
  49.     sleep(0)
  50.     draw()
  51. end
  52.  
  53. term.redirect(oldTerm)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement