← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #176416]: waitVanish waits the maximum time even though the image has already vanished

 

Question #176416 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/176416

RaiMan posted a new comment:
This would do the same:

v.waitVanish(Pattern("image.png").similar(0.9),60)

waitVanish() returns after the first search attempt, if image is not
there.

Using exists() before only makes sense if there would be more to do if
image exists and/or you need the match afterwards for some reason
(v.getLastMatch()).

BTW: when using if exists(), it makes sense, to set the waiting time to
0, to reduce the delay to the time of one search (in your case about 0.3
seconds vs. 3 seconds).

my version in case the exists() is really needed:

img = Pattern(img).similar(0.9)
if (v.exists(img, 0)):
     v.waitVanish(img,60)

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.