Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Func MoveTo($x, $y, $random = 50)
- Local $iBlocked = 0
- $cbType = "float"
- MoveEx($x, $y, $random)
- CmdCB($CA_GETCOORDS, -2)
- $notstucked = True
- Do
- Sleep(1500)
- $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
- If $iBlocked > 4 Then
- $notstucked = False
- ExitLoop
- EndIf
- EndIf
- Until ComputeDistance($cbVar[0], $cbVar[1], $x, $y) < 250
- Return $notstucked
- EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement