|
Post by zeak on Nov 26, 2018 22:45:45 GMT
93 | 900 | 140 | 750 | Left Click Down 94 | 900 | 140 | 750 | Left Click Release
At the moment this says to go to 900 from left side of screen and 140 down from top of screen, my question is there any way to say I want 200 from right side of the screen and 600 from bottom.
example.
93 | R200 | B600 | 750 | Left Click Down 94 | R200 | B600 | 750 | Left Click Release not sure if it is possible, the only other thought I had is there a way to work out the screen size into a INTEGER and minus the 200 from that to get the distance from the left side.
|
|
|
Post by Steve on Nov 27, 2018 3:08:07 GMT
The only way to do this would be to do as you suggest; declare the screen size X and Y to the integer variables then minus the value to the right.
1 | RUN ACTION | DEFINE INTEGER VARIABLE | %INTEGER%::1920 2 | RUN ACTION | DEFINE INTEGER VARIABLE | %INTEGER1%::1080 * | Macro Body 10 | RUN ACTION | DEFINE INTEGER VARIABLE | %INTEGER%::-200 11 | RUN ACTION | DEFINE INTEGER VARIABLE | %INTEGER1%::-200 12 | %integer% | %integer1% | 1000 | Mouse Movement
This example of a 1920x1080 resolution moves the mouse 200 from the right.
|
|
|
Post by zeak on Nov 27, 2018 3:13:30 GMT
Ok, this only issue with what you said is that you are declaring the screen size, is there any way to find the screen size using MMM?
The reason this has been an issue with trying to find the buttons is because at my work we have multiple PC with different size screens but the button is always a set distance from the right side of the screen.
|
|
|
Post by zeak on Nov 27, 2018 3:17:12 GMT
To my trying to find a button thread I ended up coming up with this.
1 | IF | PIXEL RANGE | At Location [X:600 Y:130]::Size [W:500 H:25] | CHANGES::1::0::0 | DEFINE INTEGER VARIABLE | %INTEGER%::%MOUSE_X% 2 | IF | INTEGER VARIABLE | %INTEGER% | IS NOT | 0 | MESSAGE PROMPT | %INTEGER%::MOUSE POSITION::0 | AND | 2 | RUN ACTION | STOP 3 | IF | INTEGER VARIABLE | %INTEGER% | IS | 0 | GOTO MACRO LINE | 1
But people are still having issues with mousing over the wrong button and it setting its self to the wrong location, if I could get away from them having to show the program where the button is it would make my life a lot easier.
I still wish there was a way to tell MMM, this is what the button looks like now press it.
|
|
|
Post by Steve on Nov 27, 2018 3:56:42 GMT
getres.mmmacro can assign the resolution to variables. I think this is what you are after.
getres.mmmacro uses 'wmic' to pull the screenwidth and screenheight values into a file that is read in by MMM to assign the variables.
main.mmmacro
1 | RUN ACTION | DEFINE INTEGER VARIABLE | %INTEGER%::0 2 | RUN ACTION | DEFINE INTEGER VARIABLE | %INTEGER1%::0 3 | FOR | EACH | LINE IN | D:\Macro\getres.mmmacro | RUN 4 | RUN ACTION | MESSAGE PROMPT | Screen Res is %integer1%x%integer%::::0 getres.mmmacro
1 | RUN ACTION | INPUT FROM FILE | INTEGER1::REFRESH::D:\Macro\inX.txt 2 | RUN ACTION | RUN VIA CMD /c | for /f "tokens=1,2 delims== skip=2" %i in ('wmic desktopmonitor get screenwidth /value') do (IF NOT "%j"=="" <NUL set /p out=%j>D:\MACRO\inX.txt) 3 | RUN ACTION | WAIT SECONDS | 2 4 | RUN ACTION | INPUT FROM FILE | INTEGER::REFRESH::D:\Macro\inY.txt 5 | RUN ACTION | RUN VIA CMD /c | for /f "tokens=1,2 delims== skip=2" %i in ('wmic desktopmonitor get screenheight /value') do (IF NOT "%j"=="" <NUL set /p out=%j>D:\MACRO\inY.txt) 6 | RUN ACTION | WAIT SECONDS | 2
|
|
|
Post by zeak on Nov 27, 2018 5:09:29 GMT
Cheers Steve, your a legend.
|
|
|
Post by zeak on Nov 27, 2018 21:47:32 GMT
ScreenResGif
imgur.com/a/P8hK0Op
For some Reason the Gif wont load on this fourm.
EDIT: so this works when all the file paths are local to C: but when I have all the file paths on my works network it cannot find the files.
|
|
|
Post by Steve on Nov 28, 2018 3:33:13 GMT
Yeah not sure why the gif if not working straight up. I had to save it from your link and upload it to Postimage.org and then embed it. So it works when it's on your local machine but not when you access a remote file share? Ok not sure about that. Will have to look into it. Could be a few things... (Your link from Postimage.org)
|
|