Hallo AutoIt Comm,
ich habe da ein kleines prob mit einer (vor 30min gebastelten) Gui.
Er soll einen bestimmten Wert (Genaugenommen Installations Pfad) den man bei einem Input Feld (Gui) in eine Ini schreiben. Nur wenn ich da den Richtigen Pfad angebe, dann schreibt er "pfad=14" in die ini Datei.
Hier mal der Code
Spoiler anzeigen
#include <GUIConstantsEx.au3>
Opt("GUICoordMode", 1)
Global $idpw, $id, $pw, $idi, $pwi, $pfad, $start, $save, $load, $pfad1, $msg, $pfad2, $pfadi, $save1, $closed, $msg
Global $starter = GUICreate("BBO Starter", 329, 100, 389, 236)
$idpw = GUICtrlCreateGroup("Login ID und Passwort", 0, 0, 169, 65)
$id = GUICtrlCreateLabel("ID:", 8, 16, 20, 20)
GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
$pw = GUICtrlCreateLabel("PW:", 8, 40, 29, 20)
GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
; ------------------------------------------------------------- ;
; ------------------|ID und PW Angeben START|------------------ ;
$idi = GUICtrlCreateInput("", 40, 40, 121, 21)
$pwi = GUICtrlCreateInput("", 40, 16, 121, 21)
; ------------------|ID und PW Angeben ENDE|------------------- ;
; ------------------------------------------------------------- ;
GUICtrlCreateGroup("", -99, -99, 1, 1)
$pfad = GUICtrlCreateButton("Installations Pfad Angeben", 176, 8, 145, 25, 0)
$start = GUICtrlCreateButton("BBO Starten", 176, 40, 145, 25, 0)
$save = GUICtrlCreateButton("Login Speichern", 0, 72, 89, 25, 0)
$load = GUICtrlCreateButton("Login Laden", 88, 72, 81, 25, 0)
; ------------------------------------------------------------- ;
; ----------------|Installations Pfad Angeben|----------------- ;
GUISetState(@SW_SHOW, $starter & $pfad)
$pfad1 = GUICreate("Installations Pfad von BBO", 396, 84, 157, 126)
$pfad2 = GUICtrlCreateGroup("Installations Pfad:", 0, 0, 393, 49)
$pfadi = GUICtrlCreateInput("C:\Programme\Yusho Frohster Games\Bounty Bay Online\", 8, 16, 369, 21)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$save1 = GUICtrlCreateButton("Speichern", 0, 56, 113, 25, 0)
$closed = GUICtrlCreateButton("Schliessen", 120, 56, 113, 25, 0)
GUISetState(@SW_HIDE, $pfad1)
; --------------|Installations Pfad Angeben ENDE|-------------- ;
; ------------------------------------------------------------- ;
While 1
$msg = GUIGetMsg(1)
Select
; ------------------------------------------------------------- ;
; ------------------------|BBO STARTEN|------------------------ ;
Case $msg[0] = $start
$run = IniRead("ini\confic.ini", "InstallPath", "path", 0)
Run($run &"voyagecentury.exe", $run)
; ----------------------|BBO STARTEN ENDE|--------------------- ;
; ------------------------------------------------------------- ;
; ..... weitere funktionen werden hier noch eingebaut
; ------------------------------------------------------------- ;
; -----------|PFAD ANGEBEN UND IN INI SCHREIBEN|--------------- ;
Case $msg[0] = $pfad
GUISetState(@SW_SHOW, $pfad1)
IniDelete("ini\confic.ini", "InstallPath", "path")
Case $msg[0] = $save1
IniWrite("ini\confic.ini", "InstallPath", "path", $pfadi)
Case $msg[0] = $closed
GUISetState(@SW_HIDE, $pfad1)
Case $msg[0] = $GUI_EVENT_CLOSE
If $msg[1] = $pfad1 Then GUISetState(@SW_HIDE, $pfad1)
If $msg[1] = $starter Then Exit
; --------|PFAD ANGEBEN UND IN INI SCHREIBEN ENDE|------------- ;
; ------------------------------------------------------------- ;
EndSelect
WEnd
Ich bedanke mich schonmal für die Unterstützung.
Achja: Ist kein Bot , hab die Regeln schon gelesen
und gn8 an alle