Dim $aAll[101][2] = [[100]], $iLeft = 0, $iTop = 0, $iRight = 200, $iBottom = 200, $iColor = 0xFFFFFF, _
$iCount = 0, $sText = 'Color: 0x' & Hex($iColor, 6) & ', coordinates (all '
For $i = $iLeft To $iRight
For $j = $iTop To $iBottom
If PixelGetColor($i, $j) = $iColor Then
$iCount += 1
If $iCount = $aAll[0][0] Then
ReDim $aAll[$aAll[0][0] + 101][2]
$aAll[0][0] += 100
EndIf
$aAll[$iCount][0] = $i
$aAll[$iCount][1] = $j
EndIf
Next
Next
If $iCount Then
ReDim $aAll[$iCount + 1][2]
$aAll[0][0] = $iCount
$sText &= $aAll[0][0] & '):' & @CRLF
For $i = 1 To $aAll[0][0]
$sText &= $i & '. X: ' & $aAll[$i][0] & ', Y: ' & $aAll[$i][1] & @CRLF
Next
$sText &= '---------------------------'
$hFile = FileOpen(@ScriptDir & '\Color.txt', 2)
FileWrite($hFile, $sText)
FileClose($hFile)
$iCount = Random(1, $aAll[0][0], 1)
MsgBox(64, 'Random', 'X: ' & $aAll[$iCount][0] & ', Y: ' & $aAll[$iCount][1])
Else
MsgBox(16, 'Error', 'No')
EndIf