1 posts
Posted 20 March 2012 - 11:45 AM
Is there a way to make a password protection system that has a "superpassword" which allows you to change the access password or exit the program? I only managed to make a program as far as being able to change the password or closing the program after entering a superpassword but after the program reboots, the changed password is switched to the default one in the code.
715 posts
Posted 20 March 2012 - 11:52 AM
Runtime variables which aren't stored to disk will be lost after a reboot.
That's not only the case with CC computers, but with actually every real computer as well.
Just open a notepad (one without autosave) in a real computer and type some text. Then force a reboot. Oh where has your text gone to? :D/>/>
You have to make the program be able to store the information, i.e. make use of either fs.open() or io.open() to write data to files, which your program can then read from if a reboot occurred.
Better yet, someone made a very easy to use serialize API that you can make use of for this purpose:
http://www.computercraft.info/forums2/index.php?/topic/302-api-proper-serializationHope it helps, cheers :)/>/>