sikuli-driver team mailing list archive
-
sikuli-driver team
-
Mailing list archive
-
Message #46889
Re: [Question #667921]: if wait(img1) or wait(img2) in statement
Question #667921 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/667921
Status: Open => Answered
masuo proposed the following answer:
I think onAppear() or findAny() is useful for your case.
http://sikulix-2014.readthedocs.io/en/latest/region.html#find-more-than-one-image-in-a-region-at-the-same-time
http://sikulix-2014.readthedocs.io/en/latest/region.html#Region.onAppear
[example findAny()]
imagelist = ["image000.png","image001.png"]
sleeptm = 1 #ajust according to what you want to do
while True:
idlist = []
matchlist = findAny(imagelist)
if len(matchlist)>0:
for m in matchlist:
idlist.append(m.getIndex())
break
sleep(sleeptm)
for id in idlist:
print imagelist[id] + " was found"
--
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.