@ahmic/autoit-js
    Preparing search index...

    Function PixelSearch

    • Searchs for a given pixel within the specified region.

      The actual AU3_PixelSearch function from AutoIt appears to be broken so it has been reimplemented here using Windows GDI32 and User32 libraries.

      Parameters

      • left: number

        The X coordinate of the left edge of the rectangle.

      • top: number

        The Y coordinate of the top edge of the rectangle.

      • right: number

        The X coordinate of the right edge of the rectangle.

      • bottom: number

        The Y coordinate of the bottom edge of the rectangle.

      • color: number

        The color to search for, in 0xRRGGBB format.

      • shadeVariation: number = 0

        The allowed variation in color shades (default is 0).

      • step: number = 1

        The step value for the search (default is 1).

      Returns Promise<IPoint>

      A promise that resolves to an IPoint object with the coordinates of the found pixel. If the pixel is not found, the promise resolves to a point with coordinates (-1, -1).

      import { PixelSearch } from '@ahmic/autoit-js';

      const result = await PixelSearch(0, 0, 100, 100, 0xFF0000);

      console.log(result); // Output: { x: 50, y: 50 }