Region detects no motion

Asked by Ben

I want to have sikuli detect when a region stops changing. It's text that is changing and when it stops changing i'd like the script to then carry on.

I have no clue where to start and basic instructions would be much appreciated due to my lack of knowledge of the language.

Question information

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

reg = <... someRegion ...>

while True:
    img = capture(reg)
    wait(1)
    if reg.exists(Pattern(img).exact(), 0):
        break

Revision history for this message
Ben (benpersonal97) said :
#2

Thank you I'll try this out later. As I'm very new to this program and language, what do I need to change within this code? Such as where do I insert. The region and can I just take a screenshot?

Thank you.

Revision history for this message
Best RaiMan (raimund-hocke) said :
#3

at

reg =

you might insert a Region shot of the region to observe.

the rest works as is.

with the wait(1) it currently would stop watching, if the region does not change it's content for at least one second.
If needed adjust this value.

Revision history for this message
Ben (benpersonal97) said :
#4

Thank you! I will try it out and see how it goes. Also, if i want to loop the entire process when it reaches the last line how do i do this? As well as this i'd like it if at every line if something were to go wrong it just starts over as i need it to be running continuously.

Revision history for this message
Ben (benpersonal97) said :
#5

Thanks RaiMan, that solved my question.