Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- Galacticraft Airlock Controller Program V1
- This program is designed for use in Tekkit (Galacticraft, MineFactory Reloaded*, & Computercraft mods required)
- *or any mod that uses colored channels for redstone wiring (e.g. bundled cables from "ProjectRed - Transmission")
- Wiring Guide:
- Outputs:
- White Channel: Inner Air Lock (set controller to open on redstone signal)
- Orange Channel: Outer Air Lock (set controller to open on redstone signal)
- Light Blue Channel: Piston (to shut off/on the oxygen sealer - I placed this below the airlock and used iron bars as a vent
- Inputs:
- Magenta: Button (to cycle airlock)
- Important: Please create a program called .config on the computer. Put anything into line 1 of it and save it. This will serve as a storage of the air lock's state. This will get overwritten as the air lock cycles. It defaults to an oxygen sealed state (inner air lock opened, outer air lock sealed)
- ]]--
- -- Variables
- status = "Compressed"
- test = false
- -- Initial Check
- if not fs.exists(".config") then
- status = "unsafe"
- else
- data = fs.open(".config", "r")
- status = data.readLine()
- data.close()
- rs.setBundledOutput("back", colors.combine(colors.white, colors.orange, colors.lightBlue))
- end
- while true do
- data = fs.open(".config", "r")
- status = data.readLine()
- data.close()
- -- Stops the program if the airlock config file doesn't exist
- if status == "unsafe" then
- break
- end
- if status == "Decompressed" then
- rs.setBundledOutput("back", colors.combine(colors.white, colors.orange, colors.lightBlue))
- rs.setOutput("left", true)
- rs.setOutput("right", true)
- sleep(2)
- rs.setBundledOutput("back", colors.combine(colors.white, colors.orange))
- sleep(2)
- rs.setBundledOutput("back", colors.orange)
- data = fs.open(".config", "w")
- data.writeLine("Compressed")
- data.close()
- rs.setOutput("left", false)
- rs.setOutput("right", false)
- else
- rs.setBundledOutput("back", colors.combine(colors.white,colors.orange))
- rs.setOutput("left", true)
- rs.setOutput("right", true)
- sleep(2)
- rs.setBundledOutput("back", colors.combine(colors.white, colors.orange, colors.lightBlue))
- sleep(2)
- rs.setBundledOutput("back", colors.combine(colors.white, colors.lightBlue))
- data = fs.open(".config", "w")
- data.writeLine("Decompressed")
- data.close()
- rs.setOutput("left", false)
- rs.setOutput("right", false)
- end
- while rs.testBundledInput("back", colors.magenta) == false do
- sleep(0.1)
- end
- end
Add Comment
Please, Sign In to add comment