Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local pullEvent = os.pullEvent
- os.pullEvent = os.pullEventRaw
- local password = "guest"
- local debug = "debug"
- while true do
- term.clear()
- term.setCursorPos(1, 1)
- print("You are on Level X - yyyyy")
- term.setCursorPos(1, 2)
- print("Type List to see a listing of all floors.")
- term.setCursorPos(1, 3)
- print("Or enter password to open elevator doors.")
- input = read()
- if input == password then
- term.clear()
- term.setCursorPos(1, 1)
- print("Thank you. Door will remain open for 10 seconds")
- redstone.setBundledOutput("bottom", 2)
- sleep(10)
- redstone.setBundledOutput("bottom", 0)
- end
- if input == debug then
- term.clear()
- term.setCursorPos(1, 1)
- print("Debug mode activated, press CTRL + T after 5 seconds to exit program.")
- sleep(5)
- os.pullEvent = pullEvent
- end
- if input == "List" then
- term.clear()
- term.setCursorPos(1, 1)
- print("Level 9 - Lobby")
- term.setCursorPos(1, 2)
- print("Level 8 - Living quarters")
- term.setCursorPos(1, 3)
- print("Level 7 - Factory floor")
- term.setCursorPos(1, 4)
- print("Level 6 - Biofuels production and R&D")
- term.setCursorPos(1, 5)
- print("Level 5 - Hydroponics")
- term.setCursorPos(1, 6)
- print("Level 4 - unused")
- term.setCursorPos(1, 7)
- print("Level 3 - unused")
- term.setCursorPos(1, 8)
- print("Level 2 - unused")
- term.setCursorPos(1, 9)
- print("Level 1 - Restricted!")
- term.setCursorPos(1, 11)
- print("You are on Level X - yyyyy.")
- term.setCursorPos(1, 12)
- print("Type any command to return to previous menu.")
- input2 = read()
- if input2 == debug then
- term.clear()
- term.setCursorPos(1, 1)
- print("Debug mode activated, press CTRL + T after 5 seconds to exit program.")
- sleep(5)
- os.pullEvent = pullEvent
- end
- if input2 ~= debug then
- sleep(0.2)
- end
- end
- if input ~= password and input ~= debug and input ~= "List" then
- term.clear()
- term.setCursorPos(1, 1)
- print("Invalid command.")
- sleep(3)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment