; To operate, enter cartography mode, (F8 twice) and zoom all the way in ; Pin the plant flax menu in the top left corner of the screen. ; Ensure you have enough seeds and water ; ; It is likely that the centre of the screen will be mis-identified, and flax ; will be planted with a drift left or right. To fix uncomment testing=true ; below, and observe the symetry of the mouse movements. Adjust verticalDrift ; and horizontalDrift ; Uncomment the following for harvesting if not already loaded. ; Alt-left-click - harvest/weed-water. ;!LButton:: ;Click ;MouseGetPos, mousex, mousey ;mx := mousex + 16 ;my := mousey - 5 ;sleep 100 ;MouseGetPos, mousex, mousey ;Click, %mx%, %my% ;MouseMove, mousex, mousey ;return ^+f:: IfWinExist eGenesis Client { WinActivate ;SendMode Input SetDefaultMouseSpeed, 100 ;CoordMode, Mouse, Relative CoordMode, Mouse, Screen WinGetPos,,, winWidth, winHeight CoordMode, Mouse, Relative verticalDrift = 16 horizontalDrift = -10 winXCenter := winWidth / 2 + horizontalDrift winYCenter := winHeight / 2 + verticalDrift MoveDelay = 500 Spacing = 160 winXLeft := winXCenter - Spacing winXRight := winXCenter + Spacing winYUp := winYCenter - Spacing ; Place you Flax plant menu under here. PlantMenuX = 60 PlantMenuY = 40 ;testing=true if (testing=true) { MouseMove, PlantMenuX, PlantMenuY Sleep 1000 MouseMove, %winXCenter%, %winYCenter% Sleep 1000 MouseMove, %winXLeft%, %winYCenter% Sleep 1000 MouseMove, %winXRight%, %winYCenter% Sleep 1000 MouseMove, %winXCenter%, %winYUp% } ; while testing you may want to reduce these values to save wasting flax. ; For growing Xfields = 8 Yfields = 2 ; double rows ;For harvesting Seeds ;Xfields = 20 ;Yfields = 1 ;PlantRow(winXLeft,6) ;MoveNorth(winYUp) ;Sleep 1000 ;PlantRow(winXRight,6) ;MoveNorth(winYUp) Loop, %YFields% { Loop, %Xfields% { MouseGetPos, origX, origY MouseClick, left, PlantMenuX, PlantMenuY MouseMove, %origX%, %origY% if (A_Index >= Xfields) break MouseGetPos, origX, origY MouseClick, Left, %winXLeft%, %winYCenter% MouseMove, %origX%, %origY% Sleep, MoveDelay } MouseGetPos, origX, origY MouseClick, Left, %winXCenter%, %winYUp% MouseMove, %origX%, %origY% Sleep, MoveDelay Loop, %Xfields% { MouseGetPos, origX, origY MouseClick, left, PlantMenuX, PlantMenuY MouseMove, %origX%, %origY% if (A_Index >= Xfields) break MouseGetPos, origX, origY MouseClick, Left, %winXRight%, %winYCenter% MouseMove, %origX%, %origY% Sleep, MoveDelay } if (A_Index >= Yfields) break ; Leave some space in the middle to stand. MouseGetPos, origX, origY MouseClick, Left, %winXCenter%, %winYUp% MouseMove, %origX%, %origY% Sleep, MoveDelay MouseGetPos, origX, origY MouseClick, Left, %winXCenter%, %winYUp% MouseMove, %origX%, %origY% Sleep, MoveDelay } Return } ;Subroutines are Broken, ;PlantRow(winXLeft,6) ;MoveNorth(winYUp) ;Sleep 1000 ;PlantRow(winXRight,6) ;MoveNorth(winYUp) ;Return PlantSingleFlax() { MouseGetPos, origX, origY MouseClick, left, PlantMenuX, PlantMenuY MouseMove, %origX%, %origY% return } PlantRow(Spacing,Count) { loop, %Count% { ; PlantSingleFlax() if (A_Index >= Count) return MouseGetPos, origX, origY MouseClick, Left, %Spacing%, %winYCenter% MouseMove, %origX%, %origY% Sleep, MoveDelay } return } MoveNorth(winYUp) { MouseGetPos, origX, origY MouseClick, Left, %winXCenter%, %winYUp% MouseMove, %origX%, %origY% Sleep, MoveDelay } ;Subroutines seem bust....global scope or something