Need Help With this i have this code and it works fine but only if it find image on screen if it didnt find any image it give me error: Line9 invalid numeric value for mousemove command, i commented line 9 in the code below i guess the problem is in the XArr,YArr cause it have the same name as image before it, i tryed to rename it like i did in NumFound and NumFound1 but no luck how can i fix that?
SetFocus>Screen One
Srt>Bases
FindImagePos>C:\Users\KiKAS\Desktop\pics for last shelter\Adcanced\LvL 25 base.bmp,SCREEN,0.7,1,XArr,YArr,NumFound,CCOEFF
FindImagePos>C:\Users\KiKAS\Desktop\pics for last shelter\Adcanced\Purple Base.bmp,SCREEN,0.7,1,XArr,YArr,NumFound1,CCOEFF
If>NumFound>0
MouseMove>XArr_0,YArr_0
LClick
Else>NumFound1>0
MouseMove>XArr_0,YArr_0 //this is line 9
LClick
EndIF
END>Bases
GoSub>Bases
multiple images Error
Moderators: Dorian (MJT support), JRL
- Dorian (MJT support)
- Automation Wizard
- Posts: 1389
- Joined: Sun Nov 03, 2002 3:19 am
- Contact:
Re: multiple images Error
My guess is you're trying to do something like this.. Note how I use "Else" differently..
//If lvl25 base is found, click on it, if not, click on purple.
//If lvl25 base is found, click on it, if purple is found, click on it.
Usage for If/Else/Endif is :
//If lvl25 base is found, click on it, if not, click on purple.
Code: Select all
SetFocus>Screen One
Srt>Bases
FindImagePos>C:\Users\KiKAS\Desktop\pics for last shelter\Adcanced\LvL 25 base.bmp,SCREEN,0.7,1,XArr,YArr,NumFound,CCOEFF
FindImagePos>C:\Users\KiKAS\Desktop\pics for last shelter\Adcanced\Purple Base.bmp,SCREEN,0.7,1,XXArr,YYArr,NumFound1,CCOEFF
If>NumFound>0
MouseMove>XArr_0,YArr_0
LClick
Else
MouseMove>XXArr_0,YYArr_0
LClick
EndIF
END>Bases
GoSub>Bases
Code: Select all
SetFocus>Screen One
Srt>Bases
FindImagePos>C:\Users\KiKAS\Desktop\pics for last shelter\Adcanced\LvL 25 base.bmp,SCREEN,0.7,1,XArr,YArr,NumFound,CCOEFF
FindImagePos>C:\Users\KiKAS\Desktop\pics for last shelter\Adcanced\Purple Base.bmp,SCREEN,0.7,1,XXArr,YYArr,NumFound1,CCOEFF
If>NumFound>0
MouseMove>XArr_0,YArr_0
LClick
EndIF
If>NumFound1>0
MouseMove>XXArr_0,YYArr_0
LClick
EndIF
END>Bases
GoSub>Bases
Usage for If/Else/Endif is :
Code: Select all
If>this=that
...do something
else
...do something else
Endif
Yes, we have a Custom Scripting Service. Message me or go here
Re: multiple images Error
Thank you dorian for your help
- Dorian (MJT support)
- Automation Wizard
- Posts: 1389
- Joined: Sun Nov 03, 2002 3:19 am
- Contact:
Re: multiple images Error
Always happy to help.
Yes, we have a Custom Scripting Service. Message me or go here