Jump to content

Help @ Saving/Loading settings


crest
 Share

Recommended Posts

Hey :whistle:

ive got an autoit-script which is actually working as intended, but now i wanted to make it to be able to work with different resolutions and other settings.

I thought i could just make it like most modern games do it too:

When the scripts starts, a gui pops up where you can define the resolution and other options. Then those settings should be saved in a file (.txt?) and when the script is beeing started the next time, it simply reads those settings saved in the local file, so that you dont have do define those settings every time you run the script. The gui shouldnt pop up this time tho :D

Unfortunately i have no idea how im supposed to do that.

Hopefully someone can help me with that issue or redirect me to some tutorials or similar stuff, so that i can learn it :P

Thanks in advance

Link to comment
Share on other sites

well ... ive read a bit through the autoit-helpfile and now i think ive found a way how to do it (im not sure tho, whether its the best way do to it - so please feel free to post any superior ways xD)

First, the script should check whether a specific file already exists in the same directory as the script itself (which would be the "settings-file")

If it does exist, it should open it and read the already stored settings into some variables and the actually execute the rest of the script.

If it does not exist, the gui should pop up and after defining the settings, it should create a new file (maybe named myscriptsettings.txt) write the earlier defined settings into the file, then save it and execute the rest of the script.

This should work i guess :P

But i dont know how to create a new txt.file (or any other file). All i found was FileSaveDialog, but that doesnt help me at all, since this only works for already opened files :whistle:

Link to comment
Share on other sites

Lookup _FileCreate or IniWrite in the help file assuming it is AutoIt 3 you are using.


Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...