Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Func _determinePlayerColor($arrColors)
- Local $posCurrentColor
- Local $posTemp
- Local $iColorCurrent = 0
- Local $posX1 = 0
- Local $posY1 = 0
- Local $posX2 = 0
- Local $posY2 = 0
- ; Iterate Player Colors
- For $i = 0 To UBound($arrColors) - 1
- $iColorCurrent = $arrColors[$i]
- ; Get current color minimap position
- $posCurrentColor = _findUnitPosition($arrMiniMap,$iColorCurrent)
- ; If found, search in offset range for white circle around player
- If IsArray($posCurrentColor) Then
- $posX1 = $posCurrentColor[0] + 10
- $posY1 = $posCurrentColor[1] + 10
- $posX2 = $posCurrentColor[0] + 10
- $posY2 = $posCurrentColor[1] + 10
- $posTemp = PixelSearch($posX1, $posY1,$posX2,$posY2,$iColorPlayer,7)
- ; If $posTemp returns a position array, white circle found
- If IsArray($posTemp) Then
- _tt("Player Color Determined")
- Return $iColorCurrent
- EndIF
- EndIf
- Next
- EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement