Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Cabriolaile's login program v1.0
- -- Author: Vortex
- -- Program type: Computer, 1.5, security
- -- Version: 1.0
- -- Language used: Lua
- while true do
- os.pullEvent = os.pullEventRaw
- term.clear()
- term.setCursorPos(1,1)
- if term.isColor then
- term.setTextColor(colors.blue)
- end
- print("CraftOS Login v1.0 by Vortex")
- if term.isColor then
- term.setTextColor(colors.white)
- end
- print("Please identify yourself.")
- local user="Steve" -- Replace it with your username
- local pass="Password" -- Replace it with your own password.
- term.setCursorPos(3,4)
- write("Username: ")
- term.setCursorPos(3,5)
- write("Password: ")
- term.setCursorPos(5,7)
- write("Username: ")
- input=read()
- if input == user then
- term.setCursorPos(3,4)
- term.clearLine()
- write("Username: "..user)
- term.setCursorPos(5,7)
- term.clearLine()
- write("Password: ")
- input=read("*")
- -- input=read()
- if input == pass then
- term.setCursorPos(3,5)
- term.clearLine()
- write("Password: [hidden]")
- -- write("Password: "..pass)
- term.setCursorPos(5,7)
- if term.isColor then
- term.setTextColor(colors.lime)
- end
- write("Password correct! Access granted!")
- sleep(2)
- term.setCursorPos(1,1)
- term.clear()
- else
- term.setCursorPos(3,7)
- term.clearLine()
- if term.isColor then
- term.setTextColor(colors.red)
- end
- write("Password not correct. Access denied!")
- sleep(2)
- end
- else
- term.setCursorPos(5,7)
- term.clearLine()
- if term.isColor then
- term.setTextColor(colors.red)
- end
- write("User doesn't exist! Access denied!")
- sleep(2)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement