Re: [Sikuli-driver] [Question #187104]: Trying to sense when the screen stops changing

2021-10-21 Thread RaiMan
Question #187104 on SikuliX changed:
https://answers.launchpad.net/sikuli/+question/187104

RaiMan posted a new comment:
@Spice Agent

- observe() runs until timeOut and returns False if no changes have been
detected.

- if changes are detected, the handler is called

- if the obeserver is stopped in the handler, observe() returns true,
but if it does not stop the obeserver, it runs till timeout and returns
False

So if you want to get a feedback, you have to setup your handler
accordingly.

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

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #187104]: Trying to sense when the screen stops changing

2021-10-21 Thread RaiMan
Question #187104 on SikuliX changed:
https://answers.launchpad.net/sikuli/+question/187104

RaiMan posted a new comment:
only to be complete: this worked for me (2.0.5):

class X(unittest.TestCase):

def changed(self, e):
print "handler"
self.changes = e.changes
e.stopObserver()

def activity(self):
self.changes = None
r = Region(+41,0,230,151)
r.highlight(3)
print("Checkpoint 1") #Gets Here
r.onChange(self.changed)
print("Checkpoint 2") #Never Gets Here

while True:
print "observing"
retObs = r.observe(5)
if retObs:
print "changes:", self.changes
self.changes = None
break
else:
break
print "observe returned:", retObs

def PDASuite():
PDASuite = unittest.TestSuite()
PDASuite.addTest(X("activity"))
return PDASuite

unittest.TextTestRunner(verbosity=2).run(PDASuite())

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

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #187104]: Trying to sense when the screen stops changing

2021-10-21 Thread Spice Agent
Question #187104 on SikuliX changed:
https://answers.launchpad.net/sikuli/+question/187104

Spice Agent posted a new comment:
It would be useful if observe() returned FALSE if it timed out... then I
could loop until FALSE was returned (meaning no more changes are
occurring).

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

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #187104]: Trying to sense when the screen stops changing

2020-12-01 Thread sam curren
Question #187104 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/187104

sam curren posted a new comment:
I have had the same issue but this thread had me solved it.

https://ghdsports.net/

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

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #187104]: Trying to sense when the screen stops changing

2020-07-20 Thread GBWhatsapp
Question #187104 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/187104

GBWhatsapp posted a new comment:
Thanks for the information that you share with us, i really like you r
content about this https://gbwhatsapp.fun/

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

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #187104]: Trying to sense when the screen stops changing

2020-07-06 Thread deezplox
Question #187104 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/187104

deezplox posted a new comment:
try python basics 
https://deezloader.info

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

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #187104]: Trying to sense when the screen stops changing

2020-04-21 Thread Krishna Loyal
Question #187104 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/187104

Krishna Loyal posted a new comment:
Added this  but result is not the same
import unittest
import HTMLTestRunner

class X(unittest.TestCase):

changes = None

https://fabulaes.com/elizabeth-lail/
https://fabulaes.com/

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

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #187104]: Trying to sense when the screen stops changing

2020-02-05 Thread Nick Ben
Question #187104 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/187104

Nick Ben posted a new comment:
Uuups, Python basics ;-)

r.onChange(self.changed) this one is not working as well. anyone
update latest code https://ikmspico.xyz";>here?

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

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #187104]: Trying to sense when the screen stops changing

2020-02-04 Thread Nick Ben
Question #187104 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/187104

Nick Ben posted a new comment:
Hey mate, I'm even getting error on using
r.onChange(self.changed) as well. Any solution?

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

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #187104]: Trying to sense when the screen stops changing

2019-12-30 Thread Karl Willson
Question #187104 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/187104

Karl Willson posted a new comment:
RaiMan thank you so much for this. I was also facing this issue. but I
don't get any solution. You just share a quick way to solve this issue.
keep rocking man. Keep helping us.

thanks once again

Regards
Karl  https://oceanofgamesy.com/ https://getintopc.app/

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

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #187104]: Trying to sense when the screen stops changing

2019-11-09 Thread milesmsith Smith
Question #187104 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/187104

milesmsith Smith posted a new comment:
ank you so much for this. I was into this issue and tired to   tinker around to 
check if its possible but couldnt get it done. Now that i have seen the way you 
did it, thanks guys
with
regards
https://vidmate.onl/ https://messenger.red/ https://showbox.run/

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

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #187104]: Trying to sense when the screen stops changing

2012-02-11 Thread RaiMan
Question #187104 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/187104

RaiMan posted a new comment:
Uuups, Python basics ;-)

r.onChange(self.changed)

since you want to reference a function, that is defined inside the
current class.

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #187104]: Trying to sense when the screen stops changing

2012-02-10 Thread Mychal Miller
Question #187104 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/187104

Description changed to:
I'm trying to setup a script that senses when a region of the screen
stops changing...

First I tried:

   spot = Region(100,100,50,50) 
   wait(1)
   while Region(100,100,50,50) <> spot: 
   spot = Region(100,100,50,50)
   wait(1)
   # should get here when the region stops changing

... but it didn't work.  Not sure why not.

So then I tried an observer...

click(Location(mtx,mty))
#watch the screen for change... will end when not moving...
with Region(669,359,216,164) as r:
# any change in r larger than 25 pixels would trigger the changed function
onChange(25, changed)
observe(4,background=False)
global chgs
popup("changes = " + str(chgs))
r.stopObserver()
wait(1)

But the behavior is that changed is called just once and I'm not sure
how to get it to wait/repeat.

It would be useful if observe() returned FALSE if it timed out... then I
could loop until FALSE was returned (meaning no more changes are
occurring).

Any suggestions would be most welcome!


Edit: reopen question

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #187104]: Trying to sense when the screen stops changing

2012-02-10 Thread Mychal Miller
Question #187104 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/187104

Description changed to:
I'm trying to setup a script that senses when a region of the screen
stops changing...

First I tried:

   spot = Region(100,100,50,50) 
   wait(1)
   while Region(100,100,50,50) <> spot: 
   spot = Region(100,100,50,50)
   wait(1)
   # should get here when the region stops changing

... but it didn't work.  Not sure why not.

So then I tried an observer...

click(Location(mtx,mty))
#watch the screen for change... will end when not moving...
with Region(669,359,216,164) as r:
# any change in r larger than 25 pixels would trigger the changed function
onChange(25, changed)
observe(4,background=False)
global chgs
popup("changes = " + str(chgs))
r.stopObserver()
wait(1)

But the behavior is that changed is called just once and I'm not sure
how to get it to wait/repeat.

It would be useful if observe() returned FALSE if it timed out... then I
could loop until FALSE was returned (meaning no more changes are
occurring).

Any suggestions would be most welcome!

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #187104]: Trying to sense when the screen stops changing

2012-02-10 Thread Mychal Miller
Question #187104 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/187104

Mychal Miller posted a new comment:
Raiman, I tried putting your code into a function which is inside a
class and it never makes it past "r.onChange(changed)".  I'm certain
that I'm not calling "changed" correctly, but I've tried it a bunch of
ways and none of them seem to work.

When I run the code you posted above as an individual script it runs
fine, but inside of my class/function it doesn't. It reaches the first
checkpoint, but doesn't reach the second checkpoint (see popups in
code).


import unittest
import HTMLTestRunner

class X(unittest.TestCase):

changes = None

def changed(self, e):
#print " changed"+str(e.type)+"#"
global changes
changes = e.changes

def activity(self):
r = Region(324,176,621,526)
popup("Checkpoint 1")#Gets Here
r.onChange(changed(self))
popup("Checkpoint 2")#Never Gets Here

while True:
r.observe(2)
if changes:
print "changes:", str(changes)
changes = None
else:
break

def PDASuite():
PDASuite = unittest.TestSuite()
PDASuite.addTest(X("activity"))
return PDASuite

if __name__ == '__main__':
#unittest.main()
unittest.TextTestRunner(verbosity=2).run(PDASuite())

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #187104]: Trying to sense when the screen stops changing

2012-02-07 Thread jay marm
Question #187104 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/187104

Status: Answered => Solved

jay marm confirmed that the question is solved:
Raimund... Thank you! As usual you hit the mark first try.  Thank you
for saving me some frustration!!

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #187104]: Trying to sense when the screen stops changing

2012-02-07 Thread jay marm
Question #187104 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/187104

jay marm confirmed that the question is solved:
Thanks RaiMan, that solved my question.

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #187104]: Trying to sense when the screen stops changing

2012-02-07 Thread RaiMan
Question #187104 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/187104

Status: Open => Answered

RaiMan proposed the following answer:
this might do what you want.
You have to integrate it into your script accordingly.

changes = None
def changed(e):
print " changed"+str(e.type)+"#"
global changes
changes = e.changes

r = Region(0,0,200,200)

r.onChange(changed)

while True:
r.observe(2)
if changes: 
print "changes:", str(changes)
changes = None
else:
break

print "the end"

It worked for me.
Since I had no moving object I just dragged a window so that the region r 
changed. When I stopped dragging, the script ended.

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


[Sikuli-driver] [Question #187104]: Trying to sense when the screen stops changing

2012-02-07 Thread jay marm
New question #187104 on Sikuli:
https://answers.launchpad.net/sikuli/+question/187104

I'm trying to setup a script that senses when a region of the screen stops 
changing...

First I tried:

   spot = Region(100,100,50,50) 
   wait(1)
   while Region(100,100,50,50) <> spot: 
   spot = Region(100,100,50,50)
   wait(1)
   # should get here when the region stops changing

... but it didn't work.  Not sure why not.

So then I tried an observer...

click(Location(mtx,mty))
#watch the screen for change... will end when not moving...
with Region(669,359,216,164) as r:
# any change in r larger than 25 pixels would trigger the changed function
onChange(25, changed)
observe(4,background=False)
global chgs
popup("changes = " + str(chgs))
r.stopObserver()
wait(1)

But the behavior is that changed is called just once and I'm not sure how to 
get it to wait/repeat.  

It would be useful if observe() returned FALSE if it timed out... then I could 
loop until FALSE was returned (meaning no more changes are occurring).

Any suggestions would be most welcome!


-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp