This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
AnthonyD98™'s profile picture

[Question] How do you make config files?

Started by AnthonyD98™, 29 January 2013 - 12:08 PM
AnthonyD98™ #1
Posted 29 January 2013 - 01:08 PM
Hello I have a question:

How do you make config files?

How would you make a program that when you run for the first time ask's for you to enter a new username and a new password and then it saves that to a config file.
Then when you start the Program up for a 2nd time it ask's you for the a username and the password attached to that username.

Could someone help me with this?

Thanks, AnthonyD98
theoriginalbit #2
Posted 29 January 2013 - 01:29 PM
haha inspiration from anywhere? :blink:/> :P/>

a 'config' file is just a standard file. use fs.exists to see if its there, if not you can assume its first startup and ask for details and write to them to the file. when the file does exist read the file and proceed from there.
tesla1889 #3
Posted 29 January 2013 - 01:56 PM
for passwords you should really just save the hashed version of the password instead of the password itself

prevents people from just reading the config file and typing in the password