← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #231016]: Simple Code - Exception Problem

 

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

    Status: Open => Answered

RaiMan proposed the following answer:
If you want to post code here, just copy and paste from the IDE. Do not rewrite it here.
The above sample is not Python !
 
while True: # the following block loops forever
    while exists("image.png", 0): # check once and come back
        click(getLastMatch())
        wait(5)
    if exists("image_2.png"):
        click(getLastMatch())
    wait(5) # we should wait a little to give image a chance

1. if image is there, it clicks image until it disappears
2. it clicks image_2 if it is there
3. waits 5 secs
4. starts all over at 1.

If you run this, you have to abort with abort key ot task manager

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