I am trying to write a script that will ask users for a password (similar to the tutorial on the wiki) with the difference that when it is run for the first time it asks the user to input their chosen password.
I am not really sure how to do this, I think there could be a solution by having the password saved to an external file to the script then read that in? Then the password could be changed as and when the user requires to do so, any advice and guidance would be greatly appreciated.
Thanks!
[Question] How do I update a variable is a running script then save the script with the new vairable
Started by Quinncunx, Jun 06 2012 02:31 PM
3 replies to this topic
#1
Posted 06 June 2012 - 02:31 PM
#2
Posted 06 June 2012 - 04:47 PM
Quinncunx, on 06 June 2012 - 02:31 PM, said:
I am not really sure how to do this, I think there could be a solution by having the password saved to an external file to the script then read that in? Then the password could be changed as and when the user requires to do so, any advice and guidance would be greatly appreciated.
#3
Posted 06 June 2012 - 04:49 PM
local PASSFILE = "password.txt" local file = fs.open(PASSFILE, "r") if file then local password = file.readAll() file.close() -- verify user password here quit if wrong else -- get a new password from user file = fs.open(PASSFILE, "w") file.write(password) file.close() endI wrote you some codings.
#4
Posted 06 June 2012 - 05:14 PM
Thanks Guys
/>
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users











