Searching for several images using FindImagePos

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
brunop
Junior Coder
Posts: 38
Joined: Mon Dec 03, 2007 2:29 pm

Searching for several images using FindImagePos

Post by brunop » Sun Jun 13, 2010 11:04 am

How do you make a script look for more than one picture? I know how to use the FindImagePos but if I want the script to look for first one picture and if that one is not found then look for another and so on and in the end if non of the pictures were found give me an error message and stop the script.

Bruno

adroege
Automation Wizard
Posts: 438
Joined: Tue Dec 07, 2004 7:39 pm

Post by adroege » Sun Jun 13, 2010 1:55 pm

Code: Select all

FindImagePos>c:\today_button.bmp,SCREEN,0,1,X,Y,TodayFound

If>TodayFound>0
   //Do something if today_button was found
Else
  //Look for next image
  FindImagePos>c:\GRD_button.bmp,SCREEN,0,1,X,Y,GRDFound
  If>GRDFound>0
    //Do something if GRD_button was found
  Else
    //Look for next image
    FindImagePos>c:\ABC_button.bmp,SCREEN,0,1,X,Y,ABCFound
    If>ABCFound>0
      //Do something if GRD_button was found
    Else
      //Look for next image
      FindImagePos>c:\DEF_button.bmp,SCREEN,0,1,X,Y,DEFFound
      If>DEFFound>0
        //Do something if GRD_button was found
      Else
        MessageModal>NO IMAGES FOUND
	Goto>Exit
      Endif
    Endif
  Endif
Endif
MessageModal>AT LEAST ONE IMAGE FOUND


Label>Exit


brunop
Junior Coder
Posts: 38
Joined: Mon Dec 03, 2007 2:29 pm

Post by brunop » Sun Jun 13, 2010 2:35 pm

Perfect just what I needed.

Bruno

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