Advertisement
TheProdigyTM

mekanism fusion reactor script

Sep 19th, 2023 (edited)
1,009
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.02 KB | Gaming | 0 0
  1. -- Importing required APIs
  2. local peripheral = require("peripheral")
  3.  
  4. -- Define the side of the fusion reactor you want to monitor
  5. local fusionReactorSide = "top" -- Replace with the side where your reactor is connected
  6.  
  7. -- Function to get the DT fuel being used in millibuckets per tick
  8. local function getDTFuelUsage()
  9.     local fusionReactor = peripheral.find("mekanism:fusion_reactor")
  10.     return fusionReactor.getDeuteriumTritiumFuelInjectionRate(fusionReactorSide)
  11. end
  12.  
  13. -- Function to get the current power output
  14. local function getPowerOutput()
  15.     local fusionReactor = peripheral.find("mekanism:fusion_reactor")
  16.     return fusionReactor.getEnergyProducedLastTick(fusionReactorSide)
  17. end
  18.  
  19. -- Main loop to continuously update the display
  20. while true do
  21.     local dtFuelUsage = getDTFuelUsage()
  22.     local powerOutput = getPowerOutput()
  23.  
  24.     print("DT Fuel Usage: " .. dtFuelUsage .. " mB/t")
  25.     print("Power Output: " .. powerOutput .. " RF/t")
  26.  
  27.     os.sleep(1) -- Adjust the sleep duration as per your requirements
  28. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement