Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local password = "System"
- local username = "Delta"
- term.clear()
- term.setCursorPos(1,1)
- write("Username: ")
- local input = read("[]")
- if input == username then -- Checks if the user inputted the correct password/username
- term.clear() -- Already explained up top
- term.setCursorPos(1,1)
- print("Username correct!") -- Prints 'Password correct!' to the screen
- else -- Checks if the user didn't input the correct password
- term.clear()
- term.setCursorPos(1,1)
- print("Username incorrect!") -- Prints 'Password incorrect!' to the screen
- sleep(2) -- Waits 2 seconds
- os.reboot() -- Reboot the computer, reopening the lock
- end
- write("Password: ")
- local passwordin = read("*")
- if passwordin == password then -- Checks if the user inputted the correct password/username
- term.clear() -- Already explained up top
- term.setCursorPos(1,1)
- print("Password correct!") -- Prints 'Password correct!' to the screen
- else -- Checks if the user didn't input the correct password
- term.clear()
- term.setCursorPos(1,1)
- print("Password incorrect!") -- Prints 'Password incorrect!' to the screen
- sleep(2) -- Waits 2 seconds
- os.reboot() -- Reboot the computer, reopening the lock
- end
Add Comment
Please, Sign In to add comment