What is the solution if I need to search more than one pictures in a region?

Asked by lynn

Hi, during my testing, I met a problem of finding picture in a region.

If I need to search more than one pictures, like pic1, pic2 in a certain region. If any of them is matched, then I can take next step such as region.click() etc.

My first idea is set a loop to go through each item of the picture list, it stops whenever the item is matched. Is there any other simple way to do it? Thanks

Question information

Language:
English Edit question
Status:
Answered
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said :
#1

Not a feature currently.

indeed you have to use some loop around

if reg.exists(image, 0): break

If you do not know that already:
exists(image, 0)
returns immediately after on search try and does not wait the standard waiting time.

So depending on how many images are checked, this can still be rather fast.

Version 2 will have a feature for that, internally multithreaded.

Can you help with this problem?

Provide an answer of your own, or ask lynn for more information if necessary.

To post a message you must log in.