Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- term.clear()
- term.setCursorPos(1,1)
- print("Enter username and password to login")
- print(" ")
- print("Username: ")
- print("Password: ")
- term.setCursorPos(11,3)
- local userInput = read()
- term.setCursorPos(11,4)
- local passInput = read("*")
- local u = fs.open("sys/username", "r")
- local username = u.readLine()
- u.close()
- local p = fs.open("sys/password", "r")
- local password = p.readLine()
- p.close()
- if userInput == username and passInput == password then
- print("Welcome "..username)
- sleep(2)
- term.clear()
- term.setCursorPos(1,1)
- shell.run("sys/os")
- else
- print("Incorrect username or password")
- sleep(2)
- os.reboot()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement