Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local oldPull = os.pullEvent;
- os.pullEvent = os.pullEventRaw;
- function checkLogin(pass)
- -- Yes, very easy to hack...
- if pass == "butler" then
- return true
- else
- return false
- end
- end
- function login()
- local inputPass = ""
- while not checkLogin(inputPass) do
- term.clear()
- if inputPass ~= "" then
- term.setCursorPos(3,2)
- print("Wrong password!")
- end
- term.setCursorPos(3,3)
- print("Password: ") -- 10 char long
- -- Now comes the input
- term.setCursorPos(13,3)
- inputPass = read("*")
- end
- term.clear()
- term.setCursorPos(3,2)
- print("Correct password!")
- sleep(1.5)
- term.clear()
- term.setCursorPos(1,1)
- end
- login()
- os.pullEvent = oldPull;
Advertisement
Add Comment
Please, Sign In to add comment