Technical support and scripting issues
4 posts • Page 1 of 1
Hi I'm having issues trying to figure out how to create a either or scenario with image recognition. Basically I'm running a loop waiting for one of two images to come up, finding either one and clicking and moving on with the script. Any help would be appreciated.
How about something like this?
Code: Select all
//Wait until either of two images appears by using a While Loop Let>AnImageWasFound=FALSE While>AnImageWasFound=FALSE //Here we use two FindImagePos statements - one for each image FindImagePos>%BMP_DIR%\image_2.bmp,SCREEN,0.7,1,XArr,YArr,NumFound1,CCOEFF FindImagePos>%BMP_DIR%\image_3.bmp,SCREEN,0.7,1,XArr,YArr,NumFound2,CCOEFF //Now we see if one or other was found If>NumFound1>0 //First Image Was Found - do something .. your code here - or run a subroutine or goto a label or something //set AnImageWasFound flag to end the While loop Let>AnImageWasFound=TRUE Else If>NumFound2>0 //Second Image Was Found - do something else .. your code here - or run a subroutine or goto a label or something //set AnImageWasFound flag to end the While loop Let>AnImageWasFound=TRUE Endif Endif EndWhile //When we get here one of the images was found and acted on
Always accepting custom script commissions. Message me or go here
That worked perfectly thank you so much