Unrecognized images

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
mpsinfo
Junior Coder
Posts: 20
Joined: Mon Apr 19, 2021 1:31 pm

Unrecognized images

Post by mpsinfo » Sat Aug 21, 2021 10:20 am

Hi, until yesterday everything was working correctly.
Today despite restarted PC etc. the program no longer recognizes my images. :evil:
I also made a new test code but tells me -1.

Can you tell me where to look for the problem?

Code:
ScreenCapture>1160,96,1240,140,D:\LAVORI\_ARDUINO\MACRO\MK.bmp
Wait>1

WaitScreenImage>D:\LAVORI\_ARDUINO\MACRO\MK.bmp,25
FindImagePos>D:\LAVORI\_ARDUINO\MACRO\MK.bmp,25,1,X,Y,NumFound

If>WSI_RESULT=1
MSG>TROVATO
Endif


Result:
WSI_RESULT=-1
NUMFOUND=-1
Last edited by mpsinfo on Wed Sep 01, 2021 5:04 pm, edited 1 time in total.

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

Re: Unrecognized images

Post by Dorian (MJT support) » Mon Aug 23, 2021 10:01 am

I'm not sure how it would have been working before as you seem to have all sorts of code missing. I suggest running it through the Find Image Wizard again to regenerate the code. Also don't forget the Endif after the If.

It should look more like this :

Code: Select all

ScreenCapture>1160,96,1240,140,D:\LAVORI\_ARDUINO\MACRO\MK.bmp
Wait>1

WaitScreenImage>D:\LAVORI\_ARDUINO\MACRO\MK.bmp,0,EXACT

FindImagePos>D:\LAVORI\_ARDUINO\MACRO\MK.bmp,SCREEN,0,1,XArr,YArr,NumFound,EXACT

If>WSI_RESULT=1
  MSG>TROVATO
Endif
I may be being a bit slow here though as I can't figure out the purpose of the script. Because we're capturing an image with ScreenCapture (which we know exists because we just captured whatever is at those coordinates)... then we're waiting for it to appears (which we know it does)... and then we're finding it... and we already know it exists.

You're searching for the image you just created.
Yes, we have a Custom Scripting Service. Message me or go here

mpsinfo
Junior Coder
Posts: 20
Joined: Mon Apr 19, 2021 1:31 pm

Re: Unrecognized images

Post by mpsinfo » Tue Aug 24, 2021 2:14 pm

That's right, even looking for the newly created image gave an error.
Today everything seems to be working OK.

Mystery.

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