Image Recongition

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
luke116
Newbie
Posts: 6
Joined: Mon Apr 21, 2008 10:36 pm

Image Recongition

Post by luke116 » Tue Apr 22, 2008 3:30 pm

hello there .. im a newbie to this sort of stuff but anyway . This is my script up to now

Repeat>
Wait> 2
MouseMove>101,647
LClick
MouseMove>48,500
LClick
MouseMove>105,500
LClick
MouseMove>167,500
LClick
MouseMove>287,500
LClick
MouseMove>344,500
LClick
MouseMove>404,500
LClick
MouseMove>466,500
LClick
MouseMove>522,500
LClick
MouseMove>580,500
LClick
MouseMove>642,500
LClick
MouseMove>699,500
LClick
MouseMove>761,500
LClick
MouseMove>64,647
LClick
MouseMove>69,546
LClick
LClick
MouseMove>133,543
LClick
LClick
MouseMove>30,648
LClick
MouseMove>69,546
LClick
LClick
LClick
LClick
LClick
MouseMove>133,543
LClick
LClick
LClick
LClick
LClick
MouseMove>412,638
LClick
FindImagePos>C:\Documents and Settings\Lu245245ah\My Documents\New Folder\Wild Viking\4 clubs.bmp,SCREEN,0,0,XArr,imgs,NumFound
FindImagePos>C:\Documents and Settings\Lu245245ah\My Documents\New Folder\Wild Viking\4 diamonds.bmp,SCREEN,0,0,XArr,imgs,NumFound
FindImagePos>C:\Documents and Settings\Lu42542542ah\My Documents\New Folder\Wild Viking\4 hearts.bmp,SCREEN,0,0,XArr,imgs,NumFound
FindImagePos>C:\Documents and Settings\Lu43255\My Documents\New Folder\Wild Viking\4 spades.bmp,SCREEN,0,0,XArr,imgs,NumFound
if>imgs>0
MouseMove>172,651
Lclick
Endif

2nd Macro

MouseMove>48,500
LClick
MouseMove>105,500
LClick
MouseMove>167,500
LClick
MouseMove>287,500
LClick
MouseMove>344,500
LClick
MouseMove>404,500
LClick
MouseMove>466,500
LClick
MouseMove>522,500
LClick
MouseMove>580,500
LClick
MouseMove>642,500
LClick
MouseMove>699,500
LClick
MouseMove>761,500
LClick
MouseMove>101,647
Lclick
MouseMove>48,500
LClick
Lclick
MouseMove>105,500
LClick
LClick
MouseMove>167,500
LClick
LClick
MouseMove>287,500
LClick
LClick
MouseMove>344,500
LClick
LClick
MouseMove>404,500
LClick
LClick
MouseMove>466,500
LClick
LClick
MouseMove>522,500
LClick
LClick
MouseMove>580,500
LClick
LClick
MouseMove>642,500
LClick
LClick
MouseMove>699,500
LClick
LClick
MouseMove>761,500
LClick
LClick
MouseMove>133,543
Lclick
Lclick
Lclick
Mousemove>76,546
Lclick
Lclick
Lclick
Mousemove>406,636
Lclick


What i want that macro to do is . If the image does not show just to repeat the first macro but if the image does show i want it to go on to another macro .I'll use any of the image recognition tools. Can anyone help with this please . Thank You

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

Post by Marcus Tettmar » Thu Apr 24, 2008 8:48 am

You can do something like:

Code: Select all

//put this at top of script
Label>start

... your code here

If>numimgs=0
  Goto>start
else
  Macro>c:\some folder\other_macro.scp
Endif
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

luke116
Newbie
Posts: 6
Joined: Mon Apr 21, 2008 10:36 pm

Post by luke116 » Thu Apr 24, 2008 3:39 pm

This is my new script.

Label>start

Wait> 2
MouseMove>101,647
LClick
MouseMove>48,500
LClick
MouseMove>105,500
LClick
MouseMove>167,500
LClick
MouseMove>287,500
LClick
MouseMove>344,500
LClick
MouseMove>404,500
LClick
MouseMove>466,500
LClick
MouseMove>522,500
LClick
MouseMove>580,500
LClick
MouseMove>642,500
LClick
MouseMove>699,500
LClick
MouseMove>761,500
LClick
MouseMove>64,647
LClick
MouseMove>69,546
LClick
LClick
MouseMove>133,543
LClick
LClick
MouseMove>30,648
LClick
MouseMove>69,546
LClick
LClick
LClick
LClick
LClick
MouseMove>133,543
LClick
LClick
LClick
LClick
LClick
MouseMove>412,638
LClick
FindImagePos>C:\Documents and Settings\Luke n Hannah\My Documents\New Folder\Wild Viking\4 clubs.bmp,SCREEN,0,0,XArr,imgs,NumFound
FindImagePos>C:\Documents and Settings\Luke n Hannah\My Documents\New Folder\Wild Viking\4 diamonds.bmp,SCREEN,0,0,XArr,imgs,NumFound
FindImagePos>C:\Documents and Settings\Luke n Hannah\My Documents\New Folder\Wild Viking\4 hearts.bmp,SCREEN,0,0,XArr,imgs,NumFound
FindImagePos>C:\Documents and Settings\Luke n Hannah\My Documents\New Folder\Wild Viking\4 spades.bmp,SCREEN,0,0,XArr,imgs,NumFound
If>numimgs=0
Goto>start
else
Macro>C:\My Documents\Macro Scheduler\Wild Viking 13 2nd
Endif


But now i get a error message saying the macro doesnt exist?

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

Post by Marcus Tettmar » Thu Apr 24, 2008 3:52 pm

1. Your FindImgPos functions return the number found in a variable called NumFound but you are using numings in your If statement.

2. The Macro command requires the full path and filename of the macro file. You have missed out the extension which is .scp
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

luke116
Newbie
Posts: 6
Joined: Mon Apr 21, 2008 10:36 pm

Post by luke116 » Thu Apr 24, 2008 3:56 pm

Thanks for the reply . If you could would you be able to edit my script and post it on . Its in C:\Documents and Settings\Luke n Hannah\My Documents\Macro Scheduler and the file is called Wild Viking 13 2nd . If you could do that for me i would be very appreciative.

Thanks

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

Post by Marcus Tettmar » Thu Apr 24, 2008 3:58 pm

Macro>C:\Documents and Settings\Luke n Hannah\My Documents\Macro Scheduler\Wild Viking 13 2nd.scp
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

luke116
Newbie
Posts: 6
Joined: Mon Apr 21, 2008 10:36 pm

Post by luke116 » Thu Apr 24, 2008 4:10 pm

Thanks its running now but it is doing a different script. All i want to do is run the first script till the image shows then run script number 2 .

Thanks for all of your help

luke116
Newbie
Posts: 6
Joined: Mon Apr 21, 2008 10:36 pm

Post by luke116 » Thu Apr 24, 2008 7:28 pm

Can you help ?

I want it to repeat until the imag shows ill use any of the image recognition tools ..


Thanks

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