Im trying to make a script that keep clicking on images. All these clicks are in a loop. The problem is that i end up with infinite clicks everywhere i move the mouse (desktop/taskbaer/etc)
The code is:
Code: Select all
F4::
SetDefaultMouseSpeed 30
CoordMode Pixel
loop {
ImageSearch, foundX, foundY, 0, 0, %A_ScreenWidth%, %A_ScreenHeight%,*20 c:\1.bmp
If (ErrorLevel == 0){
Click, %foundX%, %foundY%
ErrorLevel=5
}
ImageSearch, foundX, foundY, 0, 0, %A_ScreenWidth%, %A_ScreenHeight%,*20 c:\2.bmp
If (ErrorLevel == 0){
Click, %foundX%, %foundY%
ErrorLevel=5
}
else
{
ImageSearch, foundX, foundY, 0, 0, %A_ScreenWidth%, %A_ScreenHeight%,*50 2_1.bmp
If (ErrorLevel == 0){
Click, % foundX-40, %foundY%,down
MouseMove, % foundX-40, % foundY-50, 80 <--mousedrag had some issues probably from continuous clicks so ive tryed this method
Click left up
ErrorLevel=5
}
}
Sleep, 2000
ErrorLevel=5
}
return
F3::
Exit
return
I even try to change errorlevel value thinking that it will prevent it from entering all those ifs. but no luck
this script is for an android game on nox emulator. i know nox has its own macros but i does not communicate between 2 or more instances of nox so i need to create my own macro.