Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Proximity = rs.getAnalogInput("left")
- os.pullEvent = os.pullEventRaw
- function Security()
- if Proximity == 5 then
- sleep(1)
- else
- os.reboot()
- end
- term.setTextColor(colors.cyan)
- print("Please Provide Security Key")
- print(" ")
- print("Password:")
- password = io.read()
- if password == "TestPass" and Proximity == 5 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.")
- Security()
- end
- end --# this was missing
- function Authentication()
- if Proximity == 5 then
- sleep(1)
- else
- os.reboot()
- end
- term.clear()
- term.setCursorPos(1,1)
- term.setTextColor(colors.cyan)
- print("Welcome. Please input User Identification Key")
- print(" ")
- print("User ID:")
- username = io.read()
- if username == "TestName" and Proximity == 5 then
- term.clear()
- term.setCursorPos(1,1)
- term.setTextColor(colors.green)
- print("User Identification Key Accepted")
- print(" ")
- sleep(1)
- term.setTextColor(colors.purple)
- print("Welcome.")
- Security()
- else
- term.setTextColor(colors.red)
- print("Invalid User. Session Terminated.")
- sleep(1)
- os.reboot()
- end
- end --# this was missing
- function Start()
- term.clear()
- term.setCursorPos(1,1)
- term.setTextColor(colors.cyan)
- sleep(1)
- if Proximity == 5 then
- sleep (1)
- Security()
- end
- end
- Start()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement