#include <Array.au3>
HotKeySet("{ESC}","ExitApp")
Func ExitApp()
Exit
EndFunc
Dim $aResult[1001][2] = [[1000]], $X = 161, $Y = 211, $Right = 834, $Bottom = 532, $iColor = 0x000000
$iCount = 0
$sTitle = '' ; заголовок
$hWin = WinWait($sTitle, '', 3)
if not $hWin Then
MsgBox(16, 'Error', 'Окно не найдено')
Exit
EndIf
If not WinActive($hWin) Then
WinActivate($hWin)
WinActive($hWin)
EndIf
For $j = $Y To $Bottom
For $i = $X To $Right
if PixelGetColor($i, $j, $iColor) = $iColor Then
$iCount += 1
MouseClick("Left", $i, $j, 1, 0)
If $iCount = $aResult[0][0] Then
$aResult[0][0] += 1000
ReDim $aResult[$aResult[0][0] + 1][2]
EndIf
$aResult[$iCount][0] = $i
$aResult[$iCount][1] = $j
EndIf
Next
Next