IronClaymore

RC's airlock internal

Mar 12th, 2014
213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.15 KB | None | 0 0
  1. -- This is an airlock door system, designed for RaspberryCommie's underwater base. Really really basic.
  2.      
  3. local pullEvent = os.pullEvent
  4. os.pullEvent = os.pullEventRaw
  5. while true do
  6. term.clear()
  7. term.setCursorPos(1, 1)
  8. print("This airlock leads to the outside.")
  9. term.setCursorPos(1, 2)
  10. print("Please ensure you have adequate underwater gear.")
  11. term.setCursorPos(1, 3)
  12. print("Type open to begin airlock procedure. You will have 5 seconds to exit.")
  13. input = read()
  14. if input == "open" then
  15.     term.clear()
  16.     term.setCursorPos(1, 1)
  17.     print("Airlock opening.")
  18.     redstone.setBundledOutput("bottom", 6)      -- Closes internal door, opens external doors
  19.     sleep(5)
  20.     redstone.setBundledOutput("bottom", 2)      -- Closes external door, keeps internal closed
  21.     sleep(5)
  22.     redstone.setBundledOutput("bottom", 0)      -- Opens internal door
  23. end
  24. if input == "debug" then
  25.     term.clear()
  26.     term.setCursorPos(1, 1)
  27.     print("Debug mode activated. Use CTRL + T after 5 seconds to exit program.")
  28.     sleep(5)
  29.     os.pullEvent = pullEvent
  30. end
  31. if input ~= "open" and input ~= "debug" then
  32.     term.clear()
  33.     term.setCursorPos(1, 1)
  34.     print("Incorrect command.")
  35.     sleep(3)
  36. end
  37. end
Advertisement
Add Comment
Please, Sign In to add comment