Advertisement
Ubidibity

show-energycore

Jun 17th, 2021 (edited)
800
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -- modified to work with draconic rf storage (trying to determine actual 'gain' from reactor)
  2. local stabilizer = peripheral.wrap("right")
  3. local storage = peripheral.find("draconic_rf_storage")
  4. local monitor = peripheral.wrap("bottom")
  5.  
  6. term.redirect(monitor)
  7. local x=0
  8. local y=0
  9. while true do
  10.  
  11. monitor.clear()
  12.  
  13. --for key,value in pairs(storage) do
  14. --print("key: "..key..", value: "..value)
  15. --end
  16.  
  17. --for _,method in pairs(storage) do
  18. y=x
  19. x=storage.getEnergyStored()
  20. --end
  21. --local stabilizer = core.getReactorInfo()
  22.  
  23. --for _, method in pairs(stabilizer) do
  24. --print(method)
  25. --end
  26. print("              status: "..stabilizer.status)
  27. print("      generationRate: "..stabilizer.generationRate.." RF/t")
  28. print("         temperature: "..stabilizer.temperature)
  29. print("       fieldStrength: "..stabilizer.fieldStrength)
  30. print("    maxFieldStrength: "..stabilizer.maxFieldStrength)
  31. print("      fieldDrainRate: "..stabilizer.fieldDrainRate)
  32. print("Fuel Conversion Rate: "..stabilizer.fuelConversionRate.." nb/t")
  33. print("   maxFuelConversion: "..stabilizer.maxFuelConversion)
  34. local fuelConversionPercent=stabilizer.fuelConversion*100/stabilizer.maxFuelConversion
  35. print("      fuelConversion: "..stabilizer.fuelConversion.."("..fuelConversionPercent.."%)")
  36. local energySaturationPercent=stabilizer.energySaturation*100/stabilizer.maxEnergySaturation
  37. print("    energySaturation: "..stabilizer.energySaturation.."("..energySaturationPercent.."%)")
  38. print(" maxEnergySaturation: "..stabilizer.maxEnergySaturation)
  39. local fieldStrengthPercent=stabilizer.fieldStrength*100/stabilizer.maxFieldStrength
  40. print("      fieldStrength%: "..fieldStrengthPercent)
  41. print(" Energy Core Storage: "..x..", "..((((x-y)/1000/1000)/2)*20).."MRF/t"..", "..(x*100/2140000000000).."%")
  42.  
  43. if (fieldStrengthPercent<51 or energySaturationPercent<51) then
  44.  if it's < than some kill switch probably have it scram the reactor
  45.  redstone.setOutput("back", not redstone.getOutput("back"))
  46.  redstone.setOutput("top",false)
  47. end
  48. if (fieldStrengthPercent>51 and energySaturationPercent>51) then
  49.  redstone.setOutput("back",false)
  50.  redstone.setOutput("top",not redstone.getOutput("top"))
  51. end
  52. sleep(2)
  53. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement