Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local pass = "Temp"
- local dPas = "Debug"
- local timer = 5
- local delay = 1
- local side = "left"
- local dside = "bottom"
- --//This code runs first on computer startup, checking for a valid keycard in the bottom disk
- while true do
- if disk.isPresent(dside) then
- if fs.exists("disk/security/key") then
- shell.run("disk/security/key")
- if key == "Code" then
- disk.eject(dside)
- rs.setOutput(side,false)
- sleep(timer)
- rs.setOutput(side,true)
- else
- disk.eject(dside)
- end
- else
- disk.eject(dside)
- end
- end
- else
- --// This code must run only if user has turned on the computer without a keycard in the bottom disk driver, or if the keycard is invalid
- print("Door is Locked")
- sleep(delay)
- print("Insert Password: ")
- sleep(delay)
- local input = read("x")
- if input == pass then --If the password is correct do
- rs.setOutput(side,false)
- sleep(timer)
- rs.setOutput(side,true)
- sleep(delay)
- os.shutdown()
- else --If the password is incorrect do
- print ("Incorrect password)
- sleep(delay)
- os.shutdown()
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement