Hi,
habe mich nach langer Zeit mal wieder ein bisschen mit Autoit beschäftigt und wollte mir einen Trainer schreiben.
Dazu habe ich das Tut von JakeFrost77 aus der S4 League Section genommen.
Das sah dann so aus:
#RequireAdmin
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <WinAPI.au3>
Global Const $PROCESS_ALL_ACCESS = 0x1f0fff ;Rechte holen
HotKeySet("{ESC}", "Terminate")
HotKeySet("{F5}", "_new")
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("M2T", 155, 60, 192, 124)
$Checkbox1 = GUICtrlCreateCheckbox("999.999.999 Punkte", 8, 8, 113, 17)
$Checkbox2 = GUICtrlCreateCheckbox("+ 20 Sekunden", 8, 32, 97, 17)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
Func _new()
Dim $Return1, $struct1 = DLLStructCreate("dword")
DLLStructSetData ($struct1,1,999999999)
Dim $Return2, $struct2 = DLLStructCreate("float")
DLLStructSetData ($struct2,2,120)
ProcessWait ("Moorhuhn2.exe")
$PID = ProcessExists("Moorhuhn2.exe")
Sleep(700)
$PH = _WinAPI_OpenProcess($PROCESS_ALL_ACCESS,True,$PID)
If $Checkbox1 = True Then
$write = _WinAPI_WriteProcessMemory($PH,0x00479D44, DllStructGetPtr($struct1, 1), DllStructGetSize($struct1), $Return1); Memoryediting Befehl(Punkte)
EndIf
If $Checkbox2 = True Then
$write = _WinAPI_WriteProcessMemory($PH,0x00479734, DllStructGetPtr($struct2, 2), DllStructGetSize($struct2), $Return2); Memoryediting Befehl(Zeit)
EndIf
If $Return1 = True Then
MsgBox(0,"Erfolg","Erfolgreich geändert!")
ElseIf $Return1 = False Then
MsgBox(0,"Error","Something's wrong!")
EndIf
If $Return2 = True Then
MsgBox(0,"Erfolg","Erfolgreich geändert!")
ElseIf $Return2 = False Then
MsgBox(0,"Error","Something's wrong!")
EndIf
EndFunc
Func Terminate()
Exit 0
EndFunc
Ich weiß nicht was ich falsch gemacht habe.

Wenn ich das Programm ausführe kommt "Something's wrong!" (also die Überprüfung die ich eingebaut habe)
Hier nochmal das TUT, welches ich benutzt habe:
Danke, wenn mir jemand helfen könnte.
Edit: Hatte es zuvor mit der NomadMemory.au3 versucht hatte leider nicht geklappt:
#RequireAdmin
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <NomadMemory.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("M2T", 155, 60, 192, 124)
$Checkbox1 = GUICtrlCreateCheckbox("999.999.999 Punkte", 8, 8, 113, 17)
$Checkbox2 = GUICtrlCreateCheckbox("+ 20 Sekunden", 8, 32, 97, 17)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
HotKeySet("{ESC}", "Terminate")
HotKeySet("{F5}", "HC")
Global $ProcessID
Global $Open
Global $Punkte
Global $Zahl1
Global $Adresse1
Global $Adresse2
While Not ProcessExists ("Moorhuhn2.exe")
WEnd
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
Func HC()
$ProcessID = ProcessExists("Moorhuhn2.exe")
$Open = _memoryopen($ProcessID)
$Punkte = 999999
$Zahl1 = 110
$Adresse1 = 0x0479D44
$Adresse2 = 0x0479734
If $Checkbox1 = true Then
$write = _MemoryWrite($Adresse1, $Open, $Punkte, 'dword')
EndIf
IF $Checkbox2 = true Then
$write = _MemoryWrite($Adresse2, $Open, $Zahl1, 'float')
EndIf
EndFunc
Func Terminate()
Exit 0
EndFunc