i need help to make a login program that will read the username and password form a file!
file eg.
user = user
password = password
like that and the login program will read it form a file can eny 1 help?
[help] need help with login program
Started by rex41043, Apr 10 2012 10:52 PM
1 reply to this topic
#1
Posted 10 April 2012 - 10:52 PM
#2
Posted 10 April 2012 - 11:15 PM
Here:
function correct()
--CODE THAT HAPPENS WHEN PASSWORD IS CORRECT
end
if not fs.exists("//.pass")
write("New Password: ")
input = read("*")
local pass = fs.open("//.pass","w")
pass.write(input)
pass.close()
end
local hFile = fs.open("//.pass","r")
local password = hFile.readAll()
hFile.close()
term.clear()
term.setCursorPos(1,1)
write("Password: ")
local ijkl = read("*")
if ijkl == (password) then
term.clear()
term.setCursorPos(1,1)
print("Password correct!")
correct()
sleep(1)
os.reboot()
else
term.clear()
term.setCursorPos(1,1)
print("Password incorrect!")
print("Shutting down...")
sleep(1)
os.reboot()
end
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users











