region or not?

Asked by Linus Holmeros

hi, im using win xp prof

my code:

imagePath = "C:\\SikuliLib\\MSSLib.sikuli\\Images\\" # Path to all stored images
m = find(imagePath+"Sensor.png")
w = 1000
h = 220
FKURegion = Region(m.getX()-20,m.getY()-10,w,h)

FKURegion.exists(Pattern(imagePath+"SystemPreProcess.png").similar(0.95))
click(getLastMatch())

when I use FKURegion.exists, the click command under it does not work. If i delete FKURegion the click goes through. can some one explain this to me why i shouldn´t use a region.

thanx =)

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
Linus Holmeros
Solved:
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said :
#1

getLastMatch() uses the default Region Screen(0), but in your case you restricted the exists() to the Region FKURegion.

So you have to say:
click(FKURegion.getLastMatch())

since the match is stored with the Region that was used to search in.

Revision history for this message
Linus Holmeros (linus-holmeros) said :
#2

Perfect Thanx!!!!