Advertisement
colhaydutu

reactortest

Oct 7th, 2023 (edited)
31
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. -- Specify the modem side and monitor side
  2. local modemSide = "back"
  3. local monitorSide = "right"
  4.  
  5. -- Define the modem and monitor
  6. local modem = peripheral.wrap(modemSide)
  7. local monitor = peripheral.wrap(monitorSide)
  8.  
  9. -- Wrap the IC2 nuclear reactor directly using its known name
  10. local reactor = peripheral.wrap("ic2:nuclear_reactor_20")
  11.  
  12. -- Main loop
  13. while true do
  14. -- Clear the monitor
  15. monitor.clear()
  16. monitor.setCursorPos(1, 1)
  17.  
  18. -- Read reactor information
  19. local currentHeat = reactor.getHeat()
  20. local euOutput = reactor.getEUOutput()
  21. local euStored = reactor.getEUCapacity()
  22.  
  23. monitor.write("Reactor Temperature: " .. currentHeat)
  24. monitor.setCursorPos(1, 2)
  25. monitor.write("Generated Energy: " .. euOutput .. " EU/t")
  26. monitor.setCursorPos(1, 3)
  27. monitor.write("EU Storage Capacity: " .. euStored .. " EU")
  28.  
  29. -- Sleep duration (in seconds)
  30. os.sleep(1)
  31. end
  32.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement