Guest User

startup

a guest
Jan 14th, 2017
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.13 KB | None | 0 0
  1. touchbar = peripheral.wrap("monitor_3")
  2. sec = peripheral.wrap("monitor_4")
  3. mon = peripheral.wrap("monitor_5")
  4.  
  5. reactor = peripheral.wrap("BigReactors-Reactor_1")
  6.  
  7. local on = true
  8. local reactor_on
  9. local reactor_capacity = 10000000
  10. local reactor_stored
  11. local energy_output
  12. local i = 0
  13.  
  14. oldTerm = term.redirect(touchbar)
  15. term.clear()
  16. paintutils.drawPixel(0,0,colors.black)
  17. term.clear()
  18. term.redirect(oldTerm)
  19.  
  20. oldTerm = term.redirect(mon)
  21. term.clear()
  22. paintutils.drawPixel(0,0,colors.black)
  23. term.clear()
  24. term.redirect(oldTerm)
  25.  
  26.  
  27. oldTerm = term.redirect(sec)
  28. term.clear()
  29. term.setCursorPos(1,1)
  30. textutils.slowPrint("--------------------------------------------")
  31. sleep(1)
  32. term.clear()
  33. term.redirect(oldTerm)
  34.  
  35. parallel.waitForAny(draw_reactor_off,output)
  36.  
  37. local function getReactorStats()
  38. reactor_on = reactor.getActive()
  39. energy_output = reactor.getEnergyProducedLastTick()
  40. reactor_stored = reactor.getEnergyStored()
  41. end
  42.  
  43. local function output()
  44. while i == 0 do
  45. sec.clear()
  46. getReactorStats()
  47. sec.write(energy_output.."RF/Tick")
  48. end
  49. end
  50.  
  51. local function draw_reactor_off()
  52. oldTerm = term.redirect(mon)
  53. paintutils.drawPixel(0,0,colors.black)
  54. term.clear()
  55. paintutils.drawBox(31,3,48,17,colors.gray)
  56. paintutils.drawFilledBox(33,5,37,15,colors.gray)
  57. paintutils.drawFilledBox(42,5,46,15,colors.gray)
  58. paintutils.drawLine(39,4,39,16,colors.gray)
  59. paintutils.drawLine(40,4,40,16,colors.gray)
  60. term.redirect(oldTerm)
  61. end
  62.  
  63. local function draw_reactor_on()
  64. oldTerm = term.redirect(mon)
  65. paintutils.drawPixel(0,0,colors.black)
  66. term.clear()
  67. paintutils.drawBox(31,3,48,17,colors.white)
  68. paintutils.drawFilledBox(33,5,37,15,colors.blue)
  69. paintutils.drawFilledBox(42,5,46,15,colors.blue)
  70. paintutils.drawLine(39,4,39,16,colors.yellow)
  71. paintutils.drawLine(40,4,40,16,colors.yellow)
  72. y2 = reactor.getFuelAmount()/reactor.getFuelAmountMax()
  73. if y2 <= 1 and y2 >= 0.95 then
  74.  sleep(1)
  75. elseif y2 <= 0.1 then
  76. paintutils.drawLine(39,4,39,16,colors.red)
  77. paintutils.drawLine(40,4,40,16,colors.red)
  78. else
  79. y2 = y2 * 12 + 4
  80. paintutils.drawLine(39,4,39,y2,colors.red)
  81. paintutils.drawLine(40,4,40,y2,colors.red)
  82. end
  83.  
  84. term.redirect(oldTerm)
  85. end
Advertisement
Add Comment
Please, Sign In to add comment