Sign in to follow this  
Followers 0
thetwistedpanda

GUI & IniWrite Problems (Not Saving)

2 posts in this topic

#1 ·  Posted (edited)

Hiya everyone, I seem to have run into an error involving my program and would like some assistance solving it! I'm creating an automatic login program for a game called Rakion with customizable options and such... Anyways, everything was going fine until I added support for different installation directories. All hell broke loose.

Rather than post the entire script, I will merely provide snippits of the code pertaining to my problem

CODE

$ini_Directory1 = IniRead("Rakion Autoloader.ini", "Directory", "NyxLauncher", "")

$ini_Directory2 = IniRead("Rakion Autoloader.ini", "Directory", "ScreenShots", "")

GUICtrlCreateButton ("Save Changes", 15, 260, 110, 25, $BS_CENTER)

GUICtrlSetOnEvent(-1, "configSave")

CODE

GUICtrlCreateButton ("Browse", "145", "105", "60", "25", "-1")

GUICtrlSetOnEvent(-1, "Browse")

GUICtrlCreateLabel ("NyxLauncher.exe", 25, 110, 180, 15)

$GUI_Directory1 = GUICtrlCreateInput ( $ini_Directory1, 20, 135, 185, 20)

Func Browse()

$path = FileOpenDialog ( "NyxLauncher.exe", "::{20D04FE0-3AEA-1069-A2D8-08002B30309D}", "(*.exe)", 3, "NyxLauncher.exe")

return GUICtrlSetData($GUI_Directory1, $path)

EndFunc

CODE

GUICtrlCreateButton ("Browse", "145", "160", "60", "25", "-1")

GUICtrlSetOnEvent(-1, "Find")

GUICtrlCreateLabel ("ScreenShots", 25, 165, 180, 15)

$GUI_Directory2 = GUICtrlCreateInput ( $ini_Directory2, 20, 190, 185, 20)

Func Find()

$path = FileSelectFolder ( "Rakion ScreenShot Directory", "", 1, "")

return GUICtrlSetData($GUI_Directory2, $path)

EndFunc

And here's the save code:

CODE

Func configSave()

$ini_Security = IniRead("Rakion Autoloader.ini", "Security", "Level", "3")

If FileExists($IniFile) Then

FileDelete($IniFile)

EndIf

If verDirectory1() == "true" Then

IniWrite("Rakion Autoloader.ini", "Directory", "NyxLauncher", GUICtrlRead($GUI_Directory1))

Else

MsgBox(48, "Error", "Unable to locate NyxLaucher.exe.")

EndIf

If verDirectory2() == "true" Then

IniWrite("Rakion Autoloader.ini", "Directory", "ScreenShots", GUICtrlRead($GUI_Directory2))

Else

MsgBox(48, "Error", "Incorrect directory for Screenshots.")

EndIf

EndFunc

I've put MsgBoxes everywhere with every possible combination of value and they all work. GUICtrlRead(...) gives me the correct directory, as does $path, but neither of them save to the ini file. It seems to delete the section of the directory on save aswell, rather than saving... Any ideas?

Thanks for the help,

Panda.

Edited by thetwistedpanda

Share this post


Link to post
Share on other sites



Nevermind, I managed to fix the problem. I added @ScriptDir to the pathname of my ini file and everything works.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0