Advertisement
PlatinKinggg

turbine_br.lua

May 29th, 2025 (edited)
661
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.54 KB | Gaming | 0 0
  1. -- Datei: turbine_br.lua
  2. -- Turbinenfunktionen für Big Reactors unter CC: Tweaked
  3.  
  4. local peripheral = peripheral
  5. local turbine = {}
  6.  
  7.  
  8. function turbine.getTurbines()
  9.     local turbinesCount = 0
  10.     local turbines = {}
  11.     local names = peripheral.getNames()
  12.  
  13.     for i = 1, #names do
  14.         local name = names[i]
  15.         if peripheral.getType(name) == "BigReactors-Turbine" then
  16.             table.insert(turbines, peripheral.wrap(name))
  17.             turbinesCount = turbinesCount + 1
  18.         end
  19.     end
  20.     return turbines
  21. end
  22.  
  23. function turbine.getTurbineInfo(t)
  24.     return {
  25.         active = t.getActive(),
  26.         connected = t.getConnected(),
  27.         assembled = t.getMultiblockAssembled(),
  28.         energyStored = t.getEnergyStored(),
  29.         energyCapacity = t.getEnergyCapacity(),
  30.         energyProducedLastTick = t.getEnergyProducedLastTick(),
  31.         fluidAmountMax = t.getFluidAmountMax(),
  32.         fluidFlowRate = t.getFluidFlowRate(),
  33.         fluidFlowRateMax = t.getFluidFlowRateMax(),
  34.         fluidFlowRateMaxMax = t.getFluidFlowRateMaxMax(),
  35.         inductorEngaged = t.getInductorEngaged(),
  36.         inputAmount = t.getInputAmount(),
  37.         inputType = t.getInputType(),
  38.         outputAmount = t.getOutputAmount(),
  39.         outputType = t.getOutputType(),
  40.         rotorSpeed = t.getRotorSpeed(),
  41.         bladeEfficiency = t.getBladeEfficiency(),
  42.         rotorMass = t.getRotorMass(),
  43.         numberOfBlades = t.getNumberOfBlades()
  44.     }
  45. end
  46.  
  47. function turbine.setActive(t, state)
  48.     t.setActive(state)
  49. end
  50.  
  51. function turbine.setInductorEngaged(t, state)
  52.     t.setInductorEngaged(state)
  53. end
  54.  
  55. function turbine.setFluidFlowRateMax(t, rate)
  56.     t.setFluidFlowRateMax(rate)
  57. end
  58.  
  59. return turbine
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement