#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=C:\Users\Burak\Desktop\SRO-DB Bot Starter\SRO-DB Bot Starter.kxf
$Form1 = GUICreate("dbBot Starter", 334, 178, 192, 124)
$Group1 = GUICtrlCreateGroup("Resolution", 240, 0, 89, 145)
$Radio1 = GUICtrlCreateRadio("1280x800", 248, 16, 113, 17)
GUICtrlSetState(-1, $GUI_CHECKED)
$Radio2 = GUICtrlCreateRadio("1280x720", 248, 40, 113, 17)
$Radio3 = GUICtrlCreateRadio("1176x664", 248, 64, 113, 17)
$Radio4 = GUICtrlCreateRadio("1024x786", 248, 88, 113, 17)
$Radio5 = GUICtrlCreateRadio("800x600", 248, 112, 113, 17)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Input1 = GUICtrlCreateInput("SrProxy path", 8, 8, 137, 21)
$Button1 = GUICtrlCreateButton("Search...", 152, 8, 75, 21, $WS_GROUP)
$Input2 = GUICtrlCreateInput("SRO-DB Bot path", 8, 32, 137, 21)
$Button2 = GUICtrlCreateButton("Search...", 152, 32, 75, 21, $WS_GROUP)
$Button3 = GUICtrlCreateButton("Search...", 152, 56, 75, 21, $WS_GROUP)
$Input3 = GUICtrlCreateInput("SRO_Client", 8, 56, 137, 21)
$Input4 = GUICtrlCreateInput("Botusername", 8, 80, 137, 21)
$Button4 = GUICtrlCreateButton("Start", 152, 80, 75, 21, $WS_GROUP)
$Input5 = GUICtrlCreateInput("Botpassword", 8, 104, 137, 21)
$Button5 = GUICtrlCreateButton("Save", 152, 104, 75, 21, $WS_GROUP)
$Checkbox1 = GUICtrlCreateCheckbox("English Patch", 152, 128, 81, 17)
$Combo1 = GUICtrlCreateCombo("pSRO Version", 8, 128, 137, 25)
GUICtrlSetData(-1, "ZSZC|SWSRO 1|SWSRO 2")
$Label1 = GUICtrlCreateLabel("WARNING: You have to fill in all fields, otherwise it won't work!", 16, 152, 306, 17)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
If FileExists("settings.ini") Then
$input1r = IniRead("settings.ini", "SRProxy", "proxypath", "")
$input2r = IniRead("settings.ini", "dbBot", "botpath", "")
$input3r = IniRead("settings.ini", "SRO_Client", "clientpath", "")
$input4r = IniRead("settings.ini", "ID", "botusername", "")
$input5r = IniRead("settings.ini", "PW", "botpassword", "")
$checkbox1r = IniRead("settings.ini", "English", "englishpatch", "")
$radior = IniRead("settings.ini", "Resolution", "radio", "")
$combos = IniRead("settings.ini", "SROVersion", "sro", "")
GUICtrlSetData($Input1, $input1r)
GUICtrlSetData($Input2, $input2r)
GUICtrlSetData($Input3, $input3r)
GUICtrlSetData($Input4, $input4r)
GUICtrlSetData($Input5, $input5r)
If $checkbox1r = "1" Then GUICtrlSetState($Checkbox1, $GUI_CHECKED)
If $radior = "1" Then GUICtrlSetState($Radio1, $GUI_CHECKED)
If $radior = "2" Then GUICtrlSetState($Radio2, $GUI_CHECKED)
If $radior = "3" Then GUICtrlSetState($Radio3, $GUI_CHECKED)
If $radior = "4" Then GUICtrlSetState($Radio4, $GUI_CHECKED)
If $radior = "5" Then GUICtrlSetState($Radio5, $GUI_CHECKED)
If $combos = "1" Then GUICtrlSetData($Combo1, "ZSZC")
If $combos = "2" Then GUICtrlSetData($Combo1, "SWSRO 1")
If $combos = "3" Then GUICtrlSetData($Combo1, "SWSRO 2")
EndIf
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
$proxypath = FileOpenDialog("Search SrProxy...", @ScriptDir, "(*.exe)")
GUICtrlSetData($Input1, $proxypath)
Case $Button2
$botpath = FileOpenDialog("Search dbBot...", @ScriptDir, "(*.exe)")
GUICtrlSetData($Input2, $botpath)
Case $Button3
$clientpath = FileOpenDialog("Search SRO_Client...", @ScriptDir, "(*.exe)")
GUICtrlSetData($Input3, $clientpath)
Case $Button5
$input1s = GUICtrlRead($Input1)
$input2s = GUICtrlRead($Input2)
$input3s = GUICtrlRead($Input3)
$input4s = GUICtrlRead($Input4)
$input5s = GUICtrlRead($Input5)
$combo1s = GUICtrlRead($Combo1)
IniWrite("settings.ini", "SRProxy", "proxypath", $input1s)
IniWrite("settings.ini", "dbBot", "botpath", $input2s)
IniWrite("settings.ini", "SRO_Client", "clientpath", $input3s)
IniWrite("settings.ini", "ID", "botusername", $input4s)
IniWrite("settings.ini", "PW", "botpassword", $input5s)
If BitAND(GUICtrlRead($Checkbox1), $GUI_CHECKED) Then IniWrite("settings.ini", "English", "englishpatch", "1")
If Not BitAND(GUICtrlRead($Checkbox1), $GUI_CHECKED) Then IniWrite("settings.ini", "English", "englishpatch", "0")
If BitAND(GUICtrlRead($Radio1), $GUI_CHECKED) Then IniWrite("settings.ini", "Resolution", "radio", "1")
If BitAND(GUICtrlRead($Radio2), $GUI_CHECKED) Then IniWrite("settings.ini", "Resolution", "radio", "2")
If BitAND(GUICtrlRead($Radio3), $GUI_CHECKED) Then IniWrite("settings.ini", "Resolution", "radio", "3")
If BitAND(GUICtrlRead($Radio4), $GUI_CHECKED) Then IniWrite("settings.ini", "Resolution", "radio", "4")
If BitAND(GUICtrlRead($Radio5), $GUI_CHECKED) Then IniWrite("settings.ini", "Resolution", "radio", "5")
If $combo1s = "ZSZC" Then IniWrite("settings.ini", "SROVersion", "sro", "1")
If $combo1s = "SWSRO 1" Then IniWrite("settings.ini", "SROVersion", "sro", "2")
If $combo1s = "SWSRO 2" Then IniWrite("settings.ini", "SROVersion", "sro", "3")
MsgBox(0, "Saving was successful!", "Saving was successful. WARNING: If the settings.ini isn't in the dbBot Starter path, then it won't load it, so keep it in to prevent data loss.")
EndSwitch
WEnd
Folgendes Problem: Wenn ich den Pfad wähle, das dann in die Inputbox geschrieben wird, ich dannach auf Save drücke, speichert er das nicht. Ich werd noch verrückt. Aber wenn man z.B. in die Inputbox "Hallo" reinschreibt und auf Save drückt schreibt er das rein. Wieso?!
Mit freundlichen Grüßen,
BurakSZ