Issue with MouseMoveRel and Seperate

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
swd
Newbie
Posts: 3
Joined: Tue Jun 23, 2020 1:43 pm

Issue with MouseMoveRel and Seperate

Post by swd » Wed Aug 05, 2020 1:08 pm

Hello

No matter what I do MouseMoveRel does not recognise 'Y'. It works if I have a single line in the file without a carriage return. I've tried string replace and regex to remove the LF, still doesnt work. If I use the exact same variables on the GetPixelColor line, Y 'is' recognised and that works fine. I've used exact same format defining other variables from a config file without issues.. can anyone help?

ReadFile>G:\rfu.txt,sVals

MessageModal>sVals

Separate>sVals,LF,valList
If>valList_count>0
Let>k=0
Repeat>k
Let>k=k+1
Let>this_pair=valList_%k%
Separate>this_pair,%COMMA%,map
Let>X=map_1
Let>Y=map_2

MouseMoveRel>%X%,%Y%
GetPixelColor>%X%,%Y%,nColor
Until>k=valList_count
Endif
wait>1
tq1.gif
Last edited by swd on Wed Aug 05, 2020 2:09 pm, edited 2 times in total.

User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: Issue with MouseMoveRel and Seperate

Post by Marcus Tettmar » Wed Aug 05, 2020 2:08 pm

I expect you have a line break at the end. Try trimming:

ReadFile>G:\rfu.txt,sVals
Trim>sVals,sVals
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

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

Re: Issue with MouseMoveRel and Seperate

Post by Dorian (MJT support) » Wed Aug 05, 2020 2:10 pm

I think you still have control characters at the end of the line, and they're being included with Y. So Y is not a number, as it probably includes the linefeed. Rtrim fixes this.

Code: Select all

ReadFile>G:\rfu.txt,sVals
MessageModal>sVals
Separate>sVals,LF,valList
If>valList_count>0
	Let>k=0
	Repeat>k
		Let>k=k+1
		Let>this_pair=valList_%k%
		Rtrim>this_pair
		Separate>this_pair,%COMMA%,map
		Let>X=map_1
		Let>Y=map_2
		MouseMoveRel>%X%,%Y%
		GetPixelColor>%X%,%Y%,nColor
	Until>k=valList_count
Endif
wait>1
Yes, we have a Custom Scripting Service. Message me or go here

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

Re: Issue with MouseMoveRel and Seperate

Post by Dorian (MJT support) » Wed Aug 05, 2020 2:24 pm

Pipped to the post by Marcus :)
Yes, we have a Custom Scripting Service. Message me or go here

swd
Newbie
Posts: 3
Joined: Tue Jun 23, 2020 1:43 pm

Re: Issue with MouseMoveRel and Seperate

Post by swd » Wed Aug 05, 2020 2:43 pm

Great, it's working. :D Only the Rtrim fixes it.

I must have imported around 30 variables and never had this issue, all numbers, same format. Every other command worked fine without the Rtrim for some reason.

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