do a loop until it happens

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
HSEIVANE
Junior Coder
Posts: 33
Joined: Thu Jan 02, 2020 2:52 am

do a loop until it happens

Post by HSEIVANE » Sat Jan 18, 2020 3:16 pm

I want a macro instruction to keep looking for it until it happens .... how is that done?

This code

Code: Select all

//Find and Left Click Center of 
FindImagePos>%BMP_DIR%\image_29.bmp,SCREEN,0.7,1,XArr,YArr,NumFound,CCOEFF
If>NumFound>0
  MouseMove>XArr_0,YArr_0
  LClick
Endif

User avatar
Dorian (MJT support)
Automation Wizard
Posts: 1390
Joined: Sun Nov 03, 2002 3:19 am
Contact:

Re: do a loop until it happens

Post by Dorian (MJT support) » Mon Jan 20, 2020 10:08 am

I think waiting for the image is a better option than a loop. When you're in the Image Recognition Wizard, one of the options in the first tab is to wait for an image to appear before continuing. Use that, and then the code you already have.
Yes, we have a Custom Scripting Service. Message me or go here

Post Reply
cron
Sign up to our newsletter for free automation tips, tricks & discounts