Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Stop Termination
- os.pullEvent = os.pullEventRaw
- -- Clear Screen
- term.clear()
- -- Set Cursor Pos
- term.setCursorPos(1,1)
- -- Set Login Info
- username = {"user1", "user2"} -- adds available usernames
- password = {"pass1", "pass2"} -- sets passwords to those usernames
- -- Enter Info
- term.setCursorPos(5,10)
- print("Password: ")
- term.setCursorPos(5,9)
- write("Username: ")
- user = read()
- term.setCursorPos(5,10)
- write("Password: ")
- pass = read('*')
- -- Give/Restrict Access
- for i = 1, #username do
- if user == username[i] and pass == password[i] then
- access = true
- end
- end
- -- Animation
- if access == true then
- term.clear()
- term.setCursorPos(8,10)
- print("Logging in...")
- sleep(1)
- term.clear()
- term.setCursorPos(1,1)
- textutils.slowPrint("Welcome "..user)
- else
- term.clear()
- term.setCursorPos(9,10)
- textutils.slowPrint("Incorrect.")
- sleep(2)
- os.reboot()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement