I'll begin with a sorry because probably I would post into a beginners section inside this beginners section if there was one.
I'd like for MacroScheduler to keep sending a command until it finds an certain image.
I really looked for it, but since I'm not a programmer, my mind won't make me go to the right places.
Could anyone help me?
Thanks.
Repeat command until find an image.
Moderators: Dorian (MJT support), JRL
Re: Repeat command until find an image.
Thanks, Meryl. I think that's not it.
My newbie research makes me stumble upon the repeat and until commands.
But I don't understand how to use them.
I feel that what I want to do is pretty simple but i can't do even that
My newbie research makes me stumble upon the repeat and until commands.
But I don't understand how to use them.
I feel that what I want to do is pretty simple but i can't do even that
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Re: Repeat command until find an image.
Hi,
If you are new to looping I would recommend this article:
http://help.mjtnet.com/article/144-how-to-loop-the-loop
I'm assuming by "find an image" you are using the FindImagePos function. This returns the number of images found. We'll use NumFound for that. So you would want to Repeat, Until NumFound is greater than zero. See, when you say it like that it's just plain English.
Or you could use a While loop which says While NumFound is zero, keep looking.
If you are new to looping I would recommend this article:
http://help.mjtnet.com/article/144-how-to-loop-the-loop
I'm assuming by "find an image" you are using the FindImagePos function. This returns the number of images found. We'll use NumFound for that. So you would want to Repeat, Until NumFound is greater than zero. See, when you say it like that it's just plain English.
Code: Select all
Let>numFound=0
Repeat>NumFound
FindImagePos>%BMP_DIR%\image_1.bmp,SCREEN,0.7,1,XArr,YArr,NumFound,CCOEFF
Until>NumFound>0
Code: Select all
Let>NumFound=0
While>NumFound=0
FindImagePos>%BMP_DIR%\image_1.bmp,SCREEN,0.7,1,XArr,YArr,NumFound,CCOEFF
EndWhile
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: Repeat command until find an image.
Thanks, Marcus.
I gave it a look and i think that might be it.
Thanks a lot!
I gave it a look and i think that might be it.
Thanks a lot!