first i use image recognition then it has to start macro of exact same mouse movements on where it clicks on that image spot .
but macro schedular inbuilt one works on x and y postions .
like you see pre recorded macros in game for guns shooting to reduce recoil
i need that type of macro .
MACRO record
Moderators: JRL, Dorian (MJT support)
- Dorian (MJT support)
- Automation Wizard
- Posts: 1415
- Joined: Sun Nov 03, 2002 3:19 am
Re: MACRO record
Could you provide a screenshot and explain what you're trying to click on please?
-
- Newbie
- Posts: 5
- Joined: Sun Jun 14, 2020 4:06 pm
Re: MACRO record
it clicks on that first field starting from butterfly positionDorian (MJT support) wrote: ↑Tue Nov 10, 2020 8:46 amCould you provide a screenshot and explain what you're trying to click on please?
and from there it always straight mouse hold down
to left then right then again left then again right
depends on how many fields
so i wanna record macro which starts from that first field.
i cant use x y cordinates bcz foreground window wont always be same
i tried x y cordiate relative to foreground window it didnt worked as macro :
-
- Newbie
- Posts: 5
- Joined: Sun Jun 14, 2020 4:06 pm
Re: MACRO record
//Set IGNORESPACES to 1 to force script interpreter to ignore spaces.
//If using IGNORESPACES quote strings in {" ... "}
//Let>IGNORESPACES=1
//Find and Left Click Center of
FindImagePos>%BMP_DIR%\image_1.bmp,SCREEN,0.7,1,XArr,YArr,NumFound,CCOEFF
If>NumFound>0
MouseMove>XArr_0,YArr_0
LDown
MouseMoveRel>474,340
wait>0.10
lClick
wait>.10
//Find and Left Click Bottom Left of
FindImagePos>%BMP_DIR%\image_2.bmp,SCREEN,0.7,3,XArr,YArr,NumFound,CCOEFF
If>NumFound>0
MouseMove>XArr_0,YArr_0
LClick
(Here i want to add pre recorded macro to cut those yellow fields
Endif
Endif
//If using IGNORESPACES quote strings in {" ... "}
//Let>IGNORESPACES=1
//Find and Left Click Center of
FindImagePos>%BMP_DIR%\image_1.bmp,SCREEN,0.7,1,XArr,YArr,NumFound,CCOEFF
If>NumFound>0
MouseMove>XArr_0,YArr_0
LDown
MouseMoveRel>474,340
wait>0.10
lClick
wait>.10
//Find and Left Click Bottom Left of
FindImagePos>%BMP_DIR%\image_2.bmp,SCREEN,0.7,3,XArr,YArr,NumFound,CCOEFF
If>NumFound>0
MouseMove>XArr_0,YArr_0
LClick
(Here i want to add pre recorded macro to cut those yellow fields
Endif
Endif
- Dorian (MJT support)
- Automation Wizard
- Posts: 1415
- Joined: Sun Nov 03, 2002 3:19 am
Re: MACRO record
ishaanmusic wrote: ↑Tue Nov 10, 2020 10:02 ami cant use x y cordinates bcz foreground window wont always be same
If you were to ensure the window size and position was always the same every time, and the field was in the same position every time, this should work. ResizeWindow with MoveWindow will help with that, or if the window allows, WindowAction to maximize the window. Once you have moved everything into the correct position, you should be able to simply use MouseMoves and clicks. Of course you'd have to edit if you reconfigure your farm.
ishaanmusic wrote: ↑Tue Nov 10, 2020 10:02 ami cant use x y cordinates bcz foreground window wont always be same
i tried x y cordiate relative to foreground window it didnt worked as macro :
I'd have thought this would work as long as your window was the same size and your farm was in the same position.
However, if this was mine, I'd probably just loop in some more image recognition to click on each corn plot. My needle image would look something like the image attached, and I'd use the offset to click top middle of the image. I think many years ago I actually automated this or something similar (Country Life?) too.
- Dorian (MJT support)
- Automation Wizard
- Posts: 1415
- Joined: Sun Nov 03, 2002 3:19 am
Re: MACRO record
Also, if you take the image recognition route, you might want to edit your plot so none of the plots are hidden behind anything, as they are behind the billboard.