Wieso liefert das erste IniRead immer den Defaultwert, obwohl der Wert doh in der Ini hinterlegt ist?
Das ist die INI
;Begin
[ACK]
XC=630
MA=610
HA=630
AA=650
[MAK]
M1=630
M2=645
M3=660
M3=675
M4=690
M5=705
[HAK]
H1=505
H2=520
H3=535
H4=550
H5=565
H6=580
H7=595
H8=610
[AAK]
A1=540
A2=555
A3=570
A4=585
A5=600
A6=615
A7=630
;End
Das ist der betreffende Quellcodeabschnitt
$XC = IniRead($KDP, "ACK", "XC", "Du hast den Wert XC verändert! Frage Fast2 doch einmal ob er dir eine neue INI gibt.");Dieses hier liefert immer "Du hast den Wert XC verändert! Frage Fast2 doch einmal ob er dir eine neue INI gibt."
$MC = IniRead($KDP, "ACK", "MA", "Du hast den Wert MA verändert! Frage Fast2 doch einmal ob er dir eine neue INI gibt.");Die hier das richtige
$HC = IniRead($KDP, "ACK", "HA", "Du hast den Wert HA verändert! Frage Fast2 doch einmal ob er dir eine neue INI gibt.")
$AC = IniRead($KDP, "ACK", "AA", "Du hast den Wert AA verändert! Frage Fast2 doch einmal ob er dir eine neue INI gibt.")
$MK = IniRead($KDP, "MAK", $MFIY, "Du hast den Wert "&$MFIY&" verändert! Frage Fast2 doch einmal ob er dir eine neue INI gibt.")
$HK = IniRead($KDP, "HAK", $HFIY, "Du hast den Wert "&$HFIY&" verändert! Frage Fast2 doch einmal ob er dir eine neue INI gibt.")
$AK = IniRead($KDP, "AAK", $AFIY, "Du hast den Wert "&$AFIY&" verändert! Frage Fast2 doch einmal ob er dir eine neue INI gibt.")
MsgBox(0, "INI", $XC);Hier sieht man die falsche Ausgabe von $XC
MsgBox(0, "INI", $MC)
MsgBox(0, "INI", $HC)
MsgBox(0, "INI", $AC)
MsgBox(0, "INI", $MK)
MsgBox(0, "INI", $HK)
MsgBox(0, "INI", $AK)
$NU = $XC&$MC&$HC&$AC&$MK&$HK&$AK
If not StringIsDigit($NU) = 1 Then MsgBox(0, "Test", "Test");Die kommt immer
Select
Case StringIsDigit($XC) = 0;Die auch
MsgBox(0, "Test", "Test1")
Case StringIsDigit($MC) = 0
MsgBox(0, "Test", "Test2")
Case StringIsDigit($HC) = 0
MsgBox(0, "Test", "Test3")
Case StringIsDigit($AC) = 0
MsgBox(0, "Test", "Test4")
Case StringIsDigit($MK) = 0
MsgBox(0, "Test", "Test5")
Case StringIsDigit($HK) = 0
MsgBox(0, "Test", "Test6")
Case StringIsDigit($AK) = 0
MsgBox(0, "Test", "Test7")
EndSelect
Das ganze Script falls relevant
#cs -----------------------------------------------------
AutoIt Version: 3.2.8.1
Von: Fast2
Funktion:DragRacer3 Automatisierung
#ce -----------------------------------------------------
;Anfang
#include <GUIConstants.au3>
#include <GUICombo.au3>
$MA = "Rock|Classic Rock|Hard Rock|Pop|HipHop|Rap"
$HA = "Speed|Graffiti|Skyline|Cityscape|Muscle|Money|Cash|Base"
$OA = "Outskirts (0Cr)|Hi-Rev Tuners Section (100 Cr)|'Pump It UP!' Section (100 Cr)|Luxury Section (200 Cr)|Food Court (200 Cr)|Main Floor (500 Cr)|Front Entrance(1000 Cr)"
$KDO = @AppDataCommonDir&"\XT\KD"
$KDP = $KDO&"\KOI.ini"
$OD = DirCreate($KDO)
FileInstall("C:\Dokumente und Einstellungen\Fabian\Desktop\AutoItDateien\Hilfsdateien\KOI.ini", @TempDir&"\KOI.ini", 1)
If not FileExists($KDP) Then FileMove(@TempDir&"\KOI.ini", $KDP, 9)
$G1 = GUICreate("Drag Racer Trainer", 600, 250)
GUISetFont(14)
GUICtrlCreateLabel("Dieser Trainer Automatisiert den Show Off Modus von Drag Racer v3", 20, 20)
GUICtrlCreateLabel("Achtung! Dieser Trainer wurde nur für die Auflösung 1280x1024 getestet", 60, 60)
GUICtrlCreateLabel("Bitte wählen sie im folgenden Fenster aus den Einstellungen", 60, 100)
$W1 = GUICtrlCreateButton("Weiter", 380, 210, 80)
$F1 = GUICtrlCreateButton(" Fertig", 500, 210, 75)
$Fa1 = GUISetBkColor(0x0000CD)
GUISetState(@SW_Show, $G1)
$G2 = GUICreate("Drag Racer Trainer Auswahl", 600, 150)
GUISetBkColor(0x0000CD)
$CBM = GUICtrlCreateCombo("Bitte wählen sie die Musik", 25, 20, -1 ,-1, BitOr($GUI_SS_DEFAULT_COMBO, $CBS_DROPDOWNLIST))
GUICtrlSetData($CBM, $MA)
$CBH = GUICtrlCreateCombo("Bitte wählen sie den Hintergrund", 25, 65, -1 ,-1, BitOr($GUI_SS_DEFAULT_COMBO, $CBS_DROPDOWNLIST))
GUICtrlSetData($CBH, $HA)
$CBA = GUICtrlCreateCombo("Bitte wählen sie den Ausstellungsort", 25, 110, -1 ,-1, BitOr($GUI_SS_DEFAULT_COMBO, $CBS_DROPDOWNLIST))
GUICtrlSetData($CBA, $OA)
$R1 = GUICtrlCreateRadio("Das Spiel ist in einem Fenster ", 280, 25, 300)
$R2 = GUICtrlCreateRadio("Das Spiel ist in einem Task ", 280, 60, 300)
$B2 = GUICtrlCreateButton("Bestätigen", 425, 100, 110, 35)
$B3 = GUICtrlCreateButton("Abbrechen", 280, 100, 110, 35)
GUICtrlSetFont($R1, 14, 150)
GUICtrlSetFont($R2, 14, 150)
GUICtrlSetFont($B2, 14, 150)
GUICtrlSetFont($B3, 14, 150)
While 1
$msg = GUIGetMsg()
If $msg = $W1 Then
GUISetState(@SW_Show, $G2)
GUISetState(@SW_Hide, $G1)
EndIf
Select
Case $msg = $B3 Or $msg = $F1 Or $msg = $GUI_Event_Close
Exit
Case $msg = $B2
$CB1 = GUICtrlRead($CBM)
$CB2 = GUICtrlRead($CBH)
$CB3 = GUICtrlRead($CBA)
$RB1 = GUICtrlRead($R1)
$RB2 = GUICtrlRead($R2)
Select
Case $RB1 = 1
$FoT = 0
Case $RB2 = 1
$FoT = 25
Case Else
MsgBox(0, "Bitte Wählen", "Sie haben dem Programm nicht mitgeteilt," & @CRLF & "ob das Programm in einem Task ist oder nicht!")
EndSelect
$MFI = _GUICtrlComboGetCurSel($CBM)
$HFI = _GUICtrlComboGetCurSel($CBH)
$AFI = _GUICtrlComboGetCurSel($CBA)
$MFIY = "M"&$MFI
$HFIY = "H"&$HFI
$AFIY = "A"&$AFI
MsgBox(0, "Test", "Bei Musik haben sie das ausgewählt: "&$CB1&@CRLF&"Das entspricht: "&$MFIY)
MsgBox(0, "Test", "Bei Hintergrund haben sie das ausgewählt: "&$CB2&@CRLF&"Das entspricht: "&$HFIY)
MsgBox(0, "Test", "Bei Ausstellungsort haben sie das ausgewählt: "&$CB3&@CRLF&"Das entspricht: "&$AFIY)
$XC = IniRead($KDP, "ACK", "XC", "Du hast den Wert XC verändert! Frage Fast2 doch einmal ob er dir eine neue INI gibt.")
$MC = IniRead($KDP, "ACK", "MA", "Du hast den Wert MA verändert! Frage Fast2 doch einmal ob er dir eine neue INI gibt.")
$HC = IniRead($KDP, "ACK", "HA", "Du hast den Wert HA verändert! Frage Fast2 doch einmal ob er dir eine neue INI gibt.")
$AC = IniRead($KDP, "ACK", "AA", "Du hast den Wert AA verändert! Frage Fast2 doch einmal ob er dir eine neue INI gibt.")
$MK = IniRead($KDP, "MAK", $MFIY, "Du hast den Wert "&$MFIY&" verändert! Frage Fast2 doch einmal ob er dir eine neue INI gibt.")
$HK = IniRead($KDP, "HAK", $HFIY, "Du hast den Wert "&$HFIY&" verändert! Frage Fast2 doch einmal ob er dir eine neue INI gibt.")
$AK = IniRead($KDP, "AAK", $AFIY, "Du hast den Wert "&$AFIY&" verändert! Frage Fast2 doch einmal ob er dir eine neue INI gibt.")
MsgBox(0, "INI", $XC)
MsgBox(0, "INI", $MC)
MsgBox(0, "INI", $HC)
MsgBox(0, "INI", $AC)
MsgBox(0, "INI", $MK)
MsgBox(0, "INI", $HK)
MsgBox(0, "INI", $AK)
$NU = $XC&$MC&$HC&$AC&$HK&$AK
If not StringIsDigit($NU) = 1 Then MsgBox(0, "Test", "Test")
Select
Case StringIsDigit($XC) = 0
MsgBox(0, "Test", "Test1")
EndSelect
Select
Case StringIsDigit($MC) = 0
MsgBox(0, "Test", "Test2")
EndSelect
Select
Case StringIsDigit($HC) = 0
MsgBox(0, "Test", "Test3")
EndSelect
Select
Case StringIsDigit($AC) = 0
MsgBox(0, "Test", "Test4")
EndSelect
Select
Case StringIsDigit($MK) = 0
MsgBox(0, "Test", "Test5")
EndSelect
Select
Case StringIsDigit($HK) = 0
MsgBox(0, "Test", "Test6")
EndSelect
Select
Case StringIsDigit($AK) = 0
MsgBox(0, "Test", "Test7")
EndSelect
EndSelect
WEnd
Danke schonmal für jede Idee.
Fast2
Edit: Es liegt wahrscheinlich nicht an der Ini (Tipp von Westi)