Advertisement
AsFly__

ReactorDraconic

Aug 6th, 2022 (edited)
868
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.35 KB | None
  1. local Rea = peripheral.wrap("draconic_reactor_2")
  2. local Gate = peripheral.wrap("flow_gate_1")
  3.  
  4. local function update()
  5.     while true do
  6.         term.clear()
  7.         local ReaInfo = Rea.getReactorInfo()
  8.         local ReaGeneration = ReaInfo.generationRate
  9.         local ReaTemperature = ReaInfo.temperature
  10.         local ReaShield = ReaInfo.fieldStrength
  11.         local ReaSaturation = ReaInfo.energySaturation
  12.         local ReaFuel = ReaInfo.fuelConversion
  13.         local ReaStop = Rea.stopReactor
  14.         local stop = 1
  15.  
  16.         if ReaTemperature >= 7900.00 then
  17.             stop = 0
  18.             print(ReaTemperature)
  19.         elseif ReaShield <= 28000000 then
  20.             stop = 0
  21.             print(ReaShield)
  22.         elseif ReaFuel >= 10300.00 then
  23.             stop = 0
  24.             print(ReaFuel)
  25.         end
  26.  
  27.         if stop == 0 then
  28.             ReaStop()
  29.         elseif ReaTemperature > 7600 then
  30.             ReaGeneration = ReaGeneration -300000
  31.             Gate.setSignalLowFlow(ReaGeneration)
  32.             print("La prod diminue !")
  33.         elseif ReaTemperature < 7600 then
  34.             ReaGeneration = ReaGeneration +1000
  35.             Gate.setSignalLowFlow(ReaGeneration)
  36.             print("La prod augment !")
  37.         else
  38.             print("Pas de changement !")
  39.         end
  40.        
  41.         os.sleep(0.025)
  42.  
  43.     end
  44. end
  45.  
  46. update()
Advertisement
RAW Paste Data Copied
Advertisement