Findimage script, Help please

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
jj45410
Junior Coder
Posts: 38
Joined: Tue Nov 18, 2008 8:14 pm

Findimage script, Help please

Post by jj45410 » Mon Dec 01, 2008 1:55 am

SetFocus>RuneScape - the massive online adventure game by Jagex Ltd. - Windows Internet Explorer
wait>1
FindImagePos>C:\Documents and Settings\Goergia\Desktop\button1.bmp,SCREEN,0,0,XArr,,NumFound
If>NumFound>0
wait>1
LClick
Endif
wait>1
FindImagePos>C:\Documents and Settings\Goergia\Desktop\button2.bmp,SCREEN,0,0,XArr,,NumFound
If>NumFound>0
wait>1
LClick
Endif
FindImagePos>C:\Documents and Settings\Goergia\Desktop\button3.bmp,SCREEN,0,0,XArr,,NumFound
If>NumFound>0
wait>1
LClick
Endif
FindImagePos>C:\Documents and Settings\Goergia\Desktop\button3.bmp,SCREEN,0,0,XArr,,NumFound
If>NumFound>0
wait>1
LClick
Endif
FindImagePos>C:\Documents and Settings\Goergia\Desktop\button4.bmp,SCREEN,0,0,XArr,,NumFound
If>NumFound>0
wait>1
LClick
Endif
FindImagePos>C:\Documents and Settings\Goergia\Desktop\button3.bmp,SCREEN,0,0,XArr,,NumFound
If>NumFound>0
wait>1
Lclick
endif
FindImagePos>C:\Documents and Settings\Goergia\Desktop\button3.bmp,SCREEN,0,0,XArr,,NumFound
if>Numfound>0
wait>1
Lclick
endif

Ok, All the bmps are in the place I told it to look, this script just is not working AT ALL it just doesnt move when I run it.. Im at the place where it should start but nothing.

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

Post by Marcus Tettmar » Mon Dec 01, 2008 11:37 am

Each of your FindImagePos lines has an empty string for the Y position array variable. And in each case if an image is found all you do is wait one second and then left click. You don't move the mouse. So it will click wherever the mouse already is!

FindImagePos returns the positions of the matches in the X and Y array variables. Use these to move the mouse to the located position.

Make sure you have read this:
http://www.mjtnet.com/blog/2007/02/20/h ... cognition/

And watch the video.

Also my response to this recent post may help:
http://www.mjtnet.com/forum/viewtopic.php?t=5049#21862
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

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