Image Recognition Array

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
ggripp
Newbie
Posts: 4
Joined: Tue Dec 22, 2015 9:42 am

Image Recognition Array

Post by ggripp » Tue Dec 22, 2015 9:56 am

Hi Guys, i'm new here, and i'm having some troubles to get this macro to work...

There's 6 different images that can show up on screen, the first one can only show 1 per time on screen, and the macro works perfectly, the other 5, can be more than one at the same time... When he finds more than 1, he does goes and right click all images found, but when he ends, instead of go back to the beginning and start all over again, it throws this error: "Invalid Numeric Value for MouseMove command."

Example: if he finds 5 "dos.bmp" it right click all 5 places, then throw this error.
Ps.: the images still on the screen for a few seconds after it clicks

Anybody can fix for me? :roll:
(sorry about my terrible english :oops: )

Code: Select all

Label>1
//Find and Do Nothing Center of
FindImagePos>C:\macro\p.bmp,SCREEN,0,1,XArr,YArr,p

If>p>0
Press LCTRL
Send>x
Wait>1
Press LCTRL
Send>x
Release LCTRL
MouseMove>411,170
LClick
Endif

FindImagePos>C:\macro\wal.bmp,SCREEN,0,1,XArr,YArr,wal,EXACT
If>wal>0
Let>k=0
Repeat>k
  MouseMove>YArr_%k,YArr_%k%
  RClick
  Wait>0.5
    Press Del
    Release Del
    LClick
  Let>k=k+1
Until>k=wal
Endif

FindImagePos>C:\macro\man.bmp,SCREEN,0,1,XArr,YArr,man
If>man>0
Let>k=0
Repeat>k
  MouseMove>XArr_%k%,YArr_%k%
  RClick
  Wait>0.5
    Press Del
    Release Del
    LClick
  Let>k=k+1
Until>k=man
EndIf

FindImagePos>C:\macro\dos.bmp,SCREEN,0,1,XArr,YArr,dos,EXACT
If>dos>0
Let>k=0
Repeat>k
  MouseMove>XArr_%k%,YArr_%k%
  //RClick
  Wait>0.5
  Let>k=k+1
Until>k=dos
EndIf

FindImagePos>C:\macro\kin.bmp,SCREEN,0,1,XArr,YArr,kin,EXACT
If>kin>0
Let>k=0
Repeat>k
  MouseMove>XArr_%k%,YArr_%k%
  //RClick
  Wait>0.5
  Let>k=k+1
Until>k=kin
EndIf

FindImagePos>C:\macro\ten.bmp,SCREEN,0,1,XArr,YArr,ten,EXACT
If>ten>0
Let>k=0
Repeat>k
  MouseMove>XArr_%k%,YArr_%k%
  //RClick
  Wait>0.5
  Let>k=k+1
Until>k=ten
EndIf
Goto>1

ggripp
Newbie
Posts: 4
Joined: Tue Dec 22, 2015 9:42 am

Re: Image Recognition Array

Post by ggripp » Tue Dec 22, 2015 1:18 pm

NVM, i removed the "EXACT" and now is working

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