MouseMoveRel x,y as variable?

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
archaismic
Newbie
Posts: 9
Joined: Mon Nov 29, 2010 10:54 am
Contact:

MouseMoveRel x,y as variable?

Post by archaismic » Wed Jan 26, 2011 7:24 am

Is there a way to send the x,y to MouseMoveRel as a variable string?
I've tried

Code: Select all

Let>%blahblahXY%="123, 321"
MouseMoveRel>%blahblahXY%


hagchr
Automation Wizard
Posts: 327
Joined: Mon Jul 05, 2010 7:53 am
Location: Stockholm, Sweden

Post by hagchr » Wed Jan 26, 2011 9:02 am

Hi! One way would be to split the text in two parts and feed them to the mousemove function.


Let>blahblahXY="123, 321"

Let>delim1=,
Let>delim2="

Separate>blahblahXY,delim1,arrItems

StringReplace>arrItems_1,delim2,,arrItems_1
StringReplace>arrItems_2,delim2,,arrItems_2

Trim>arrItems_1,arrItems_1
Trim>arrItems_2,arrItems_2

MouseMoveRel>%arrItems_1%,%arrItems_2%

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

Re: MouseMoveRel x,y as variable?

Post by Marcus Tettmar » Wed Jan 26, 2011 11:01 am

archaismic wrote:Is there a way to send the x,y to MouseMoveRel as a variable string?
I've tried

Code: Select all

Let>%blahblahXY%="123, 321"
MouseMoveRel>%blahblahXY%

MouseMove takes two variables:

Let>x=123
Let>y=321
MouseMove>x,y

If you need to pass both parts in one variable then you can use a list and separate it out as hagchr suggested.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

archaismic
Newbie
Posts: 9
Joined: Mon Nov 29, 2010 10:54 am
Contact:

Post by archaismic » Wed Jan 26, 2011 10:00 pm

bah! that's almost worthless for what im doing... ahh well... thanks

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

Post by JRL » Thu Jan 27, 2011 6:03 am

So create your own MouseMoveRel function:

Code: Select all

Let>%blahblahXY%="123, 321"
//Home made function via subroutine call
GoSub>MouseMoveRel,%blahblahXY%


SRT>MouseMoveRel
Let>comma=,
  StringReplace>MouseMoveRel_var_1,",,Bah
  StringReplace>bah, ,,Bah
  Separate>bah,%comma%,bah
  MouseMoveRel>bah_1,bah_2
END>MouseMoveRel

archaismic
Newbie
Posts: 9
Joined: Mon Nov 29, 2010 10:54 am
Contact:

Post by archaismic » Thu Jan 27, 2011 6:12 am

i thought about something like that but the idea was to take about 50 variabls in the form of "x, y" and use the variables instead of the straight numbers each time... i just failed to setting each x and each y as their own variables

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