Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- This is an airlock door system, designed for RaspberryCommie's underwater base. Really really basic.
- 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. You will have 5 seconds to exit.")
- input = read()
- if input == "open" then
- term.clear()
- term.setCursorPos(1, 1)
- print("Airlock opening.")
- redstone.setBundledOutput("bottom", 6) -- Closes internal door, opens external doors
- sleep(5)
- redstone.setBundledOutput("bottom", 2) -- Closes external door, keeps internal closed
- sleep(5)
- redstone.setBundledOutput("bottom", 0) -- Opens internal door
- 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