User1:Password1
User2:Password2
User3:Password3
Here is a simplified version of my script:
write "Username: "
user = read()
if user == "User1" then
write "Password: "
p1 = read("*")
if p1 == "Password1" then
print "User Verified."
else
print "Incorrect Password."
sleep(1)
os.shutdown()
end
elseif user == "User2" then
write "Password: "
p2 = read("*")
if p2 == "Password2" then
print "User Verified."
else
print "Incorrect Password."
sleep(1)
os.shutdown()
end
elseif user == "User3" then
write "Password: "
p3 = read("*")
if p3 == "Password3" then
print "User Verified."
else
print "Incorrect Password."
sleep(1)
os.shutdown()
end
else
print "User not found."
sleep(1)
os.shutdown()
end
This is only a simplified version. My code has a lot more printed messages, witch makes it harder to add new users. I want it to look similar, but make it so for the user it reads the part before the ':' above, and reads the part after for the password, but also, each individual user has its own password.I also have a line were it prints "Welcome, (username)." after the "User Verified." but i removed it to simplify. could i also make it so that it prints that user's username in that spot?
To sum it up, i want a simplified version of my above script for my startup program, but another program 'Users.txt' to add/delete/edit users.