How to?
Moderators: JRL, Dorian (MJT support)
How to?
Hey everyone im new to all this macroing thing I have been using the image recognition making loops but how can I make a loop and having it run that loop but if another image appears pause the loop and so a sub loop and once that is finished resume the original loop
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Re: How to?
Well here's some pseudocode:
I've used While loops here to demonstrate a concept but they could just as easily be Repeat/Until or even Label/Goto - but in the latter case you'd need to jump out of them.
It's hard to give a more precise answer without knowing what you are wanting to do and what form your code takes. But conceptually you can hopefully see in my example above that there is a main loop within which an image is checked for and when found a sub loop then executes until something=true, whereupon the main loop carries on as before.
Code: Select all
Let>main_condition=false
While>main_condition=false
FindImagePos ...
If Image Found
//sub loop
While>something=false
...
...
..
// at some point something will become true and we'll come out of this loop
// to continue with main loop
EndWhile
Endif
EndWhile
It's hard to give a more precise answer without knowing what you are wanting to do and what form your code takes. But conceptually you can hopefully see in my example above that there is a main loop within which an image is checked for and when found a sub loop then executes until something=true, whereupon the main loop carries on as before.
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?