← Back to team overview

sikuli-driver team mailing list archive

[Question #674136]: Loop break by if exists ("path to image") not work :(

 

New question #674136 on Sikuli:
https://answers.launchpad.net/sikuli/+question/674136

Hi all!

I have sth like below:

for n in range(10):
        type (Key.F6, KeyModifier.SHIFT)
        wait(2)
        for n in range(4):
            type(Key.TAB)
        type(Key.ENTER)
        x=0
        y=+16
        mouseMove(x,y)
        mouseDown(Button.LEFT)
        mouseUp(Button.LEFT)
        wait(1)
    if exists(Region(86,355,431,144)):
        find("1537344880118.png").click()
        break;

Without "if exists" it works perfect. But problem is that i not always have the same number of area which should be marked. So I want stop loop when message about missing area will show inside program.

I have such warn statement:

[error] script [ LOOP01 ] stopped with error at line --unknown--
[error] Error caused by: IndentationError: ('unindent does not match any outer indentation level', ('C:\\Users\\ZIELIN~1\\AppData\\Local\\Temp\\Sikulix_487760013\\sikuli-4482208172387115684.py', 15, 4, ' if exists(Region(86,355,431,144)):\n')) 

Any advice?


-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.