Pop up when image not found

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
Rick0825
Junior Coder
Posts: 28
Joined: Sun Mar 05, 2023 5:30 pm

Pop up when image not found

Post by Rick0825 » Thu May 02, 2024 6:02 pm

So I have the following code:

Code: Select all

//Find and Left Click Center of 
FindImagePos>%BMP_DIR%\image_3.bmp,SCREEN,0.7,1,XArr,YArr,NumFound,CCOEFF
If>NumFound>0
  MouseMove>XArr_0,YArr_0
  LClick
ELSE
  MessageModal>Cant find it!
Endif
Why do I get the pop up screen saying unable to locate image instead of it moving on to the else statement?

Rick0825
Junior Coder
Posts: 28
Joined: Sun Mar 05, 2023 5:30 pm

Re: Pop up when image not found

Post by Rick0825 » Thu May 02, 2024 6:34 pm

Found the issue. The image was not found.
Have another question. I know you can direct one script to another, but can you ask it to go back to the original script on a specific line or spot?

Code: Select all

FindImagePos>%BMP_DIR%\image_2.bmp,SCREEN,1.0,1,XArr,YArr,NumFound,CCOEFF
If>NumFound>0
  MouseMove>XArr_0,YArr_0
  LClick
ELSE
  Macro>%SCRIPT_DIR%\test error.scp
Endif
Then go back to my original script but start on line 26?

Code: Select all

Macro>%SCRIPT_DIR%\Test with notepad.scp/G26

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

Re: Pop up when image not found

Post by Dorian (MJT support) » Thu May 02, 2024 6:50 pm

No to the first question. You're calling the entire script.

It will run that script and then continue at the line after Macro>....
Yes, we have a Custom Scripting Service. Message me or go here

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