Posted 18 August 2014 - 06:21 AM
I'm not new to lua but for some reason the fs api just gets to me.
I know it's possible to do but how would I go about making a code where the install asks the user to setup a password, Then either the password will be entered into the program itself or another file that the password program can look up and compare it to the user input.
this isn't all of the password program but it's part of it to give an example of what I'm looking for.
I also know how to hide files so like I could have .pass file for it to read it but the user wouldn't see the file itself. But is there also a way to make it read only unless it's deleted to make a new one?
I know it's possible to do but how would I go about making a code where the install asks the user to setup a password, Then either the password will be entered into the program itself or another file that the password program can look up and compare it to the user input.
this isn't all of the password program but it's part of it to give an example of what I'm looking for.
passlog = "password" -- the install file would either put the password on this line or it would read it from another file.
print("Enter password")
write("> ")
input = read()
print()
while true do
if input == passlog then
textutils.slowPrint("passward accepted now logging in.")
sleep(1)
do some stuff
else
print("Password rejected")
do something else
end
end
I also know how to hide files so like I could have .pass file for it to read it but the user wouldn't see the file itself. But is there also a way to make it read only unless it's deleted to make a new one?