How do I get Observe to pause?
I have a script that is working in every way but I can't get Observe() to pause or end and restart while actions take place.
I am waiting for a change onscreen to occur. When it does, It fires off the ClickVideo() event. This event also changes the screen briefly. So I need Observer to stop, for about 5 seconds, while this happens then start up again.
I tried using wait(5) in several key spots, but this wasn't pausing Observe(). I then added a stopObserver() in a couple of places but couldn't get that to work.
Can you tell me what I am doing wrong?
R1 = find(Pattern(
R2 = find("147025378
B1 = Region(R2.x+21, R2.y+18, 72, 77)
B2 = Region(R2.x+104, R2.y+18, 72, 77)
B3 = Region(R2.x+190, R2.y+18, 72, 77)
B4 = Region(R2.x+273, R2.y+18, 72, 77)
Watched = 0
vSet = 1
#Change video set
def ClickSet(event):
global vSets
if vSets == 2:
if vSets == 3:
if vSets == 4:
if vSets == 5:
if vSets == 6:
wait(5)
#click next video
def ClickVideo(event):
R1.
global Watched
Watched = Watched + 1
while exists(
if B1.exists(
if B2.exists(
if B3.exists(
if B4.exists(
wait(3)
if not exists(
#start next set
vSet = vSet + 1
ClickSet()
B1.click()
wait(5)
if exists(
Watched = Watched - 1
while Watched <= 500:
wait(5)
#watch for change in status
R1.onChange(50, ClickVideo)
R1.observe()
Please and Thank You
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- SikuliX Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- David
- Solved:
- Last query:
- Last reply: