IronClaymore

[lua] minecraft 2door airlock, entrance

Feb 15th, 2014
230
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.52 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 external computer, to enter the base from the outside.
  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 Rhonyn's Domebase (Doombase?)")
  12. term.setCursorPos(1, 2)
  13. print("Use this system to enter the base.")
  14. term.setCursorPos(1, 3)
  15. print("Type open to begin airlock procedure. This procedure take 30 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", 8) -- Closes external doors, clearing outer chamber
  22. sleep(10)
  23. redstone.setBundledOutput("bottom", 12) -- Opens middle door, external stays closes
  24. sleep(10)
  25. redstone.setBundledOutput("bottom", 10) -- Closes middle, opens interior and external doors
  26. sleep(10)
  27. redstone.setBundledOutput("bottom", 0) -- Closes internal door
  28. end
  29. if input == "debug" then
  30. term.clear()
  31. term.setCursorPos(1, 1)
  32. print("Debug mode activated. Use CTRL + T after 5 seconds to exit program.")
  33. sleep(5)
  34. os.pullEvent = pullEvent
  35. end
  36. if input ~= "open" and input ~= "debug" then
  37. term.clear()
  38. term.setCursorPos(1, 1)
  39. print("Incorrect command.")
  40. sleep(3)
  41. end
  42. end
Advertisement
Add Comment
Please, Sign In to add comment