возможность функции

Asked by dima

Здравствуйте ребята, подскажите пожалуйста , возможно ли функцию wait обобщить, тоесть ожидать не одну картинку , а ожидать список картинок, если есть другой выход подскажите пожалуйста
С Уважением Дмитрий

Question information

Language:
Russian Edit question
Status:
Answered
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
John Henckel (henckel-jonathan) said :
#1

You can set AutoWaitTimeout = False, and then use a polling loop with several "find" with complex logic. This is pseudo-code

for n = 1 to 120:
    if not find(single image) and find(list of pictures) then return success
    sleep(0.5)
return failed

This loop will wait up to 60 seconds.

Revision history for this message
rss (rssdev10) said :
#2

list = []
onAppear("123png") {|e| list << e.getMatch}
onAppear("234.png" ){|e| list << e.getMatch}

observe(10)

p list

Revision history for this message
rss (rssdev10) said :
#3

img_list = ["123.png", "234.png"]

found_list = []
img_list.each do |img|
  onAppear(img) {|e| found_list << e.getMatch}
end
observe(10)

p found_list

Can you help with this problem?

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

To post a message you must log in.