systox

Turbine

May 12th, 2017
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.01 KB | None | 0 0
  1. local turbine_1
  2. local mon_1
  3.  
  4. turbine_1 = peripheral.wrap("BigReactors-Turbine_0")
  5. mon_1 = peripheral.wrap("monitor_0")
  6.  
  7. mon_1.clear()
  8. mon_1.setCursorPos(1,1)
  9.  
  10. while true do
  11.  
  12. mon_1.write("Status:         ")
  13.  
  14.  if turbine_1.getActive() == true then
  15.  if turbine_1.getRotorSpeed() < 1700 == true then
  16.  mon_1.write("Startet")
  17.  turbine_1.setFluidFlowRateMax(2000)
  18.  turbine_1.setInductorEngaged(false)
  19.  else
  20.  
  21.  if turbine_1.getFluidFlowRateMax() == 0 == true then
  22.  mon_1.write("Ideling")
  23.  else
  24.  mon_1.write("Aktiviert")
  25.  turbine_1.setInductorEngaged(true)
  26.  end
  27.  end
  28.  else
  29.  mon_1.write("De-Akiviert")
  30.  turbine_1.setFluidFlowRateMax(2000)
  31.  if turbine_1.getEnergyStored() < 990000 == true then
  32.  turbine_1.setInductorEngaged(true)
  33.  end
  34.  end
  35.  
  36.  
  37.  
  38. if turbine_1.getEnergyStored() > 800000 == true then
  39.   if turbine_1.getRotorSpeed() < 1800 == true then
  40.    turbine_1.setInductorEngaged(false)
  41.    else
  42.     if turbine_1.getEnergyStored() == 1000000 == false then
  43.     turbine_1.setInductorEngaged(true)
  44.     else
  45.     turbine_1.setInductorEngaged(false)
  46.     turbine_1.setFluidFlowRateMax(700)
  47.    end
  48.  end
  49.  else
  50.  turbine_1.setActive(true)
  51. end
  52.  
  53.  
  54. if turbine_1.getEnergyStored() > 800000 == true then
  55. turbine_1.setVentAll()
  56. mon_1.setCursorPos(1,2)
  57. mon_1.write("Ventil:         ")
  58. mon_1.write("Alles")
  59. elseif turbine_1.getActive() == true then
  60.   if turbine_1.getRotorSpeed() < 1700 == true then
  61.     turbine_1.setVentAll()
  62.     mon_1.setCursorPos(1,2)
  63.     mon_1.write("Ventil:         ")
  64.     mon_1.write("Alles")
  65.     else
  66.     mon_1.setCursorPos(1,2)
  67.     turbine_1.setVentAll()
  68.     mon_1.write("Ventil:         ")
  69.     mon_1.write("Alles")
  70.   end
  71. else
  72. turbine_1.setVentNone()
  73. mon_1.setCursorPos(1,2)
  74. mon_1.write("Ventil:         ")
  75. mon_1.write("Nichts")
  76. end
  77.  
  78. mon_1.setCursorPos(1,3)
  79. mon_1.write("Energie:        ")
  80. mon_1.write(math.floor(turbine_1.getEnergyProducedLastTick()))
  81. mon_1.write(" RF/t")
  82.  
  83. mon_1.setCursorPos(1,4)
  84. mon_1.write("Energie-Buffer: ")
  85. mon_1.write(math.floor(turbine_1.getEnergyStored()))
  86. mon_1.write(" RF")
  87.  
  88. mon_1.setCursorPos(1,5)
  89. mon_1.write("Rotor-Speed:    ")
  90. mon_1.write(math.floor(turbine_1.getRotorSpeed()))
  91. mon_1.write(" RPM")
  92.  
  93. mon_1.setCursorPos(1,6)
  94. mon_1.write("Rate:           ")
  95. mon_1.write(turbine_1.getFluidFlowRateMax())
  96. mon_1.write(" mb")
  97.  
  98. mon_1.setCursorPos(1,7)
  99. mon_1.write("Coils:          ")
  100. if turbine_1.getInductorEngaged() == false then
  101. mon_1.write("Aus")
  102. else
  103. mon_1.write("An")
  104. end
  105.  
  106.  
  107. if turbine_1.getRotorSpeed() > 1801 == true then
  108. mon_1.setCursorPos(1,19)
  109. mon_1.write("Senkt RPM ...")
  110. turbine_1.setVentNone()
  111. turbine_1.setFluidFlowRateMax(1000)
  112. else
  113. turbine_1.setVentOverflow()
  114. end
  115.  
  116. if turbine_1.getEnergyStored() == 1000000 == true then
  117. turbine_1.setFluidFlowRateMax(0)
  118. else
  119. turbine_1.setFluidFlowRateMax(1020)
  120. end
  121.  
  122. if turbine_1.getRotorSpeed() < 1800 == true then
  123. if turbine_1.getRotorSpeed() > 1700 == true then
  124. turbine_1.setFluidFlowRateMax(1850)
  125. else
  126. turbine_1.setFluidFlowRateMax(2000)
  127. end
  128. end
  129.  
  130. sleep(0.1)
  131. mon_1.clear()
  132. mon_1.setCursorPos(1,1)
  133. end
Add Comment
Please, Sign In to add comment