Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Neat version
- os.pullEvent = os.pullEventRaw
- local accounts = {
- {
- username = "Sasha_King",
- password = "CC54"
- },
- }
- term.clear()
- term.setCursorPos(1,1)
- print([[
- .__________________________.
- | |
- | Login: |
- | Password: |
- | |
- | |
- |__________________________|
- ]])
- term.setCursorPos(11, 4)
- local username = read()
- term.setCursorPos(14, 5)
- local password = read("*")
- local exists = false
- for i=1,#accounts,1 do
- if username == accounts[i].username and password == accounts[i].password then
- exists = true
- break
- end
- end
- term.setCursorPos(4, 7)
- if exists then
- term.write("Access Granted!")
- term.setCursorPos(1, 10)
- else
- term.write("Access Denied!")
- sleep(1)
- os.shutdown()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement