Script beendet sich mit Exit Code 0

  • Hi,

    habe schon vergeblich nach einer Lösung gesucht baer nichts gefunden und hoffe, dass mir jemand hier helfen kann.

    Ich bin noch Anfänger und weil mein Kumpel zu faul ist in einem Spiel wollte ich mal ein bischen rumprobieren einen Trainer für ein Spiel zu erstellen mit AutoIT.


    So, das Problem, das Script schließt sich sofort und mit dem ExitCode 0. Habe schon Einiges verushct hat aber nichts geholfen.


    Spoiler anzeigen
    [autoit]

    #include <GUIConstants.au3>
    #include <NomadMemory.au3>
    #RequireAdmin
    #Region ### Start MainGUI ###
    $MainGUI = GUICreate("CoDWaW Exp/Prestige Hack", 250, 186, 272, 275)
    GUISetFont(10, 400, 0, "November")
    $Tab1 = GUICtrlCreateTab(0, 0, 249, 185)
    GUICtrlSetFont(-1, 10, 800, 0, "Neuropol")
    GUICtrlSetResizing(-1, $GUI_DOCKWIDTH+$GUI_DOCKHEIGHT)
    $TRAINER = GUICtrlCreateTabItem("Trainer")
    $wl_EXP = GUICtrlCreateLabel("EXP", 8, 32, 36, 18)
    GUICtrlSetFont(-1, 10, 800, 0, "Neuropol")
    $wl_PRESTIGE = GUICtrlCreateLabel("Prestige", 8, 104, 70, 18)
    GUICtrlSetFont(-1, 10, 800, 0, "Neuropol")
    $wl_input_exp = GUICtrlCreateInput("0 - 76975", 96, 32, 105, 22)
    GUICtrlSetFont(-1, 10, 800, 0, "Neuropol")
    $wl_input_pre = GUICtrlCreateInput("0 - 4", 96, 104, 105, 22)
    GUICtrlSetFont(-1, 10, 800, 0, "Neuropol")
    $wl_button_exp = GUICtrlCreateButton("Set EXP", 8, 56, 105, 25, 0)
    GUICtrlSetFont(-1, 10, 800, 0, "Neuropol")
    $wl_button_max_exp = GUICtrlCreateButton("LVL 48", 112, 56, 107, 25, 0)
    GUICtrlSetFont(-1, 10, 800, 0, "Neuropol")
    $wl_button_pre = GUICtrlCreateButton("Set Prestige", 8, 128, 105, 25, 0)
    GUICtrlSetFont(-1, 10, 800, 0, "Neuropol")
    $wl_button_max_pre = GUICtrlCreateButton("Prestige 4", 112, 128, 105, 25, 0)
    GUICtrlSetFont(-1, 10, 800, 0, "Neuropol")
    $NO_LIMITS = GUICtrlCreateTabItem("No Limits")
    $nl_input_pw = GUICtrlCreateInput("", 56, 112, 121, 22)
    GUICtrlSetFont(-1, 10, 800, 0, "Neuropol")
    $nl_button_pw = GUICtrlCreateButton("OK", 56, 136, 121, 25, 0)
    GUICtrlSetFont(-1, 10, 800, 0, "Neuropol")
    $nl_text_1 = GUICtrlCreateLabel("To deactivate the Limits ", 8, 32, 206, 18)
    GUICtrlSetFont(-1, 10, 800, 0, "Neuropol")
    $nl_text_2 = GUICtrlCreateLabel("enter the correct password ", 8, 56, 230, 18)
    GUICtrlSetFont(-1, 10, 800, 0, "Neuropol")
    $nl_text_3 = GUICtrlCreateLabel("and press the 'OK'-Button.", 8, 80, 214, 18)
    GUICtrlSetFont(-1, 10, 800, 0, "Neuropol")
    $EXTRAS = GUICtrlCreateTabItem("Extras")
    GUICtrlCreateTabItem("")
    GUISetState(@SW_SHOW,$MainGUI)
    #EndRegion ### End MainGUI ###
    #Region ### Start MainActivatedGUI ###
    #EndRegion ### End MainActivatedGUI ###
    #Region ### Start PasswordAnswerGUI ###
    $PasswordAnswerGUI = GUICreate("Password Result", 251, 101, 227, 269)
    GUISetFont(10, 800, 0, "Neuropol")
    $PR_Answer = GUICtrlCreateLabel($ANSWER, 48, 24, 37, 18)
    $PR_Leave = GUICtrlCreateButton("OK", 88, 56, 75, 25, 0)
    #EndRegion ### End PasswordAnswerGUI ###
    ;Start Variablen
    ;Standart
    $CPW = "0"
    $PW = "asdf"
    $WRONG = "Wrong Password"
    $CORRECT = "Limits Deactivated"
    $GAMENAME = "Call of Duty®"
    ;Addressen
    $MemEXP = "0xF49F3D0"
    $MemPRE = "0xF49F434"
    ;Werte
    $MaxEXP = "76975"
    $MaxPRE = "4"
    $ActEXP = "153950"
    $ActPRE = "10"
    ;Ende Variablen
    Func _CheckValues()
    If $CPW = "0" Then
    $EXP = $MaxEXP
    $PRE = $MaxPRE
    ElseIf $CPW = "1" Then
    $EXP = $ActEXP
    $PRE = $ActPRE
    EndIf
    EndFunc
    Func _CheckPassword()
    $typed_pw = GUICtrlRead($nl_input_pw)
    If $typed_pw = $PW Then
    $CPW = "1"
    EndIf
    EndFunc
    Func _TellAnswer()
    If $PW = "0" Then
    $ANSWER = $WRONG
    ElseIf $PW = "1" Then
    $ANSWER = $CORRECT
    EndIf
    GUISetState(@SW_SHOW,$PasswordAnswerGUI)
    EndFunc
    Func _WriteMaxEXP()
    $PID = WinGetProcess($GAMENAME)
    $hprocess = _MemoryOpen($PID)
    _MemoryWrite($MemEXP, $hprocess, $EXP)
    EndFunc
    Func _WriteEXP()
    $PID = WinGetProcess($GAMENAME)
    $hprocess = _MemoryOpen($PID)
    $oEXP = GUICtrlRead($wl_input_exp)
    If $oEXP = > $EXP Then
    $oEXP = $EXP
    EndIf
    _MemoryWrite($MemEXP, $hprocess, $oEXP)
    EndFunc
    Func _WriteMaxPRE()
    $PID = WinGetProcess($GAMENAME)
    $hprocess = _MemoryOpen($PID)
    _MemoryWrite($MemPRE, $hprocess, $PRE)
    EndFunc
    Func _WritePRE()
    $PID = WinGetProcess($GAMENAME)
    $hprocess = _MemoryOpen($PID)
    $oPRE = GUICtrlRead($wl_input_pre)
    If $oPRE = > $PRE Then
    $oPRE = $PRE
    EndIf
    _MemoryWrite($MemPRE, $hprocess, $oPRE)
    EndFunc
    While 1
    $nMsg_1 = GUIGetMsg($MainGUI)
    ;$nMsg_2 = GUIGetMsg($MainActivatedGUI)
    $nMsg_3 = GUIGetMsg($PasswordAnswerGUI)
    ;MainGUI
    Switch $nMsg_1
    Case $GUI_EVENT_CLOSE
    Exit
    Case $wl_button_max_exp
    _CheckValues()
    _WriteMaxEXP()
    Case $wl_button_exp
    _CheckValues()
    _WriteEXP()
    Case $wl_button_max_pre
    _CheckValues()
    _WriteMaxPRE()
    Case $wl_button_pre
    _CheckValues()
    _WritePRE()
    Case $nl_button_pw
    _CheckPassword()
    _TellAnswer()
    EndSwitch
    ;MainAvtivatedGUI
    ;Switch $nMsg_2
    ;EndSwitch
    ;PasswordAnswerGUI
    Switch $nMsg_3
    Case $GUI_EVENT_CLOSE
    GUISetState(@SW_HIDE,$PasswordAnswerGUI)
    Case $PR_Leave
    GUISetState(@SW_HIDE,$PasswordAnswerGUI)
    EndSwitch
    WEnd

    [/autoit]


    Schonmal Danke im vorraus

    MfG geollum

    P.S.: Wollte noch eine 3. GUI einfügen aber das hab ich jetzt erstmal weggelassen

  • Uff der code ist ganz schön verstreut und mit den ganzen funcs die du da hast da bietet sich der guionevent modus eher an außerdem fehlt die deklaration der
    variable $Maingui

    Ok hastes editiert ;)

    MfG hellboy

    [autoit]

    Do
    _help($user)
    Until $questions = 0

    [/autoit]

    Meine Werke:
    Ste`s Web-Radio