Advertisement
Guest User

Untitled

a guest
Aug 20th, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 0.63 KB | None | 0 0
  1. Func _findNextCamp($posPlayer, $arrCampsX, $arrCampsY)
  2.  
  3.     Local $posCurrent
  4.     Local $posShortest
  5.     Local $iDistanceCurrent = 1
  6.     Local $iDistanceShortest = 1
  7.  
  8.     For $i = 0 To UBound($arrCampsX) - 1
  9.         $posCurrent = _buildPoint($arrCampsX[$i], $arrCampsY[$i])
  10.         $iDistanceCurrent = _calculatePointDistance($posPlayer, $posCurrent)
  11.         _tt("Current Distance: " &$iDistanceCurrent)
  12.         Sleep(1000)
  13.         If Int($iDistanceShortest) >= Int($iDistanceCurrent) Then
  14.             $iDistanceShortest = $iDistanceCurrent
  15.             $posShortest = $posCurrent
  16.             _tt("Distance Updated")
  17.             Sleep(1000)
  18.         EndIf
  19.     Next
  20.  
  21.     Return $posShortest
  22. EndFunc   ;==>_findNextCamp
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement