Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Script to stop the flux compressor from exploading
- -- planning to control this behavior via redstone integrator
- -- should turn off compressor when it reaches critical
- -- should also turn the compressor back on when pressure reaches 11 bar
- -- compressor is being used in this case to power a spawner
- -- can be successfully modified to power a compression chamber
- -- also tested with de-pressurizing a compression chanber via a vacuum pump
- -- in the case the max pressure allowed was 5 bar and the minimum was 3 bar
- ----------
- -- wrap peripherals, change names as needed
- local flux = peripheral.wrap("pneumaticcraft:flux_compressor_0")
- local relay = peripheral.wrap("redstoneIntegrator_0")
- -- monitor pressure & shut off when near critical
- -- cardinal directions tend to work best here
- local function fluxcontrol()
- if flux.getPressure() >=19 then
- relay.setOutput("south", false)
- elseif flux.getPressure() <= 11 then
- relay.setOutput("south", true)
- end
- end
- while true do
- fluxcontrol()
- sleep(0.3)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement