← Back to team overview

sikuli-driver team mailing list archive

[Question #656216]: How to set observe() to run in background forever?

 

New question #656216 on Sikuli:
https://answers.launchpad.net/sikuli/+question/656216

Hi,

I've been trying to write to write a code to observe a region in background forever and act when an image appears.

R = selectRegion()
def axn(event):
	R.highlight(3)
R.onAppear(img1,axn)
R.observe(FOREVER,Backgroud=True)

When i try R.observe(FOREVER,Backgroud=True), i get an error message that observe() takes 1 argument, not 2.

I checked out a similar question https://answers.launchpad.net/sikuli/+question/271996 and tried using R.observeInBackground as per the answer to that question.
A plain R.observeInBackground() without any time specified returns the error  :- [error] TypeError ( observeInBackground(): expected 1 args; got 0 ). 
R.observeInBackground(FOREVER) results in well, basically nothing - the script just doesn't seem to be running at all (sikuli IDE is visible and editable and the run button is active and clickable). The event handler didn't get called even when the image in question eventually appeared.

Am i doing something wrong?

Thanks in advance

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