Search image for 10 seconds
Search image for 10 seconds
Searching for a couple of images that must be done in the right order but because the images are part of gifs it sometimes misses the frame and skips an image instead of finding them in order. I need to search each image for 10 seconds before continuing to the next (duration of the gif)
Last edited by inthesky2 on 05 Apr 2016, 02:18, edited 1 time in total.
Re: Search image for 10 seconds
taken from one of my scripts.
Code: Select all
res := imgSearch(oX, oY, 0, 0, A_ScreenWidth, A_ScreenHeight, "test.png", 10) ;imagesearch test.png until it is found for 10
if res = 0
MsgBox found
ExitApp
imgSearch(ByRef oX, ByRef oY, x1, y1, x2, y2, img, t)
{
st := A_TickCount
again_:
ImageSearch, oX, oY, x1, y1, x2, y2, %img%
if errorlevel = 0
return 0
else if errorlevel = 2
return 2
else
{
Sleep, 100
if ((A_TickCount -st)/1000 > t)
return errorlevel
else
goto again_
}
}
- WalkerOfTheDay
- Posts: 710
- Joined: 24 Mar 2016, 03:01
Re: Search image for 10 seconds
Maybe a loop,10 together with sleep 10000 ?
Who is online
Users browsing this forum: downstairs, filipemb, Google [Bot], OrangeCat and 164 guests