Advertisement
Guest User

Untitled

a guest
Aug 20th, 2019
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 0.90 KB | None | 0 0
  1. Func _determinePlayerColor($arrColors)
  2.  
  3.     Local $posCurrentColor
  4.     Local $posTemp
  5.     Local $iColorCurrent = 0
  6.     Local $posX1  = 0
  7.     Local $posY1  = 0
  8.     Local $posX2  = 0
  9.     Local $posY2 = 0
  10.  
  11.     ; Iterate Player Colors
  12.     For $i = 0 To UBound($arrColors) - 1
  13.  
  14.         $iColorCurrent = $arrColors[$i]
  15.         ; Get current color minimap position
  16.         $posCurrentColor = _findUnitPosition($arrMiniMap,$iColorCurrent)
  17.  
  18.         ; If found, search in offset range for white circle around player
  19.         If IsArray($posCurrentColor) Then
  20.  
  21.             $posX1 = $posCurrentColor[0] + 10
  22.             $posY1 = $posCurrentColor[1] + 10
  23.             $posX2 = $posCurrentColor[0] + 10
  24.             $posY2 = $posCurrentColor[1] + 10
  25.             $posTemp = PixelSearch($posX1, $posY1,$posX2,$posY2,$iColorPlayer,7)
  26.             ; If $posTemp returns a position array, white circle found
  27.             If IsArray($posTemp) Then
  28.                 _tt("Player Color Determined")
  29.                 Return $iColorCurrent
  30.             EndIF
  31.         EndIf
  32.     Next
  33. EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement