Hi
Im using waitscreenimage to wait for a specific image to appear on the screen and when it does I want the mouse to move to a specific position depending on where this image shows up e.g. 2 cm to the right and 1 cm down.
How do i do this?
thank you in advance
Bruno
how to change mouseposition depending on found image?
Moderators: JRL, Dorian (MJT support)
here is my very simple script
label>start
WaitScreenImage>C:\gul haand.bmp,0
Wait>2
MouseMove>1000,44
LClick>
Wait>10
MouseMove>1201,631
lclick>
Wait>20
Goto>start
This does not take into consideration where the image pops up but only goes to a specific position on the screen regardless of where the image pops up
label>start
WaitScreenImage>C:\gul haand.bmp,0
Wait>2
MouseMove>1000,44
LClick>
Wait>10
MouseMove>1201,631
lclick>
Wait>20
Goto>start
This does not take into consideration where the image pops up but only goes to a specific position on the screen regardless of where the image pops up
Hi brunop,
Something like this?
Warning: untested script. No error handling.
Do you want to move 2cm to right, 1cm down regardless of monitor size and screen resolution, for example if your image is a correctly scaled ruler?
Not sure why you want the GoTo loop, does the image disappear and reappear when you click?
Gale
Something like this?
Code: Select all
label>start
Let>needle=C:\gul haand.bmp
//wait up to 20 seconds until image is found on screen
Let>WSI_TIMEOUT=20
Let>ct=0
WaitScreenImage>%needle%,%ct%
//Get coordinates of upper left corner of image.
Let>ul=0
FindImagePos>%needle%,SCREEN,%ct%,%ul%,X,Y,NumFound
Wait>2
//MouseMove>1000,44 (upper left coordinates?)
MouseMove>X_0,Y_0
LClick>
Wait>10
//MouseMove>1201,631 (2cm to right, 1cm down?)
//Move mouse so many pixels to the right and down
Let>X_0=%X_0%+200
Let>Y_0=%Y_0%+100
MouseMove>X_0,Y_0
lclick>
Wait>20
Goto>start
Do you want to move 2cm to right, 1cm down regardless of monitor size and screen resolution, for example if your image is a correctly scaled ruler?
Not sure why you want the GoTo loop, does the image disappear and reappear when you click?
Gale