Pretty much I want to repeat a label>Start 10 times then move on to the next action but my repeat just keeps repeating itself.
Label>Start
Repeat>10
//Find and Left Click Center of
FindImagePos>%BMP_DIR%\image_9.bmp,SCREEN,0.7,1,XArr,YArr,NumFound,CCOEFF
If>NumFound>0
MouseMove>XArr_0,YArr_0
Wait>0.10
LClick
Endif
Unti>10
(Next action it gets stuck after until>10 and repeats instead of moving on)
//find and Left Click Center of
FindImagePos>%BMP_DIR%\image_5.bmp,SCREEN,0.7,1,XArr,YArr,NumFound,CCOEFF
If>NumFound>0
MouseMove>XArr_0,YArr_0
Wait>0.10
LClick
Endif
Here is a better explanation of what I'm trying to do ignore my pro paint skills :p
Need help with repeat
Moderators: Dorian (MJT support), JRL
- Marcus Tettmar
- Site Admin
- Posts: 7380
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Re: Need help with repeat
Should be like this:
Repeat needs a loop counter. The loop counter needs to be incremented. Until line is "Until>" not "Unti". Until needs to take a condition.
See:
https://help.mjtnet.com/article/144-how ... p-the-loop
So, your code should be something like this:
Let's look at that first loop in real english. We say set "kounter" to zero. Then Repeat ... Until our kounter equals 10. Inside the loop we add 1 to kounter (kounter becomes kounter + 1). So kounter increments by 1 for each iteration. So when it becomes 10 the Until condition (kounter=10) becomes TRUE so the loop ends.
Repeat needs a loop counter. The loop counter needs to be incremented. Until line is "Until>" not "Unti". Until needs to take a condition.
See:
https://help.mjtnet.com/article/144-how ... p-the-loop
So, your code should be something like this:
Code: Select all
Let>kounter=0
Repeat>kounter
//Find and Left Click Center of
FindImagePos>%BMP_DIR%\image_9.bmp,SCREEN,0.7,1,XArr,YArr,NumFound,CCOEFF
If>NumFound>0
MouseMove>XArr_0,YArr_0
Wait>0.10
LClick
Endif
Let>kounter=kounter+1
Until>kounter=10
//find and Left Click Center of
FindImagePos>%BMP_DIR%\image_5.bmp,SCREEN,0.7,1,XArr,YArr,NumFound,CCOEFF
If>NumFound>0
MouseMove>XArr_0,YArr_0
Wait>0.10
LClick
Endif
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
Re: Need help with repeat
I figured it out this works pretty good if anyone else has issues.
Let>k=0
Label>Start
Let>k=k+1
Actions you want to repeat
If>k<21 (change 21 to the number you want to repeat)
Wait>0.10
Goto>Start
Let>k=0
Label>Start
Let>k=k+1
Actions you want to repeat
If>k<21 (change 21 to the number you want to repeat)
Wait>0.10
Goto>Start
- Marcus Tettmar
- Site Admin
- Posts: 7380
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Re: Need help with repeat
See my reply above with a repeat/until version and link to an article on the three main ways to loop.Jimmie wrote:I figured it out this works pretty good if anyone else has issues.
Let>k=0
Label>Start
Let>k=k+1
Actions you want to repeat
If>k<21 (change 21 to the number you want to repeat)
Wait>0.10
Goto>Start
Sent from my Pixel 2 using Tapatalk
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?