when using image racognition

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
idiot
Macro Veteran
Posts: 152
Joined: Thu Mar 01, 2007 9:21 am

when using image racognition

Post by idiot » Thu Apr 03, 2008 3:44 am

how can you have it detect image no matter what location the image appears at and click it??
this is what i tried and for some reason dosent work

Code: Select all

GetScreenRes>sx,sy
FindImagePos>C:\Documents and Settings\Owner.DJCYBERP-GZL12S\My Documents\fox.bmp,SCREEN,0,0,xpos,ypos,imgs
if>imgs>0
MouseMove>xpos_0,ypos_0
LClick

i am trying to get it to detect an image within a window that may be at any location
if idiots rule the world then im the king!!!!
i want a free t-shirt give me all of your rep!!!
please give me pro version of macro scheduler and appnavigator!!!

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Thu Apr 03, 2008 7:37 am

1. Make sure you use Macro Scheduler's image capture tool to capture the image from the screen. Find it under the Tools menu in the editor.

2. Assuming you have done the above, the basic code is simply:

Code: Select all

FindImagePos>captured_image,SCREEN,0,1,Xpos,Ypos,imgs
If>imgs>0
  MouseMove>Xpos_0,Ypos_0
  LClick
Endif
I've asked it to return the center of the image, so that it would click the middle of it. Your code is clicking on 0,0 top left of the part found - which may not be good enough - usually makes sense to click the middle of the object.

If more than one match is found it will click on the first one. Check the value of imgs to see if it found more than one.

3. Which version of Macro Scheduler are you using?
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

idiot
Macro Veteran
Posts: 152
Joined: Thu Mar 01, 2007 9:21 am

Post by idiot » Sat Apr 05, 2008 10:48 pm

lol using newest version yeah shoulda set to use center click newbie mistake lol ty
if idiots rule the world then im the king!!!!
i want a free t-shirt give me all of your rep!!!
please give me pro version of macro scheduler and appnavigator!!!

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