WWO
Full Member
Posts: 21
|
Post by WWO on Jul 27, 2020 23:46:16 GMT
To try to keep the mouse and action in sync, I have been trying such as:
1 | -644 | 482 | 2000 | Mouse Movement
2 | X | Y | 50 | Left Click
But I get a syntax error when I try to save line 2 to that.
Should 2 not just left click the mouse at whatever location it is currently at?
|
|
|
Post by zeak on Jul 28, 2020 2:58:27 GMT
Hi WWO, Welcome to the forum, Can I ask why your X position on your 1 is in the negative? and the syntax you are looking for is 2 | %MOUSE_X% | %MOUSE_Y% | 50 | Left Click But it looks like this is not working. Steve can you please look into why the above doesn't allow me to enter it. The long way around is below. 1 | RUN ACTION | DEFINE INTEGER VARIABLE | %INTEGER%::%MOUSE_X% 2 | RUN ACTION | DEFINE INTEGER VARIABLE | %INTEGER1%::%MOUSE_Y% 3 | %INTEGER% | %INTEGER1% | 50 | Left Click
|
|
WWO
Full Member
Posts: 21
|
Post by WWO on Jul 29, 2020 2:15:54 GMT
> Can I ask why your X position on your 1 is in the negative?
Because the click point is on a monitor to the left of my primary one.
> 2 | %MOUSE_X% | %MOUSE_Y% | 50 | Left Click
Thanks for that.
However, if: # | X | Y | 0 | Keypress ...
is acceptable, it would seem intuitive that ' | X | Y | ' would be applicable anywhere, to indicate wherever things are at now.
Would also seem to lend to generic / editing of macros.
Suppose: 1 | 123 | 456 | 789 | Mouse Movement 2 | X | Y | 0 | Left Click 3 | 12 | 345 | 678 | Mouse Movement 4 | X | Y | 0 | Left Click
Then changing monitors, screen sizes, whatever, would mean only lines 1 and 3 need be adjusted, not all 4 of them. Especially when 2 and 4 just duplicates the prior line.
Granted, the pairs of lines can be consolidated, however, when trying to watch and debug a macro, is has been useful to do mouse movements first, instead, watching that things go where they are supposed to. Especially if the click itself presses a screen button, causing the screen to change.
It also means that the Left Clicks can be commented out to verify that all the mouse movements are going to the expected locations (see aforementioned screen change). Then enabled one by one when debugging.
Not suggesting anything here other than: > it would seem intuitive that ' | X | Y | ' would be applicable anywhere, to indicate wherever things are at now.
Observing that ' | X | Y | ' is easier for the eye to scan over as being correct, as opposed to ' | %MOUSE_X% | %MOUSE_Y% | '
|
|
|
Post by Steve on Jul 29, 2020 7:06:05 GMT
I think this is what your after: 1 | -644 | 482 | 2000 | Mouse Movement 2 | X | X | 50 | Left Click 'X' within the Mouse X and Mouse Y field skips moving that mouse position. So your line 2 will left click where ever the current mouse is at the time. Yes, as you tried X and Y does make sense. It actually makes more sense than just an X for both. When I wrote the code for that I didn't really give it much thought. I figured an X represents visually a value that is not numeric and could not be confused for a variable. A point on debugging with MMM. If you havent already started using the internal mmm event log for debugging then i highly recommend it www.turnssoft.com/faq2.html#eventlog. The MMM log was designed for debugging. When i run my macro's and add features to the code base i use it heavily to provide feedback and ensure i'm getting the results i need. The newer actions and conditions (added in the last 18 months) all provide comprehensive feedback to the MMM log. Hope this helps.
|
|
|
Post by Steve on Jul 29, 2020 7:14:19 GMT
2 | %MOUSE_X% | %MOUSE_Y% | 50 | Left Click But it looks like this is not working. Steve can you please look into why the above doesn't allow me to enter it. Hi zeak Your line 2 works when you play it back but MMM does not like you entering it from the main macro window. It will let you enter it from the 'macro editor in settings' (settings - macro) or allow you to load it in as a saved .mmmacro file. Why does it fail directly in the main window? because a long time ago (several years now) I tried to be cleaver with syntax verification. Years ago any variables outside of actions were considered invalid syntax. MMM was expecting numeric values for the mouse x and mouse y and not string's. Now though, variables are excepted almost everywhere. The problem is this old hangup still exists in the code where it tries to validate the syntax.
Cheers Zeak.
|
|