Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- This is an airlock door system, designed for Rhonyn's underwater dome base.
- -- 2 computers make up the total system: an internal and external.
- -- This particular program is for the internal computer, to open the doors from the inside.
- -- To do: automatic detection of server computer and rednet side.
- local pullEvent = os.pullEvent
- os.pullEvent = os.pullEventRaw
- while true do
- term.clear()
- term.setCursorPos(1, 1)
- print("This airlock leads to the outside.")
- term.setCursorPos(1, 2)
- print("Please ensure you have adequate underwater gear.")
- term.setCursorPos(1, 3)
- print("Type open to begin airlock procedure. This procedure take 20 seconds to complete.")
- input = read()
- if input == "open" then
- term.clear()
- term.setCursorPos(1, 1)
- print("Airlock opening.")
- redstone.setBundledOutput("bottom", 10) -- Opens internal door, closes external doors
- sleep(10)
- redstone.setBundledOutput("bottom", 12) -- Closes internal door, opens middle door
- sleep(10)
- redstone.setBundledOutput("bottom", 0) -- Closes middle door, opens external doors
- end
- if input == "debug" then
- term.clear()
- term.setCursorPos(1, 1)
- print("Debug mode activated. Use CTRL + T after 5 seconds to exit program.")
- sleep(5)
- os.pullEvent = pullEvent
- end
- if input ~= "open" and input ~= "debug" then
- term.clear()
- term.setCursorPos(1, 1)
- print("Incorrect command.")
- sleep(3)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment