Image Recognition Wizard

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
mightycpa
Automation Wizard
Posts: 303
Joined: Mon Jan 12, 2004 4:07 pm
Location: Vienna, VA

Image Recognition Wizard

Post by mightycpa » Wed Mar 03, 2021 5:39 pm

I'm a little confused by something. I'm using the wizard to locate where I should click. In the dropdown box, there are multiple choices with multiple descriptions. However, at least two of the descriptions seem to mean the same thing:

Image

Link to image: https://pasteboard.co/JQVR9F0.jpg

Both selections give me the same return_offset value, 8. I thought that "To the Right of the Image" would place the cursor outside of the image border, as depicted in purple in my screenshot above.

If it is supposed to do that, what is the value supposed to be? Only 0 - 8 are in the documentation for FindImagePos.
"A facility for quotation covers the absence of original thought." - Lord Peter Wimsey

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

Re: Image Recognition Wizard

Post by Dorian (MJT support) » Wed Mar 03, 2021 6:08 pm

They do actually do different things. Middle right would be on the right edge, whereas "To the Right" is off the edge. When choosing "to the right" you'll see you can then set how many pixels to offset it to the right. Below you can see the code generated when selecting "middle right", and then "to the right" setting the pixel offset to 10 and 100 pixels respectively.

Code: Select all

//Find and Move Mouse Middle Right of 
FindImagePos>%BMP_DIR%\image_3.bmp,SCREEN,0.7,8,XArr,YArr,NumFound,CCOEFF
If>NumFound>0
  MouseMove>XArr_0,YArr_0
Endif

//Find and Move Mouse To the Right of the 
FindImagePos>%BMP_DIR%\image_4.bmp,SCREEN,0.7,8,XArr,YArr,NumFound,CCOEFF
If>NumFound>0
  MouseMove>{%XArr_0%+10},YArr_0
Endif

//Find and Left Click To the Right of the 
FindImagePos>%BMP_DIR%\image_5.bmp,SCREEN,0.7,8,XArr,YArr,NumFound,CCOEFF
If>NumFound>0
  MouseMove>{%XArr_0%+100},YArr_0
Endif
Yes, we have a Custom Scripting Service. Message me or go here

mightycpa
Automation Wizard
Posts: 303
Joined: Mon Jan 12, 2004 4:07 pm
Location: Vienna, VA

Re: Image Recognition Wizard

Post by mightycpa » Wed Mar 03, 2021 6:24 pm

OK, didn't notice that code difference. Thanks.
"A facility for quotation covers the absence of original thought." - Lord Peter Wimsey

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