program FindAllBitmaps; var TheBox: TBoxArray; x, y, I: Integer; function AddBox(var TheBox: TBoxArray; x, y: Integer; SizeOfBox: Integer); begin SetLength(TheBox, I); TheBox[I].x1 := x - SizeOfBox; TheBox[I].y1 := y - SizeOfBox; TheBox[I].x2 := x + SizeOfBox; TheBox[I].y2 := y + SizeOfBox; end; function FindBitmaps(var x, y: Integer; TheBmp: Integer; Mask: Boolean): array of TPointArray; var AllPoints: array of TPointArray; Z: Integer; begin repeat if Mask then //Need to FindBitmapMaskToleranceSkipBoxArray, or bankslots if FindBitmapMaskTolerance(TheBmp, x, y, MSX1, MSY1, MSX2, MSY2, 10, 10) then GoOn := True; else if FindBitmapToleranceIn(TheBmp, x, y, MSX1, MSY1, MSX2, MSY2, 10) then GoOn := True; if GoOn then begin Inc(I); SetLength(AllPoints, I); AllPoints[I].x := x; AllPoints[I].y := y; AddBox(TheBox, x, y, 10); end; until GoOn = False; if Length(AllPoints - 1) > -1 then begin Writeln('Bitmaps found at: '); for Z := 0 to Length(AllPoints - 1) do Writeln('[ ' + IntToStr(AllPoints[Z].x) + ', ' + IntToStr(AllPoints[Z].y) + ' ]'); end else begin Writeln('No bitmaps found'); Exit; end; Result := AllPoints; end; begin end.