|
Post by Ale on Mar 17, 2022 21:58:14 GMT
"The example below will try to detect the image banner.bmp on the screen. If it is found it will not move the mouse to that location and it will save the mouse X and Y pos values to variables %X% and %Y% and then carry out the MOUSE CLICK action. The MOUSE CLICK action will perform a 'Left Click' at the declared image X and Y value.
1 | IF | DETECT IMAGE | image path C:\File\banner.bmp::match quick::move mouse no::save to vars X Y | IMAGE FOUND | MOUSE CLICK | Left click at %X% %Y%"
Is it possible to save the mouse position and then perform the click at those %X% %Y% values BUT with an offset?
1 | IF | DETECT IMAGE | image path C:\File\banner.bmp::match quick::move mouse no::save to vars X Y | IMAGE FOUND | MOUSE CLICK | Left click at %X%-250 %Y%+50 for example? It is giving me an error so I'm doing something wrong, but is it possible to make it work?
|
|
|
Post by philranger on Mar 18, 2022 2:25:02 GMT
Hello,
Maybe there is a better way, but you can stock variables in %INTEGER1% through 5 I believe and do math on them.
|
|
|
Post by Steve on Mar 18, 2022 6:04:14 GMT
Hi Ale,
This can be done but we need to force the mouse move first, WAIT for the mouse to move, and with an AND condition finally click on the internal %mouse_x% and %mouse_y% vars. These internal mouse vars hold the current mouse x and y so they will be populated with the initial move within the DETECT IMAGE condition.
This example has a +250 X and +250 Y offset.
1 | IF | DETECT IMAGE | image path D:\pics\capture2.bmp::match quick::move mouse yes::offset +250 +250 | IMAGE FOUND | WAIT MILLISECONDS | 10 | AND | 2 | RUN ACTION | MOUSE CLICK | Left click at %mouse_x% %mouse_y% 1 times with 50 ms delay
|
|
|
Post by Ale on Mar 18, 2022 19:19:00 GMT
Hey guys, thx for answering. I had already guesed there was indeed a fixed name/denomination/route to call the X and Y values of the mouse no matter where they were, just use those values; but didn't know exactly how. Great group and tool
|
|