Advertisement
SmugTomato

Untitled

Mar 30th, 2025
16
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. local reactor = peripheral.find("BiggerReactors_Reactor")
  2.  
  3. if not reactor then
  4. print("Reactor not found!")
  5. return
  6. end
  7.  
  8. local apiVersion = reactor.apiVersion()
  9. local ambientTemp = reactor.ambientTemperature()
  10. local casingTemp = reactor.casingTemperature()
  11. local battery = reactor.battery()
  12. local capacity = battery.capacity()
  13. local stored = battery.stored()
  14. local percentage = (stored / capacity) * 100
  15.  
  16. print("Booting up ReactorControl...")
  17. sleep(0.1)
  18.  
  19. print("API version " .. apiVersion)
  20. sleep(0.1)
  21.  
  22. print("Ambient temperature " .. ambientTemp)
  23. sleep(0.1)
  24.  
  25. print("Casing temperature " .. casingTemp)
  26. sleep(0.1)
  27.  
  28. print("Energy stored: " .. stored .. "/" .. capacity .. "(" .. string.format("%.2f", percentage) .. "%)")
  29. sleep(0.1)
  30.  
  31. while true do
  32. if percentage < 50 then
  33. reactor.setActive(true)
  34. end
  35.  
  36. if percentage > 80 then
  37. reactor.setActive(false)
  38. end
  39.  
  40. sleep(0.5)
  41. end
  42.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement