unreliable statement

Asked by MJ

This part just isnt reliable in detection, i tried a sleep but it didn't help much
    else:
        click(Pattern("1469222076906-1.png").targetOffset(-647,497))
        if exists("1470676354473.png"):
            exit()

for n in range(1):
    reg = Region(609,140,894,766)
    if reg.exists(Pattern("1469321512445.png").similar(0.50), 0) or reg.exists(Pattern("1470254195609.png").similar(0.50), 0) or reg.exists(Pattern("1470143332576.png").similar(0.50), 0):
        click(Pattern("1469305690339.png").similar(0.90).targetOffset(-70,-9))
 # wait(.5)
        type(Key.ENTER)
        type("v", KeyModifier.CTRL)
        type(Key.ENTER)
        type("s", KeyModifier.CTRL)
    else:
        click(Pattern("1469222076906-1.png").targetOffset(-647,497))
        if exists("1470676354473.png"):
            exit()
        else:
            click(Pattern("1469206576875.png").targetOffset(-7,0))
            wait(4.0)

Thanks in advance

Question information

Language:
English Edit question
Status:
Answered
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
danman (danman) said :
#1

Hello, please give a bit more details in your question, like what exact part of the code that isn't reliable, in what way it is not reliable and so on, as much information as possible.

Revision history for this message
MJ (mjpmgr) said :
#2

The script "exit()" about 60-70% of the time, even when the "if exits" image is not on screen.

click(Pattern("1469222076906-1.png").targetOffset(-647,497))
        if exists("1470676354473.png"):
            exit()

Revision history for this message
danman (danman) said :
#3

Thanks, now I understand. I have no clue what the problem could be though, sorry. We need Raiman here! :)

Revision history for this message
MJ (mjpmgr) said :
#4

any ideas, Raiman?

Revision history for this message
masuo (masuo-ohara) said :
#5

First of all you should confirm what image is matched by exists("1470676354473.png") and confirm similarity.
You can confirm image by exists("1470676354473.png").highlight(2).
You can confirm similarity by print exists("1470676354473.png").getScore().
If the highlight image is similar, you should use pattern as well as click.

Can you help with this problem?

Provide an answer of your own, or ask MJ for more information if necessary.

To post a message you must log in.