Advertisement
SuperRavenSn1per

Big Reactor Monitor

Mar 24th, 2019
232
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.01 KB | None | 0 0
  1. --[[
  2. Big Reactors Reactor Monitor by SuperRavenSn1per
  3.  
  4. Before starting make sure you look inside of the file called "ReactorNumber" and change it to your reactor's number.
  5. ]]--
  6.  
  7. if not fs.exists("ReactorNumber") then
  8.   shell.run("pastebin get wG2RCdQc ReactorNumber")
  9. end
  10.  
  11. f = fs.open("ReactorNumber","r")
  12. reactorNum = f.readLine()
  13. f.close()
  14.  
  15. if peripheral.isPresent("BigReactors-Reactor_"..reactorNum) then
  16.   r = peripheral.wrap("BigReactors-Reactor_"..reactorNum)
  17. else
  18.   print("Reactor not found! Make sure you typed the right reactor number into the 'ReactorNumber' file!")
  19.   return
  20. end
  21.  
  22. txtColor = colors.lime
  23.  
  24. function getVals()
  25.   connected = r.getConnected()
  26.   active = r.getActive()
  27.   controlRodNum = r.getNumberOfControlRods()
  28.   energyStored = r.getEnergyStored()
  29.   fuelTemp = r.getFuelTemperature()
  30.   casingTemp = r.getCasingTemperature()
  31.   fuelAmount = r.getFuelAmount()
  32.   wasteAmount = r.getWasteAmount()
  33.   fuelMax = r.getFuelAmountMax()
  34.   rf = r.getEnergyProducedLastTick()
  35.   coolantAmount = r.getCoolantAmount()
  36.   coolantType = r.getCoolantType()
  37.   hotFluidAmount = r.getHotFluidAmount()
  38.   hotFluidType = r.getHotFluidType()
  39.   reactivity = r.getFuelReactivity()
  40. end
  41.  
  42. getVals()
  43.  
  44. function writeVal(txt, val, cp)
  45.   term.setCursorPos(1, cp)
  46.   write(txt)
  47.   term.setTextColor(txtColor)
  48.   write(val)
  49.   term.setTextColor(colors.white)
  50. end
  51.  
  52. while true do
  53.   sleep(0.1)
  54.   getVals()
  55.   if active ~= true then
  56.     term.clear()
  57.     term.setCursorPos(1,1)
  58.     term.setTextColor(colors.red)
  59.     print("Reactor isn't active")
  60.     term.setTextColor(colors.white)
  61.   else
  62.     term.clear()
  63.     term.setCursorPos(1,1)
  64.     term.setTextColor(colors.lime)
  65.     print("Reactor is active")
  66.     term.setTextColor(colors.white)
  67.     writeVal("RF/T...................", rf, 3)
  68.     writeVal("Fuel Temperature.......", fuelTemp, 4)
  69.     writeVal("Casing Temperature.....", casingTemp, 5)
  70.     writeVal("Fuel...................", fuelAmount, 6)
  71.     writeVal("Waste..................", wasteAmount, 7)
  72.   end
  73. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement