Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- reactorA = peripheral.wrap("BigReactors-Reactor_16")
- turbineA = peripheral.wrap("BigReactors-Turbine_8")
- reactorB = peripheral.wrap("BigReactors-Reactor_17")
- reactorC = peripheral.wrap("BigReactors-Reactor_18")
- reactorD = peripheral.wrap("BigReactors-Reactor_19")
- reactorE = peripheral.wrap("BigReactors-Reactor_20")
- reactorF = peripheral.wrap("BigReactors-Reactor_21")
- turbineB = peripheral.wrap("BigReactors-Turbine_7")
- turbineC = peripheral.wrap("BigReactors-Turbine_9")
- turbineD = peripheral.wrap("BigReactors-Turbine_10")
- turbineE = peripheral.wrap("BigReactors-Turbine_11")
- turbineF = peripheral.wrap("BigReactors-Turbine_12")
- me = peripheral.wrap("tilecontroller_0")
- --reactor.setAllControlRodLevels(60)
- ad = false
- function inp()
- --32768, 128, 1, 2048
- input = rs.getBundledInput("left")
- --if input ~= 0 then
- --print(input)
- --end
- if input >= 32768 then
- a = true
- input = input - 32768
- else
- a = false
- end
- --if input >= 2048 then
- --d = true
- --input = input - 2048
- --else
- --d = true
- --end
- if input >= 128 then
- b = true
- input = input - 128
- else
- b = false
- end
- if input >= 1 then
- c = true
- else
- c = false
- end
- end
- function check()
- print(input)
- print(a)
- print(b)
- print(c)
- end
- function relay()
- t = 0
- if a == true then
- t = t + 1
- end
- if b == true then
- t = t + 2
- end
- if c == true then
- t = t + 4
- end
- --if d == true then
- --t = t + 8
- --end
- print("out: "..t)
- rs.setBundledOutput("right",t)
- end
- function autoAdjust(button,reactor)
- if button == true and state ~= false then
- --if reactor.getEnergyStored() < 8000000 then
- if reactor.getHotFluidAmount() < 6500 and reactor.getCoolantAmount() > 3000 then
- reactor.setActive(true)
- ad = true
- else
- reactor.setActive(false)
- ad = false
- end
- --if reactor.getFuelTemperature() < 1600 then
- -- reactor.setActive(true)
- --end
- end
- end
- function turbAdjust(button,turbine)
- if button == true then
- if turbine.getRotorSpeed() > 1850 then
- turbine.setActive(false)
- elseif turbine.getRotorSpeed() < 1800 then
- turbine.setActive(true)
- end
- if turbine.getRotorSpeed() < 1800 and turbine.getRotorSpeed() > 220 then
- turbine.setInductorEngaged(false)
- else
- turbine.setInductorEngaged(true)
- end
- if turbine.getEnergyStored() > 980000 then
- turbine.setInductorEngaged(false)
- end
- end
- end
- function power(button,reactor)
- if button == true and state ~= true then
- reactor.setActive(true)
- state = true
- elseif button == false and state ~= false then
- reactor.setActive(false)
- state = false
- end
- end
- while true do
- inp()
- check()
- relay()
- autoAdjust(b,reactorA)
- autoAdjust(b,reactorB)
- autoAdjust(b,reactorC)
- autoAdjust(b,reactorD)
- autoAdjust(b,reactorE)
- autoAdjust(b,reactorF)
- turbAdjust(c,turbineA)
- turbAdjust(c,turbineB)
- turbAdjust(c,turbineC)
- turbAdjust(c,turbineD)
- turbAdjust(c,turbineE)
- turbAdjust(c,turbineF)
- power(a,reactorA)
- power(a,reactorB)
- power(a,reactorC)
- power(a,reactorD)
- power(a,reactorE)
- power(a,reactorF)
- sleep(0.2)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement