Hello,
I have a question about ImageSearch. So let's say I have six images (Images A, B, C, D, E, F) and I have a script that said that if at least two of those six images were present, it would do something like send right mouse button.
How would I go about this? I know I could make a looong script that involves a lot of errorlevels, but there has to be a better, more efficient way. Something with a lot of {or} commands or something?
Also, is there any way to make my script from above not happen if another image is present (Image 6)? So even if at least two of Images A, B, C, D, E, or F are present, it doesn't do anything as long as Image 6 is present.
Questions regarding multiple Imagesearches in a list Topic is solved
- Blackholyman
- Posts: 1293
- Joined: 29 Sep 2013, 22:57
- Location: Denmark
- Contact:
Re: Questions regarding multiple Imagesearches in a list
example:
Code: Select all
images := ["c:\image1.jpg","c:\image2.jpg","c:\image3.jpg","c:\image4.jpg","c:\image5.jpg"]
images_found:=0
for key, value in images
{
ImageSearch, OutputVarX, OutputVarY, 0, 0, A_Width, A_Height, *30 c:\image6.jpg
if (Errorlevel != 0)
{
ImageSearch, OutputVarX, OutputVarY, 0, 0, A_Width, A_Height, *30 %value%
if (Errorlevel = 0)
images_found++
}
sleep 100
}
if (images_found >= 2)
MouseClick, R
Courses on AutoHotkey
My Autohotkey Blog
Re: Questions regarding multiple Imagesearches in a list
Thank you so much! I'll test it tomorrow and tell you the resultsBlackholyman wrote:example:Code: Select all
images := ["c:\image1.jpg","c:\image2.jpg","c:\image3.jpg","c:\image4.jpg","c:\image5.jpg"] images_found:=0 for key, value in images { ImageSearch, OutputVarX, OutputVarY, 0, 0, A_Width, A_Height, *30 c:\image6.jpg if (Errorlevel != 0) { ImageSearch, OutputVarX, OutputVarY, 0, 0, A_Width, A_Height, *30 %value% if (Errorlevel = 0) images_found++ } sleep 100 } if (images_found >= 2) MouseClick, R
Who is online
Users browsing this forum: mikeyww and 149 guests