Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function c()
- term.clear()
- term.setCursorPos(1, 1)
- end
- local password = "onesmallstepforman"
- local uPassword
- local NASAID
- local guestUsername
- local guestPassword = "12345"
- local success = false
- print("Welcome to the NASA space center.")
- print("Please know that your login information is")
- print("being tracked as you move throughout the building.")
- print(" ")
- term.write("Enter your NASAID: ")
- NASAID = read()
- c()
- print("Verifying NASAID...")
- os.sleep(3)
- c()
- if NASAID == "guest" then
- --IF guest
- print("Welcome guest!")
- os.sleep(1)
- term.write("Please Enter your username for identification: ")
- guestUsername = read()
- c()
- print("Hello, ".. guestUsername .. "!")
- term.write("Please enter your guest password: ")
- uPassword = read("*")
- c()
- print("Validating Password...")
- if uPassword == guestPassword and uPassword ~= nil and guestUsername ~= nil then
- --Correct Guest password
- os.sleep(2)
- c()
- print("Sending login information...")
- rednet.open("back")
- success = rednet.send(10, "Guest, " .. guestName .. ", Validated!"
- rednet.close("back")
- os.sleep(2)
- if success then
- --Successful send
- print("Success!")
- rs.setOutput("right", true)
- os.sleep(2)
- rs.setOutput("right", false)
- os.reboot()
- else
- --Unsuccessful send
- print("ERROR! Please use another console and contact the control room immedeatley!")
- os.sleep(2)
- os.reboot()
- end
- else
- --Incorrect name or guest password
- os.sleep(2)
- c()
- print("Your guest password or username seems to be invalid, please contact your chaperone!")
- os.sleep(2)
- os.reboot()
- end
- elseif NASAID ~= nil
- --NASAID is NOT guest
- print("Welcome Back!")
- term.write("Password: ")
- uPassword == read("*")
- c()
- print("Validating Password...")
- os.sleep(3)
- c()
- if uPassword == password
- --Correct password
- print("Sending Login Information...")
- os.sleep(2)
- rednet.open("back")
- success = rednet.send(10, "User, " .. NASAID .. ", Success!")
- rednet.close("back")
- if success then
- --Successful send
- print("Success!")
- rs.setOutput("right", true)
- os.sleep(2)
- rs.setOutput("right", false)
- os.reboot()
- else
- --Unsuccessful Send
- print("ERROR! Please contact security immedeatly!")
- os.sleep(2)
- os.reboot()
- end
- else
- print("Incorrect Password!")
- os.seep(2)
- c()
- print("Sending Login Information...")
- os.sleep(2)
- rednet.open("back")
- rednet.send(10, "User, " .. NASAID .. ", INCORRECT PASSWORD!")
- rednet.close("back")
- c()
- print("Your incorrect password attempt has been recorded!")
- print("Goodbye!")
- os.sleep(2)
- os.reboot()
- end
- else
- --NASAID was not entered
- print("Please enter a valid NASAID!")
- os.sleep(2)
- os.reboot()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement