Okay im using this:
Code:
$tarread = _BMReadUInt($handle, $aTargetGUID)
If $tarread = 0 Then
_log("No GUID")
Sleep(10)
Else
$ObjectBase = _WoWGetObjectByGUID($handle, $tarread)
$nameread = _WoWGetName($handle, $ObjectBase)
If $nameread = "Stonetusk Boar" then
_Log("Mob Found: " & $nameread)
_Movemob($handle, _getObjectX($handle, $ObjectBase), _getObjectY($handle, $ObjectBase), $ObjectBase)
EndIf
EndIf
To get see if the unit is a Stonetusk Boar - Which works well.
Im using this to get the units X & Y:
Code:
Func _getObjectX($handle, $curobject)
Return Floor(_BMReadMemory($handle, $curobject + 0xE8, "float"))
EndFunc ;==>_getObjectX
Func _getObjectY($handle, $curobject)
Return Floor(_BMReadMemory($handle, $curobject + 0xEC, "float"))
EndFunc ;==>_getObjectY
Which I thought should work...
and this to move:
Code:
Func _Movemob($handle, $XCoord, $YCoord, $ObjectBase)
$desiredcoords = _WoWDistance(_getObjectX($handle, $ObjectBase),_getObjectY($handle, $ObjectBase))
Do
_BMWriteFloat($handle, $ClickToMove_Xpos, $XCoord)
_BMWriteFloat($handle, $ClickToMove_Ypos, $YCoord)
_BMWriteInt($handle, $ClickToMove_State, "4")
Until $desiredcoords < 5
_log("Attacking")
_Memorywrite($ClickToMove_Target, $handle, $ObjectBase, "byte[8]")
_BMWriteInt($handle, $ClickToMove + 0x1C, "7") ;interact
EndFunc ;==>_Movemob
Func _WoWDistance($cordx, $cordy)
$posx = _GetX($handle, $pBase)
$posy = _Gety($handle, $pBase)
$dis = Sqrt(($cordx - $posx) ^ 2 + ($cordy - $posy) ^ 2)
Return $dis
It seems that its grabbing incorrect X & Y locations...
Im using the following memory addresses:
Code:
Const $ClickToMove = 0x01297920 ;Updated
Const $ClickToMove_Xpos = 0x012979ac;Updated
const $ClickToMove_Ypos =0x012979b0;Updated
Const $ClickToMove_State = 0x0129793c;Updated
Const $aTargetGUID = 0x113d7a8;Updated
I think I am blind... the problem is probably staring me in the face... Any ideas?
+Rep for all helpers