Defined function is looping
Hi
I am having an issue that makes no sense to me. The defined function ClickVideo is looping.
Yes, I do have a recursive call. But this is not where it is looping. I read on another post your comments about recursive calls. This call is only to address an error should one appear.
I added popups through out my code so I could follow it as it ran. So as it runs, this is the popups I am getting (9, 1, 2, (3,4,5, or 6), 11; 1, 2, (3,4,5, or 6), 11; 1, 2, (3,4,5, or 6), 11; etc.)
What I was expecting was (9, 1, 2, (3,4,5, or 6), 11; 9, 1, 2, (3,4,5, or 6), 11; etc.). After function runs, I am expecting it to go back to waiting for a change to region R1.
That says to me that my function is looping. Should I have a terminator on my function?
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.stopObserver()
global Watched
Watched = Watched + 1
popup("1")
if exists(
popup("2")
if B1.exists(
elif B2.exists(
elif B3.exists(
elif B4.exists(
wait(5)
else:
exit()
else:
popup("7")
#start next set
vSet = vSet + 1
ClickSet()
B1.click()
wait(5)
popup("11")
#if error appears play next video
if exists(
Watched = Watched - 1
popup("8")
#Watch 500 videos
while Watched <= 500:
popup("9")
R1.onChange(50, ClickVideo)
R1.observe()
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- SikuliX Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- masuo
- Solved:
- Last query:
- Last reply: