u better also add the condition that moveto() ends if mapstate (ca_getmaploading) changes cuz the func sometimes doesnt end if u choose "wrong" coords behind a portal
just add this before the "do":
Code:
$cbType = "int"
$mState = CmdCB($CA_GETMAPLOADING)
$mStateOld = $mState[0]
and this after "do" but before "until":
Code:
$cbType = "int"
$mState = CmdCB($CA_GETMAPLOADING)
and this in the same line as "until":
Code:
Or $mState[0] <> $mStateOld
if ur using sune's func it'd be like this:
Code:
Func MoveTo($x, $y, $random = 50)
Local $iBlocked = 0
$cbType = "int"
$mState = CmdCB($CA_GETMAPLOADING)
$mStateOld = $mState[0]
$cbType = "float"
MoveEx($x, $y, $random)
CmdCB($CA_GETCOORDS, -2)
Do
Sleep(250)
$oldCoords = $cbVar
$cbType = "int"
CmdCB($CA_GETDEAD)
If $cbVar[0] = 1 Then Return
$cbType = "float"
CmdCB($CA_GETCOORDS, -2)
If $oldCoords[0] = $cbVar[0] AND $oldCoords[1] = $cbVar[1] Then
$iBlocked += 1
MoveEx($x, $y, $random)
EndIf
$cbType = "int"
$mState = CmdCB($CA_GETMAPLOADING)
Until ComputeDistance($cbVar[0], $cbVar[1], $x, $y) < 250 OR $iBlocked > 20 Or $mState[0] <> $mStateOld
EndFunc
__________________________________________________ _________________________________
Quote:
Originally Posted by SuneC
Which is due to the fact, that GWCA only sends the Move packet, which doesn't make the client aware that it's actually moving :D it will update during the move or when it reaches the location no matter what though.
If you are having issues with the $iBlocked variable, simply comment/delete it out.
|
i didnt mean to say anything against gwca
just wanted to tell that that case could happen