zB
Code:
While 1
While 1
#include <GUIConstantsEx.au3>
GUICreate("AutoIT", 335, 100)
GUISetState(@SW_SHOW)
If WinExists("XXX") Then
WinActivate("XXX")
WinWaitActive("XXX")
EndIf
While 1
fight()
WEnd
Func fight()
If PixelGetColor (560, 70) = 0xFFFFFF Then
Send("1")
Else
Do
$zahl = 0
$zahl = $zahl + 1
Sleep (1000)
Send("3")
Sleep (1000)
Send("2")
until $zahl = 1
EndIf
EndFunc
first of all, it is very likely this not the address you were looking for. it will change when you close and restart your game - if im right, you need to find a pointer and offset for the correct address. only then you can execute memory functions. if you don't know how to find a pointer you can learn it from CE tutorial.Quote:
when i get u the adress, can u write me the code i need? i am new to autoit as u can see :)
4bit
061C3188
0 is standing
1 is sitting
#include <_NomadMemory.au3>
#include <Misc.au3>
Global $PID=ProcessExists("target.exe") ; find PID
Global $PROC=_MemoryOpen($PID) ; open process for memory functions
Global $POINTER_ADDRESS=0x00000000 ; define pointer address
Global $MEM_BASEADDR=0 ; store pointer value
Global $MEM_CHAR_STATE=0x0000 ; offset value
$MEM_BASEADDR=getPointer($POINTER_ADDRESS)
While 1
If _IsPressed("24") Then MsgBox(0,"CPlayer_GetState",CPlayer_GetState())
If _IsPressed("23") Then CPlayer_SetState()
WEnd
Func CPlayer_GetState()
Return _MemoryRead($MEM_BASEADDR+$MEM_CHAR_STATE,$PROC,"DWORD")
EndFunc
Func CPlayer_SetState()
Local $STATE=CPlayer_GetState()
$STATE=Not $STATE
_MemoryWrite($MEM_BASEADDR+$MEM_CHAR_STATE,$PROC,$STATE,"DWORD")
EndFunc
Func getPointer($vADDR,$vPROC=$PROC)
Return _MemoryRead($vADDR,$vPROC,"DWORD")
EndFunc