Advertisement
ee_ingo

Reactor Monitor test

Feb 11th, 2023
1,184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.64 KB | None | 0 0
  1. local reactor = peripheral.wrap("right")
  2. local mon = peripheral.wrap("monitor_0")
  3. while true do
  4. mon.clear()
  5. local active = reactor.isActive()
  6. local heat = reactor.getHeat()
  7. local maxheat = reactor.getMaxHeat()
  8. local output = reactor.getEUOutput()
  9. mon.setCursorPos(1,1)
  10. mon.setTextScale(0.5)
  11. mon.setTextColor(colors.white)
  12. mon.write("Status:")
  13. if active then
  14.   mon.setTextColor(colors.lime)
  15.   mon.write (" Online")
  16. else
  17.   mon.setTextColor(colors.red)
  18.   mon.write(" Offline")
  19. end
  20. mon.setCursorPos(1,2)
  21. mon.setTextColor(colors.white)
  22. mon.write("Heat: ")
  23. if heat < 3000 then
  24.   mon.setTextColor(colors.blue)
  25.   mon.write(heat)
  26.   mon.setTextColor(colors.white)
  27.   mon.write("/" .. maxheat)
  28. elseif heat > 3000 and heat < 6000 then
  29.   mon.setTextColor(colors.yellow)
  30.   mon.write(heat)
  31.   mon.setTextColor(colors.white)
  32.   mon.write("/" .. maxheat)
  33. elseif heat > 6000 then
  34.   mon.setTextColor(colors.red)
  35.   mon.write(heat)
  36.   mon.setTextColor(colors.white)
  37.   mon.write("/" .. maxheat)
  38.   redstone.setOutput("bottom", true)
  39. else
  40.   mon.setTextColor(colors.gray)
  41.   mon.write("Error")
  42.   mon.setTextColor(colors.white)
  43.   mon.write("/" .. maxheat)
  44. end
  45. mon.setCursorPos(1,3)
  46. mon.setTextColor(colors.white)
  47. mon.write("*Output: ")
  48. if output < 20 then
  49.   mon.setTextColor(colors.red)
  50.   mon.write(output)
  51. elseif output > 20 then
  52.   mon.setTextColor(colors.lime)
  53.   mon.write(output)
  54. end
  55. mon.setCursorPos(1,4)
  56. mon.setTextColor(colors.white)
  57. mon.write("Last updated: ".. os.time())
  58. mon.setCursorPos(1,24)
  59. mon.write("*Power readings may not be correct. Still a WIP.")
  60. term.clear()
  61. term.setCursorPos(1,1)
  62. print("Securian Corporations INC")
  63. sleep(5)
  64. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement