Technical support and scripting issues
Moderators: JRL, Dorian (MJT support)
-
swd
- Newbie
- Posts: 3
- Joined: Tue Jun 23, 2020 1:43 pm
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.
-
Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
-
Contact:
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
-
Dorian (MJT support)
- Automation Wizard
- Posts: 1415
- Joined: Sun Nov 03, 2002 3:19 am
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
-
swd
- Newbie
- Posts: 3
- Joined: Tue Jun 23, 2020 1:43 pm
Post
by swd » Wed Aug 05, 2020 2:43 pm
Great, it's working.

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.