← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #680134]: How to act on multiple changes in a region

 

Question #680134 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/680134

Mathieu Létourneau posted a new comment:
Hi RaiMan,

Thanks for answering so quickly!

By background, I meant that it's running while I'm performing other
tasks manually. I'm expecting the script to take over at a precise
moment, and control the mouse.

Let me show you the "logic" I have come up with so far :

1. Set three observers in parallel, one for each region
2. Register 6 "Region.onAppear()" events per observer, each with their own handler.

region1 = someRegion
region2 = someRegion
region3 = someRegion

def roll1():
        click(someLocation)
        wait(10)

region1.onAppear("roll1.png", roll1)
region1.observe(FOREVER)

This code seems to work on a basic level, but I can't make it work on a
larger scale for my project. It feels I'm somewhat close, but perhaps
it's more complicated than I thought?

I did manage to make a working version for one region using
region.findBest(), but it seemed like a convoluted solution when trying
to observe multiple regions at once.

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