← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #268175]: Loop two different actions in Sikuli forever

 

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

Hashtag123 gave more information on the question:
So here is my approach and it works like I want it to (but too slow):

setAutoWaitTimeout(0)
wait(10)
while True:
    while True:
        if not exists(Pattern("02_right.png").similar(0.85)):
            type(Key.LEFT)
        else:
            type(Key.RIGHT)
            break
    while True:
        if not exists(Pattern("04_left.png").similar(0.85)):
            type(Key.RIGHT)
        else:
            type(Key.LEFT)
            break

If the image exists, the actions comes very fast but if it doesnt exist
it takes too long (should be as close to instant as possible).

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