Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local w,h = term.getSize()
- os.pullEvent = os.pullEventRaw
- local username = {
- "user1","user2","user3"
- }
- local password = {
- "pass1","pass2","pass3"
- }
- local function center(text, line)
- term.setCursorPos(math.floor(w/2)-string.len(text)/2, line)
- write(text)
- end
- while true do
- term.clear()
- center("Magica Security INC", 1)
- center(":=================:",2)
- center("Copyright 2013",4)
- center(":============:",5)
- center(":==========:",8)
- center("Username >> ",7)
- input = read()
- center(":==========:",10)
- center("Password >> ",9)
- pass = read("*")
- for i,v in ipairs(username) do
- if input == v then
- if pass == password[i] then
- term.clear()
- center("Welcome "..tostring(input),2)
- center(":===============:",3)
- sleep(1)
- rs.setOutput("bottom", true)
- sleep(5)
- rs.setOutput("bottom", false)
- else
- term.clear()
- center("Incorrect details!",2)
- center(":================:",3)
- sleep(2)
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement