O código no momento, que funciona, está assim:
Code: Select all
Loop {
ImageSearch, refX, refY, 0, 0, A_ScreenWidth, A_ScreenHeight, *40 ./imgRef.png
if (ErrorLevel == 0) {
ImageSearch, WX, WY, refX-70, refY+40, refX-30, refY+80, *40 ./img.png
if (ErrorLevel == 0)
MsgBox it works
}
}
Code: Select all
FindImgPos(X1, Y1, X2, Y2, imagePathAndName) {
ImageSearch, FX, FY, %X1%, %Y1%, %X2%, %Y2%, *40 %imagePathAndName%
if (ErrorLevel = 0) {
Return {x1: FX-70, y1: FY+40, x2: FX-30, y2: FY+80}
}
Pensei em criar um arquivo .ini ao abrir o script e toda vez buscar nele, mas não sei se é a maneira mais inteligente/eficaz. Estou aberto a sugestões.
Muito obrigado!