← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #201896]: Return back to?

 

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

RaiMan posted a new comment:
some comments on your solution:

-- YOUR IMAGE
you are using YOUR IMAGE everywhere, but I doubt, that it is always the same image.
So it is hard to see the workflow, if you do not know the mining game.

So it would help, to have more specific "image names" (e.g. ore-image,
mine-image, ...)

-- the loop
Mine and Ore are evaluated once before the loop (and never again!).

Ore: If it exists at the beginning, the loop is entered. If it does not exist, the loop is skipped.
Mine: Only if Mine existed before starting the loop, the <if Mine:> block is processed (Mine is never again evaluated!)

-- going back to your first solution

This should do what you want:

while True: # loops forever
    while exists("MYIMAGE"):
        rightClick("IMAGE")
        click("IMAGE")
        wait(1)
    else:
        while exists("IMAGE"):
            wait("IMAGE", FOREVER)
            click("IMAGE")
            wait(10)

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