|
Post by Johnc on Aug 22, 2018 18:41:12 GMT
Hi Steve, Can you use an integer variable for x, y positions? For example:
2 | RUN ACTION | | | | DEFINE INTEGER VARIABLE | %INTEGER4%::100
220 | 137 | 219+%INTEGER4% | 500 | Left Click Down
221 | 137 | 225+%INTEGER4% | 512 | Mouse Movement
222 | 141 | 225+%INTEGER4% | 16 | Mouse Movement
223 | 161 | 235+%INTEGER4% | 72 | Mouse Movement ...
Tks!
|
|
|
Post by Steve on Aug 23, 2018 5:10:19 GMT
Hi John,
Yes you can. It looks like this:
1 | RUN ACTION | | | | DEFINE INTEGER VARIABLE | %INTEGER4%::319 220 | 300 | %integer4% | 500 | Left Click 221 | RUN ACTION | | | | DEFINE INTEGER VARIABLE | %INTEGER4%::319 222 | 300 | %integer4% | 100 | Mouse Movement 223 | RUN ACTION | | | | DEFINE INTEGER VARIABLE | %INTEGER4%::325 224 | 300 | %integer4% | 100 | Mouse Movement 225 | RUN ACTION | | | | DEFINE INTEGER VARIABLE | %INTEGER4%::335 226 | 300 | %integer4% | 100 | Mouse Movement Above we define the variable prior to the mouse move and click. This is not dynamic though as we have assigned hard values to the integers assuming we know exactly where each time we would like the mouse Y to be. If this value changes then we need a different macro. By the way, the 'Left Click' action at line 220 does both the 'Left Click Down' and 'Left Click Release' events together. Its better if you just want a straight click without a mouse click down hold.
You have given me an idea for an update. It would be cool to have integer math available like your example for those values at run time. I might work on that for the next update.
Cheers, Steve.
|
|
|
Post by Johnc on Aug 23, 2018 16:23:50 GMT
Thanks Steve for considering this integer math idea. I think it would be very handy to be able to add a constant "offset" to a series of mouse movements to select a certain range of text on a webpage. The reason is that a web designer often adds or removes a banner from the page from time to time, making the mouse-selection of the desired text fail. With the ability to add a constant "offset" for either x or y position, I can easily "shift" the mouse-selection movements down a 100 pixels, for example, without needing to redo the sometimes tricky mouse capture. All I need to do is to change one "offset" integer variable. Thanks.
|
|
|
Post by kellyllek on Jun 26, 2020 8:13:37 GMT
Can I ask why you'd use a variable? I.e. Where might this come in handy?
I'm about to post a separate question on how to record mouse clicks independent of mouse movement.
|
|
|
Post by Steve on Jun 27, 2020 10:12:41 GMT
Can I ask why you'd use a variable? I.e. Where might this come in handy? Using a variable for the mouse X/Y coordinators allows for programmatically driven mouse movements. Logic in the macro can assign values to those variables that in turn determine where the mouse will be moved to.
|
|