Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.pullEvent = os.pullEventRaw
- function Security()
- term.setTextColor(colors.cyan)
- print("Please Provide Security Key\n")
- print("Password: ")
- password = read("*")
- if password == "TestPass" then
- term.clear()
- term.setCursorPos(1, 1)
- term.setTextColor(colors.green)
- print("Security Key Accepted")
- print(" ")
- print("Access Granted")
- redstone.setOutput("right", true)
- sleep(10)
- redstone.setOutput("right", false)
- else
- term.setTextColor(colors.red)
- print("User or Security Key is Invalid.")
- sleep(1)
- end
- end
- function Authentication()
- term.clear()
- term.setCursorPos(1, 1)
- term.setTextColor(colors.cyan)
- print("Welcome. Please input User Identification Key\n")
- print("User ID: ")
- username = read()
- if username == "TestName" then
- term.clear()
- term.setCursorPos(1, 1)
- term.setTextColor(colors.green)
- print("User Identification Key Accepted\n")
- term.setTextColor(colors.purple)
- print("Welcome.")
- Security()
- else
- term.setTextColor(colors.red)
- print("Invalid User. Session Terminated.")
- sleep(1)
- end
- end
- function Start()
- while true do --# start an infinite loop
- Proximity = rs.getAnalogInput("left")
- if Proximity == 5 then Authentication() end
- end
- end
- Start()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement