Code: Select all
^Del::
CoordMode, pixel,screen
CoordMode, mouse,screen
Loop
{
PixelSearch, Px, Py, %MX%, %MY%, %MXend%, %MYend%, 0x675F2A, 3, Fast
if !ErrorLevel
{
MouseClick, left, %Px%, %Py%, 1, 2
ImageSearch, Px, Py, %MX%, %MY%, %MXend%, %MYend%, *50 %remove1%
if !ErrorLevel
{
MouseClick, left, %Px%, %Py%, 1, 2
Sleep, 200
ImageSearch, Px, Py, %MX%, %MY%, %MXend%, %MYend%, *50 %remove2%
if !ErrorLevel
{
MouseClick, left, %Px%, %Py%, 1, 2
Sleep, 500
}
}
else
Sleep, 450
}
}
In 50% of time it cant find 2nd image and loop breaking at PixelSearching.
Is it possible to make every step in a script being separate? Like find Pixel, stop looking for that pixel, start looking for Image1 when it found stop looking for Image1 and start looking Image2 when it found stop looking for it and start looking for Pixel?
I tried some While and goSub options. But i have serious lack of knowlege.