Code: Select all
//===================The first loop
Let>c=0
Let>m=1
Repeat>m
if>m=1,CheckNext1
Let>XMax=100
Let>YMax=100
Let>X=98
Repeat>X
Let>X=X+1
Let>Y=98
Repeat>Y
Let>Y=Y+1
GetPixelColor>X,Y,c
MessageModal>loop No 1, main loop repetition No= %m%
If>c=456765,DoIt1,DontDoIt1
Label>DoIt1
MouseMove>X,Y
LClick
Wait>0.1
MouseMove>%m%,%m%
LClick
Wait>0.5
Label>DontDoIt1
Until>Y=YMax
Until>X=XMax
Label>CheckNext1
Let>m=m+1
Until>m=5
//===================End - the first loop
//===================The second loop
Let>c=0
Let>m=1
Repeat>m
if>m=2,CheckNext2
Let>XMax=200
Let>YMax=200
Let>X=198
Repeat>X
Let>X=X+1
Let>Y=198
Repeat>Y
Let>Y=Y+1
GetPixelColor>X,Y,c
MessageModal>loop No 2, main loop repetition No= %m%
If>c=456786,DoIt2,DontDoIt2
Label>DoIt2
MouseMove>X,Y
LClick
Wait>0.1
MouseMove>%m%,%m%
LClick
Wait>0.5
Label>DontDoIt2
Until>Y=YMax
Until>X=XMax
Label>CheckNext2
Let>m=m+1
Until>m=5
//===================End - the second loop
"Loop No 1, main loop repetition No= 2" -> four times
"Loop No 1, main loop repetition No= 3" -> four times
"Loop No 1, main loop repetition No= 4" -> four times
"Loop No 2, main loop repetition No= 1" -> four times
"Loop No 2, main loop repetition No= 3" -> four times
"Loop No 2, main loop repetition No= 4" -> four times
"The End."
And what actually happens:
"Loop No 1, main loop repetition No= 2" -> four times
"Loop No 1, main loop repetition No= 3" -> four times
"Loop No 1, main loop repetition No= 4" -> four times
"Loop No 2, main loop repetition No= 1" -> one time
"Loop No 1, main loop repetition No= 1" -> several times
"Loop No 1, main loop repetition No= 2" -> four times
"Loop No 1, main loop repetition No= 3" -> four times
"Loop No 1, main loop repetition No= 4" -> four times
"Loop No 2, main loop repetition No= 1" -> one time
"Loop No 1, main loop repetition No= 1" -> several times
and so on......
The first loop appears to work properly. But when it comes to start the second one only the beginning is executed and then everything starts all over again with unexpected results. Why is that?