Advertisement
Guest User

Untitled

a guest
Jun 24th, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 0.58 KB | None | 0 0
  1. Func MoveTo($x, $y, $random = 50)
  2.     Local $iBlocked = 0
  3.  
  4.     $cbType = "float"
  5.  
  6.     MoveEx($x, $y, $random)
  7.     CmdCB($CA_GETCOORDS, -2)
  8.    
  9.     $notstucked = True
  10.  
  11.     Do
  12.         Sleep(1500)
  13.         $oldCoords = $cbVar
  14.         $cbType = "int"
  15.         CmdCB($CA_GETDEAD)
  16.         If $cbVar[0] = 1 Then Return
  17.         $cbType = "float"
  18.         CmdCB($CA_GETCOORDS, -2)
  19.         If $oldCoords[0] = $cbVar[0] AND $oldCoords[1] = $cbVar[1] Then
  20.             $iBlocked += 1
  21.  
  22.             If $iBlocked > 4 Then
  23.                 $notstucked = False
  24.                 ExitLoop
  25.             EndIf
  26.  
  27.         EndIf
  28.     Until ComputeDistance($cbVar[0], $cbVar[1], $x, $y) < 250
  29.  
  30.     Return $notstucked
  31. EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement