Ok, here is my video of me creating a computer controlled airlock using just Galacticraft and ComputerCraft. The block layout looks a bit messy round the computer but that is needed to keep the 3 redstone dust trails separated. There might be a place or 2 that can be refined a little but this is the simplest circuit I could come up with on short notice
It is much neater using Project: Red insulated wires
The system can be sealed completely but I left it open for the sake of the video. The doors can be larger or smaller depending on your needs but for the circuit to have room it needs the doors to be at least 5 blocks between them. The computer is hidden away behind the wall so that the redstone has access to 3 sides without compromising the seal. This can prevent tampering with the computer once it is sealed away from sight
Here is the video:
I used an advanced computer in the video to allow it to colorize the program code syntax to make it easier to see but it does work fine with a standard computer too
In case you have trouble copying the computer program from the video (I typed it in the video as it is short and easy) here it is:
redstone.setOutput("left", true)
redstone.setOutput("right", false)
while true do
sleep(0.1)
if redstone.getInput("back") then
if redstone.getOutput("left") then
redstone.setOutput("right", true)
sleep(1)
redstone.setOutput("left", false)
else
redstone.setOutput("left", true)
sleep(1)
redstone.setOutput("right", false)
end
end
end
The program needs to be named startup so it will run automatically whenever the virtual computer reloads into memory.
The 1st 2 lines initialize the state of the doors.
The program then enters a never ending loop with the while command.
The sleep(0.1) adds a short wait of 0.1 seconds to prevent the lua system thinking the program is not responding.
The first if command checks to see if there is a signal from the buttons.
The next if command checks to see if the left door is closed (true = redstone signal on = door closed)
If it is closed, it closes the right door, waits 1 second then opens the left.
If the left door was open (else), it does the opposite... Closes left, waits, opens right.
That's it. Of course you need to make sure the airlock controllers are set to redstone signal mode as shown in the video
*EDIT* This program is the simplest form, it does have one fault with it. If a player holds in the button a bit too long the program will cycle the doors a second time! To safeguard against that you can add the following 3 lines between the first 2 end commands:
while redstone.getInput("back") do
sleep(0.1)
end
This will make the program wait until there is no signal from the buttons before continuing with the main loop