Advertisement
ETvd

Powah Reactor Mon

Jun 21st, 2025 (edited)
389
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.49 KB | None | 0 0
  1. local monitor = peripheral.find("monitor")
  2. local reactor = peripheral.wrap("uraninite_reactor_0") -- your actual reactor name
  3.  
  4. -- Safety checks
  5. if not monitor then
  6.     print("Monitor not found!")
  7.     return
  8. end
  9.  
  10. if not reactor then
  11.     print("Reactor not found!")
  12.     return
  13. end
  14.  
  15. monitor.setTextScale(0.5)
  16. monitor.setBackgroundColor(colors.black)
  17. monitor.setTextColor(colors.white)
  18.  
  19. local function writeLine(y, text)
  20.     monitor.setCursorPos(1, y)
  21.     monitor.write(text)
  22. end
  23.  
  24. while true do
  25.     local energy = reactor.getStoredEnergy() or 0
  26.     local max = 80000000 -- replace with actual capacity if needed
  27.     local percent = (energy / max) * 100
  28.  
  29.     local status = reactor.getStatus and reactor.getStatus() or "Unknown"
  30.     local efficiency = reactor.getEfficiency and reactor.getEfficiency() or 0
  31.     local input = reactor.getLastInput and reactor.getLastInput() or 0
  32.     local output = reactor.getLastOutput and reactor.getLastOutput() or 0
  33.  
  34.     monitor.clear()
  35.     writeLine(1, "=== POWAH REACTOR STATUS ===")
  36.     writeLine(3, string.format("Stored: %.2f MFE", energy / 1e6))
  37.     writeLine(4, string.format("Capacity: %.2f MFE", max / 1e6))
  38.     writeLine(5, string.format("Fullness: %.1f%%", percent))
  39.     writeLine(6, string.format("Status: %s", status))
  40.     writeLine(7, string.format("Efficiency: %.2f%%", efficiency * 100))
  41.     writeLine(8, string.format("Input: %.2f FE/t", input))
  42.     writeLine(9, string.format("Output: %.2f FE/t", output))
  43.  
  44.     os.sleep(1)
  45. end
  46.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement