can hover take place within a region?

Asked by arminius

I have a "hover(Pattern("14412969663.png").similar(0.44).targetOffset(-7,14))" going off but the screenshot it's looking for can change slightly over a perioud of time.
lowering the match to far leads to false positives.
I solved the problem with this.
wait(Pattern("14412969663.png").similar(0.30).targetOffset(-135,4), 1800)
click(Pattern("14412969663.png").similar(0.30).targetOffset(-135,4))

But this is taking longer then I care for, the image it's looking for only appears in about a 5th of the screen, so if I could have it all going of in a region I could reduce the wait time down to 2 mins maybe.

I get my knuckles wrapped on here if I don't prove I tried to work it out, so I had a look on http://doc.sikuli.org/region.html
Region.find(). looked like what I'm after, but it didn't explain how you define the region then incorporate Region.find().
It's really not friendly to people who are still learning to code.

Question information

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

Figured it out, was way easier then I assumed it would be.