Board Thread:Tutorials/@comment-76.121.229.162-20130328052049

I added a little bit to this program to make it look a little  nicer in my opinion:

os.pullEvent = os.pullEventRaw

term.clear

term.setCursorPos(1, 1)

username = {"username1", "username2"}

password = {"password1", "password2"}

textutils.slowPrint("Username: ")

user = read

textutils.slowPrint("Password: ")

pass = read

for i=1, #username do

if user == username[i] then

if pass == password[i] then

access = true

end

end

end

if access == true then

term.clear

term.setCursorPos(1, 1)

textutils.slowPrint("Logging in...")

sleep(2)

term.clear

term.setCursorPos(1,1)

textutils.slowPrint("Welcome, "..user)

else

term.clear

term.setCursorPos(1, 1)

textutils.slowPrint("Loggin in...")

sleep(2)

term.clear

term.setCursorPos(1, 1)

textutils.slowPrint("Access Denied.")

sleep(2)

os.reboot

end  