← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #206657]: Wait for image A or B or C forever, then take action accordingly

 

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

RaiMan posted a new comment:
It does not help, to always repost the same script.

Talk about, what you want to do:

- do you want to repeat the whole script x times?

- or only part of it under some conditions? (e.g. the part in while
True: )

- or what?

use some pseudo code, to show your intention.

e.g. (your script)

do(start application)
do(set up the regions and observers A ... D)
while True: # loop 1
    do(start observers A ... D)
    wait(for one of the events A ... D)
    if event A: do(something) and exit(loop 1)
    if event B: do(something) and exit(loop 1)
    if event C:
        do: something
        while True: # loop 2
            do(set up the regions and observers E ... G)
            do(start observers E ... G)
            wait: for one of the events E ... G 
            if event E: do(something) and exit(loop 2)
            if event F: do(something) and exit(loop 2)
            if event G: do(something) and exit(loop 2)
        # end of loop 2    
    if event d: do something and exit(loop 1)
# end of loop 1

and it would still be readable without indents.

This is your current workflow in a compact form and it shows, that with
event C you only leave the inner loop 2 and then continue with loop 1
(which might be your intention)

So show in the above compact workflow, what you want to repeat n times.

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