Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require("/scripts/auth/auth")
- local oldPull = os.pullEvent
- os.pullEvent = os.pullEventRaw
- function resetCursor(x, y)
- term.clear()
- term.setCursorPos(x, y)
- end
- local auth = false
- resetCursor(1, 1)
- while not auth do
- io.write("Username: ")
- local username = string.gsub(read(), "^ +", "")
- username = string.gsub(username, " +$", "")
- io.write("Password: ")
- local password = read("*")
- local res = verify_user(username, password)
- auth = res.allow
- print(res.loginMessage)
- if not auth then
- sleep(2)
- resetCursor(1, 1)
- end
- end
- os.pullEvent = oldPull
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement