Hey guys,
I'm working on a simple "traveling" bot and i have a very strange situation.
Maybe someone is able to help me out (trying to solve it since last friday).
Some code first:
Code:
$coordX = 10099.927734375
$coordY = -6622.677734375
$coordZ = 4.10249280929565
CTM_click($hWow, $coordX, $coordY, $coordZ)
Code:
Func CTM_click($hwnd, $cX, $cY, $cZ)
_MemoryWrite($wowbase+$CTM_X, $hwnd, $cX, "float")
_MemoryWrite($wowbase+$CTM_Y, $hwnd, $cY, "float")
_MemoryWrite($wowbase+$CTM_Z, $hwnd, $cZ, "float")
_MemoryWrite($wowbase+$CTM_PUSH, $hwnd, 4, "int")
botLOG(2,"CTM XYZ: " & $cX & " " & $cY & " " & $cZ)
EndFunc
Code:
Global Const $CTM = 0x9D4A08 ; 4.3.2-15211
Global Const $CTM_GUID = 0x20 ; 4.3.2-15211
Global Const $CTM_PUSH = $CTM + 0x1C ; 4.3.2-15211
Global Const $CTM_X = $CTM + 0x8C ; 4.3.2-15211
Global Const $CTM_Y = $CTM + 0x90 ; 4.3.2-15211
Global Const $CTM_Z = $CTM + 0x94 ; 4.3.2-15211
Code:
Func enableCTM($hwnd)
$inputtosend = '/run SetCVar("AutoInteract", 1)'
If Not WinActive($hwnd) Then
WinActivate($hwnd)
WinWaitActive($hwnd, "", 1)
If WinActive($hwnd) Then
Sleep(15)
Send("{ENTER}")
ClipPut($inputtosend)
Sleep(15)
Send("^v")
Sleep(15)
Send("{ENTER}")
Sleep(15)
EndIf
EndIf
EndFunc
I try to test the CTM_click function with single coordinates.
But the result is wired:
The char..
.. walks into a different direction.
.. (or) walks through the waypoint (hitting the coordinates and doesn't stop). looks like running endless.
I can see the "ctm-click" at the correct position, but the char does something else.
When the coordinates are in front of him, he will hit the point (without a stop).
When the coordinates are behind him, he will walk away from it.
It seems, that he will just walk the faced direction. But why?
[Edit]: When i use my mouse it works like it should (ctm).
I guess the "4" of _MemoryWrite($wowbase+$CTM_PUSH, $hwnd, >>>4<<<, "int") is correct (walk to..) .. also the var type "int" is correct. Isn't it?
Currently testing it at [43:28] in the Eversong Woods, but in other places too... same situation.
I checked the addresses, the functions, etc etc.. thousand times..
but i don't get it.
..the ctm activation is maybe a bit "oldschoolish", but should fit my needs for now.
anyway, thanks in advance
hesi
[Edit2]: I use <NomadMemory.au3> to read/write memory