Invalid numeric value for MouseMove command - Help please

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
lim0n
Newbie
Posts: 3
Joined: Thu Feb 26, 2009 11:42 pm

Invalid numeric value for MouseMove command - Help please

Post by lim0n » Thu Feb 26, 2009 11:46 pm

Hi All,

I want to take the chance to thank you all for all the helpful information I've been leeching since I started using MS...

I do have an issue here and your expertise is extremly appreciated; The script (below) works fine using MS. But when is compiled it gives me this error: "Invalid numeric value for MouseMove command"

I tried changing variables, removing spaces and adding a wait time infront but this wont fix the issue.

Thanks for your help.



>>Script
...
FindImagePos>C:\Autoprint\logs\reqlist.bmp,SCREEN,50,1,XPos,YPos,imgs
SetFocus>Microsoft Excel - List.xls
Let>XMove=XPos_0-10
Let>YMove=YPos_0+27
MouseMove>XMove,YMove
LClick
PRess Ctrl
Wait>0.5
Send>c
Release Ctrl
Wait>0.5
SetFocus>Docu*
WindowAction>1,Docu*
Wait>1
...
Last edited by lim0n on Fri Feb 27, 2009 5:43 pm, edited 1 time in total.

User avatar
JRL
Automation Wizard
Posts: 3526
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Fri Feb 27, 2009 1:05 am

Unless a variable is alone as a parameter it needs to have percents around it. So, for example, your lines:

Let>XMove=XPos_0-10
Let>YMove=YPos_0+27

need to be changedto:

Let>XMove=%XPos_0%-10
Let>YMove=%YPos_0%+27

Me_again
Automation Wizard
Posts: 1101
Joined: Fri Jan 07, 2005 5:55 pm
Location: Somewhere else on the planet

Post by Me_again » Fri Feb 27, 2009 3:14 am

Surprisingly this displays 95 for me:

Let>XPos_0=100
Let>XMove=XPos_0-5
MDL>XMove

I don't see where there are values assigned to XPos_0 and YPos_0, unless that is done in some other part of the code it will cause XMove and YMove to have non-numeric values.

gdyvig
Automation Wizard
Posts: 447
Joined: Fri Jun 27, 2008 7:57 pm
Location: Seattle, WA

Need to make sure image was found.

Post by gdyvig » Fri Feb 27, 2009 3:37 am

Need to check:
if>imgs=0
//XPos_0 and XPos_0 will not be assigned
endif

Gale

User avatar
jpuziano
Automation Wizard
Posts: 1085
Joined: Sat Oct 30, 2004 12:00 am

Post by jpuziano » Fri Feb 27, 2009 5:11 am

Hi lim0n,
JRL wrote:Unless a variable is alone as a parameter it needs to have percents around it. So, for example, your lines:

Let>XMove=XPos_0-10
Let>YMove=YPos_0+27

need to be changedto:

Let>XMove=%XPos_0%-10
Let>YMove=%YPos_0%+27
The Let> command handles that fine, don't need the % symbols... check the Help File.
Me_again wrote:Surprisingly this displays 95 for me:

Let>XPos_0=100
Let>XMove=XPos_0-5
MDL>XMove
Displays 95 for me as well... and it works the same way compiled so that can't be the problem.
Me_again wrote:I don't see where there are values assigned to XPos_0 and YPos_0, unless that is done in some other part of the code it will cause XMove and YMove to have non-numeric values.
It happens in the following line:

FindImagePos>C:\Autoprint Docuware\logs\reqlist.bmp,SCREEN,50,1,XPos,YPos,imgs
out-take from FindImagePos Help File entry wrote:FindImagePos>bitmap_to_find,bitmap_to_scan|SCREEN,color_tolerance,return_center,X_Array,Y_Array,NumFound

X_Array is the name of a variable to store the X coordinates of each match. The first match is stored in X_Array_0, the second in X_Array_1, etc.

Y_Array is the name of a variable to store the Y coordinates of each match. The first match is stored in Y_Array_0, the second in Y_Array_1, etc.
The variable names used were XPos and YPos so the first match will be returned in XPos_0 and YPos_0.

Because this script works fine as is but fails when compiled, it has to be something weird.

I notice you have the following comment lines:

>>Script
>>image detection
>>If not found

Change those all as follows...

//Script
//image detection
//If not found

...then recompile the script and let us know how it works.
jpuziano

Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post - :-)

Me_again
Automation Wizard
Posts: 1101
Joined: Fri Jan 07, 2005 5:55 pm
Location: Somewhere else on the planet

Post by Me_again » Fri Feb 27, 2009 4:13 pm

jpuziano wrote:X_Array is the name of a variable to store the X coordinates of each match. The first match is stored in X_Array_0, the second in X_Array_1, etc.
Yeah, thanks, I remembered that in the shower this morning :oops:

lim0n
Newbie
Posts: 3
Joined: Thu Feb 26, 2009 11:42 pm

Post by lim0n » Fri Feb 27, 2009 5:39 pm

Thank you all for the replies.

jpuziano - Thanks for the input, removed the >> and for some reason the script started working smoother with no errors so far (compiled).

Thanks again! :D

User avatar
jpuziano
Automation Wizard
Posts: 1085
Joined: Sat Oct 30, 2004 12:00 am

Post by jpuziano » Fri Feb 27, 2009 6:18 pm

Hi lim0n,

You're welcome, glad that solved it for you... however we should be thanking you as you discovered a compiling issue.

Using >> to start a comment should be OK according to the Help File...
out-take from MS 11.1.04 Help File wrote:The Complete Script

So let's review the script. I have added comments to document the script – to make it more readable and easy to follow. You can use almost anything that isn't a recognised script command for comments. There is a reserved word called Remark which can be used:

Remark>This is a comment

But I've used // to indicate my comments. Some people like to use **. Use what you feel comfortable with – as long as it isn't a recognised script command – or it will try to execute your comments. Which could be interesting!
However there seems to be a problem using >> to start a comment when the script is compiled.

If Marcus can replicate this issue... I'm sure it can be sorted.

I tend to stick with the following two commenting methods as both are brief and well tested:

//single line comment

/*
block comment
*/

I'm not sure what version you are running... but C style block comments /* .... */ were added in version 7.4.

Take care and thanks for posting your question so this could be discovered.
jpuziano

Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post - :-)

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