MACRO record

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
ishaanmusic
Newbie
Posts: 5
Joined: Sun Jun 14, 2020 4:06 pm

MACRO record

Post by ishaanmusic » Tue Nov 10, 2020 12:08 am

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 .

User avatar
Dorian (MJT support)
Automation Wizard
Posts: 1348
Joined: Sun Nov 03, 2002 3:19 am
Contact:

Re: MACRO record

Post by Dorian (MJT support) » Tue Nov 10, 2020 8:46 am

Could you provide a screenshot and explain what you're trying to click on please?
Yes, we have a Custom Scripting Service. Message me or go here

ishaanmusic
Newbie
Posts: 5
Joined: Sun Jun 14, 2020 4:06 pm

Re: MACRO record

Post by ishaanmusic » Tue Nov 10, 2020 10:02 am

Dorian (MJT support) wrote:
Tue Nov 10, 2020 8:46 am
Could you provide a screenshot and explain what you're trying to click on please?
it clicks on that first field starting from butterfly position
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 :

ishaanmusic
Newbie
Posts: 5
Joined: Sun Jun 14, 2020 4:06 pm

Re: MACRO record

Post by ishaanmusic » Tue Nov 10, 2020 10:13 am

//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

User avatar
Dorian (MJT support)
Automation Wizard
Posts: 1348
Joined: Sun Nov 03, 2002 3:19 am
Contact:

Re: MACRO record

Post by Dorian (MJT support) » Tue Nov 10, 2020 10:40 am

ishaanmusic wrote:
Tue Nov 10, 2020 10:02 am
i 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 am
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 :

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.
2.png
I think many years ago I actually automated this or something similar (Country Life?) too.
Yes, we have a Custom Scripting Service. Message me or go here

User avatar
Dorian (MJT support)
Automation Wizard
Posts: 1348
Joined: Sun Nov 03, 2002 3:19 am
Contact:

Re: MACRO record

Post by Dorian (MJT support) » Tue Nov 10, 2020 10:42 am

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.
Yes, we have a Custom Scripting Service. Message me or go here

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts