Question about tolerance changing via script

Asked by Don S

I'm trying to find an image using tolerance so that I can click it and know that it was clicked properly. My code right now is

if exists("GaffeUnselected%d" %(game_number)):
    print("Button has not been pressed")
click("GaffeUnselected%d" %(game_number))
if exists("GaffeUnselected%d" %(game_number)):
    print("Button has not been pressed")
elif exists("GaffeSelected%d" %(game_number)):
    print("Button has been pressed")

I want the tolerance to be 96 or .96 for these images, but wherever I add that (either via .similar(.96) or exact(96) I get an error and it isn't running properly. I'm a beginner to Python, so any code examples for this would be much appreciated ^__^

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
Don S
Solved:
Last query:
Last reply:
Revision history for this message
masuo (masuo-ohara) said :
#1

Use SikuliX IDE and click image in editer pane, pattern setting window open.
Then select matching preview tab and move slider to change minimum similarity.
Switch off [Show ThumbNails], pattern setting will be shown.

like this:
click(Pattern("1530562928013.png").similar(0.96))

Revision history for this message
Don S (toonroxas) said :
#2

Thanks for the help!!