Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local password = "bose"
- print("----------------------------")
- print("| Spenton Mining Facility |")
- print("----------------------------")
- print(" ")
- print("Welcome! Please enter in the password.")
- write("Password: ")
- local input = read()
- if (input == password) then
- print " "
- print "Thank you for logging in!"
- sleep (2) -- sleeping a Lua thread? Surprised it works
- print " "
- print "Please enter in a numerical choice."
- print "[1]: Open Door"
- print "[2]: Close Door"
- print "[3]: Log off"
- print " "
- write "(1/2/3): "
- local choice = read()
- if choice == "1" then
- print "Unlocking door, please wait..."
- sleep (2)
- redstone.setOutput("back", true)
- print "Door unlocked!"
- sleep (5)
- -- system.os.reboot() would reboot the computer if Lua is unprotected
- os.reboot()
- elseif choice == "2" then
- print "Locking door, please wait..."
- sleep (2)
- redstone.setOutput("back", false)
- print "Door locked!"
- sleep (5)
- os.reboot()
- elseif choice == "3" then
- print "Ending session, please wait..."
- sleep (2)
- os.reboot()
- else
- print "Invalid choice, ending session..."
- sleep (2)
- os.reboot()
- end
- else
- print "Incorrect Password!"
- sleep (2)
- print "Ending session..."
- sleep (2)
- os.reboot()
- end
Advertisement
Add Comment
Please, Sign In to add comment