单击像素搜索中的特定区域?

click specific area inside pixelsearch?

我的脚本工作正常。但大多数时候很难点击目标像素。因为它主要只点击侧面。(我猜它只点击它看到的第一个像素。这是一个正方形的侧面像素)知道如何点击像素搜索内部的中间区域吗?

Loop {
;<<-- this is the color of green boxed pixel
PixelSearch, X, Y, 0, 0, %A_ScreenWidth%, %A_ScreenHeight%, 0x00FF00, 0, fast
        if(ErrorLevel=0) {
        MouseClick, left, %X%, %Y%
        sleep, 500


        }
        else {

            send {f9}

        }
    }
return

您可以简单地更改点击坐标,不是吗?

PixelSearch, X, Y, 0, 0, %A_ScreenWidth%, %A_ScreenHeight%, 0x00FF00, 0, fast
if(ErrorLevel=0) {
    newX := X + 50
    newY := Y + 50
    MouseClick, left, %newX%, %newY%
}

另一个建议:使用 ImageSearch 而不是 PixelSearch