Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Big reactors turbine program: Set rpm a little lower than your turbine optimun rpm
- local turbine = peripheral.wrap("BigReactors-Turbine_0")
- local mon = peripheral.wrap("top")
- local rpm = 1775
- local autocoil = 1
- local x = 0
- local y = 0
- local function main()
- while true do
- mon.clear()
- mon.setCursorPos(1,1)
- mon.setTextColor(colors.white)
- mon.write("Active:")
- if turbine.getActive() then
- mon.setBackgroundColor(colors.green)
- mon.write(" True")
- else
- mon.setBackgroundColor(colors.red)
- mon.setTextColor(colors.black)
- mon.write(" False")
- end
- mon.setBackgroundColor(colors.black)
- mon.setCursorPos(1,2)
- mon.setTextColor(colors.white)
- mon.write("Coils engaged:")
- if turbine.getInductorEngaged() then
- mon.setBackgroundColor(colors.green)
- mon.write(" True")
- else
- mon.setBackgroundColor(colors.red)
- mon.setTextColor(colors.black)
- mon.write(" False")
- end
- mon.setBackgroundColor(colors.black)
- mon.setCursorPos(1,3)
- mon.setTextColor(colors.white)
- mon.write("RF/t: ")
- mon.setTextColor(colors.lime)
- mon.write(math.floor(turbine.getEnergyProducedLastTick()))
- mon.setCursorPos(1,4)
- mon.setTextColor(colors.white)
- mon.write("RF Stored: ")
- mon.setTextColor(colors.lime)
- mon.write(math.floor(turbine.getEnergyStored()))
- mon.setCursorPos(1,5)
- mon.setTextColor(colors.white)
- mon.write("Rotor Speed: ")
- mon.setTextColor(colors.lime)
- mon.write(tostring(turbine.getRotorSpeed()))
- mon.write(" RPM")
- mon.setCursorPos(1,6)
- mon.setTextColor(colors.white)
- mon.write("Steam flow: ")
- mon.setTextColor(colors.lime)
- mon.write(turbine.getFluidFlowRate())
- mon.write(" mB/t")
- mon.setCursorPos(1,7)
- mon.setTextColor(colors.white)
- mon.write("Max flow: ")
- mon.setTextColor(colors.lime)
- mon.write(turbine.getFluidFlowRateMax())
- mon.write(" mB/t")
- mon.setCursorPos(1,8)
- mon.setTextColor(colors.white)
- mon.write("Auto-coil:")
- if autocoil == 1 then
- mon.setBackgroundColor(colors.green)
- mon.write(" True")
- if turbine.getRotorSpeed() < rpm and turbine.getActive() then
- turbine.setInductorEngaged(false)
- else
- if not turbine.getInductorEngaged() then
- turbine.setInductorEngaged(true)
- end
- end
- else
- mon.setBackgroundColor(colors.red)
- mon.setTextColor(colors.black)
- mon.write(" False")
- end
- mon.setBackgroundColor(colors.black)
- if (x >= 8) and (x <= 13) and (y == 1) then
- if turbine.getActive() then
- turbine.setActive(false)
- else
- turbine.setActive(true)
- end
- x = 0
- y = 0
- end
- if x >= 15 and x <= 20 and y == 2 then
- if autocoil == 0 then
- if turbine.getInductorEngaged() then
- turbine.setInductorEngaged(false)
- else
- turbine.setInductorEngaged(true)
- end
- end
- x = 0
- y = 0
- end
- if x >= 11 and x <= 16 and y == 8 then
- if autocoil == 1 then
- autocoil = 0
- else
- autocoil = 1
- end
- x = 0
- y = 0
- end
- sleep(1)
- end
- end
- local function touch()
- while true do
- _, _, x, y = os.pullEvent("monitor_touch")
- end
- end
- parallel.waitForAny(main,touch)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement