image search problem
Posted: 05 Mar 2018, 12:43
i need to find imgae and click it by condition
sorry for my bad english
it mean search for img1 - if find click img1
if not find - find img2 and click img2
i have did this code but it only work for few loob and then dont work
i dont know why
sorry for my bad english
it mean search for img1 - if find click img1
if not find - find img2 and click img2
i have did this code but it only work for few loob and then dont work
i dont know why
Code: Select all
`::
loop{
ImageSearch, foundX, foundY, 0, 0, %A_ScreenWidth%, %A_ScreenHeight%, C:\Users\Floq\Desktop\4.png
If(ErrorLevel == 0){
Click, %foundX%, %foundY%
Sleep, 150
Send, q
}else{
ImageSearch, aX, aY, 0, 0, %A_ScreenWidth%, %A_ScreenHeight%, C:\Users\Floq\Desktop\5.png
If(ErrorLevel == 0){
Click, %aX%, %aY%
Sleep, 150
Send, Tab key
}else{
Send, q
}
}
}
return
alt::pause