IronClaymore

[lua] minecraft 2door airlock, exit

Feb 15th, 2014
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.41 KB | None | 0 0
  1. -- This is an airlock door system, designed for Rhonyn's underwater dome base.
  2. -- 2 computers make up the total system: an internal and external.
  3. -- This particular program is for the internal computer, to open the doors from the inside.
  4. -- To do: automatic detection of server computer and rednet side.
  5.  
  6. local pullEvent = os.pullEvent
  7. os.pullEvent = os.pullEventRaw
  8. while true do
  9. term.clear()
  10. term.setCursorPos(1, 1)
  11. print("This airlock leads to the outside.")
  12. term.setCursorPos(1, 2)
  13. print("Please ensure you have adequate underwater gear.")
  14. term.setCursorPos(1, 3)
  15. print("Type open to begin airlock procedure. This procedure take 20 seconds to complete.")
  16. input = read()
  17. if input == "open" then
  18. term.clear()
  19. term.setCursorPos(1, 1)
  20. print("Airlock opening.")
  21. redstone.setBundledOutput("bottom", 10) -- Opens internal door, closes external doors
  22. sleep(10)
  23. redstone.setBundledOutput("bottom", 12) -- Closes internal door, opens middle door
  24. sleep(10)
  25. redstone.setBundledOutput("bottom", 0) -- Closes middle door, opens external doors
  26. end
  27. if input == "debug" then
  28. term.clear()
  29. term.setCursorPos(1, 1)
  30. print("Debug mode activated. Use CTRL + T after 5 seconds to exit program.")
  31. sleep(5)
  32. os.pullEvent = pullEvent
  33. end
  34. if input ~= "open" and input ~= "debug" then
  35. term.clear()
  36. term.setCursorPos(1, 1)
  37. print("Incorrect command.")
  38. sleep(3)
  39. end
  40. end
Advertisement
Add Comment
Please, Sign In to add comment