The Wiki for Tale 4 is in read-only mode and is available for archival and reference purposes only. Please visit the current Tale 11 Wiki in the meantime.

If you have any issues with this Wiki, please post in #wiki-editing on Discord or contact Brad in-game.

Difference between revisions of "User:Peptide"

From A Tale in the Desert
Jump to navigationJump to search
(New page: A script for Quin. This is for 1920X1200 res ... using the LEFT 75% of the screen. If you change res then you will need to rerecord the functions Weedwaterhavest and MovetoMiddle. Use t...)
 
 
Line 1: Line 1:
 
A script for Quin.
 
A script for Quin.
  
This is for 1920X1200 res ... using the LEFT 75% of the screen.
+
#SingleInstance force
 
 
If you change res then you will need to rerecord the functions Weedwaterhavest and MovetoMiddle.
 
Use the same timing.
 
 
 
 
 
 
 
  
START OF SCRIPT
+
;
#SingleInstance force
+
; Turn off Flax hotkeys!
 +
; Pin the plant menu to the TOP LEFT of your window
 +
; Turn off " Right click pins a menu" under interface options. (Makes any errors less likly to stop the hole cycle )
 +
;
 +
; You can set some virables to match your system. They are all found one page down in the function SetVars
 +
; If you change the dimension pick 3 5 or 7. You will also need to change the waittimes (less for larger plots)
 +
;
 +
;      This is set up for 7 but 7X7 is hard to get to work ... try 5 for a start it's alot more forgiving.
 +
;
 +
; Alt X (Set screen) will set the zoom level of F8. Personally after it's set I lock it with Alt L
 +
; Alt P (Set the screen first) will help you set the correct virables for your system
 +
; Alt F will set the screen and then do 4 flax runs
 +
; Alt I will do one flax run. (Set the screen first)
 +
; Alt F1 will reload a script if you change any code. ( Save First!! )
 +
; Alt S will pause the script.
 +
; Alt Q will Quit
 +
; Alt T will do one harvest Cycle. (Useful if you had to fix a cycle halfway through)
 +
; Alt E will do Line of plots to the east and then a line back below it. Great for gathering seeds
 +
;
 +
;
 +
; Flat 4 needs tweaking. Recommend use single cycles for now.
  
 
!F1::
 
!F1::
Line 26: Line 40:
  
 
!f::
 
!f::
Flax()
+
Flax4()
 
return
 
return
 +
 +
!p::
 +
GetPos()
 +
return
 +
  
 
!x::
 
!x::
Line 33: Line 52:
 
return
 
return
  
!v::
+
!t::
Weedwaterhavest()
+
GatherSeeds()
 +
return
 +
 
 +
 
 +
!i::
 +
FlaxOne()
 
return
 
return
  
!p::
+
 
 +
!e::
 
Seed()
 
Seed()
 
return
 
return
  
!o::
+
!v::
Gatherseeds()
+
SetVars()
 
return
 
return
  
Flax()
+
 
 +
SetVars()
 +
{
 +
global dimension
 +
global VarWaitTime1
 +
global VarWaitTime2
 +
global VarWaitTime3
 +
global VarHavestSpeed
 +
 +
global width
 +
global VarMenuDistance
 +
 +
global VarXUtilityMenu
 +
global VarYUtilityMenu
 +
 +
global VarYTeardownMenu
 +
global VarXTearDownConfirmButton
 +
global VarYTearDownConfirmButton
 +
global Xcenter
 +
global Ycenter
 +
 +
global VarSeedLength
 +
global VarHavestTime
 +
global VarGatherWaitTime
 +
 +
;This does 5X5-1 or 24 beds
 +
;dimension := 5
 +
;VarWaitTime1 := 11000
 +
;VarWaitTime2 := 5000
 +
;VarWaitTime3 := 5000
 +
;VarHavestSpeed := 333
 +
 
 +
;This does 5X5-1 or 24 beds
 +
dimension := 7
 +
VarWaitTime1 := 230
 +
VarWaitTime2 := 200
 +
VarWaitTime3 := 200
 +
VarHavestSpeed := 70
 +
 +
 +
;75 for 1920X1200 res
 +
width := 75
 +
 +
 +
VarMenuDistance := 40
 +
 +
 +
VarXUtilityMenu := 56
 +
VarYUtilityMenu := 22
 +
 +
VarXTearDownConfirmButton := 806
 +
VarYTearDownConfirmButton := 596
 +
 +
 +
VarYTeardownMenu := -10
 +
 +
 +
 +
; Wait for the window to become active, then get the window stats
 +
WinWait, eGenesis Client,
 +
IfWinNotActive, eGenesis Client, , WinActivate, eGenesis Client,
 +
WinWaitActive, eGenesis Client,
 +
WinGetActiveStats, win_Title, Xmax, Ymax, win_Xpos, win_Ypos
 +
Xcenter := Xmax//2 - 3
 +
Ycenter := Ymax//2 + 16
 +
 +
VarSeedLength := 25
 +
VarHavestTime := 1300
 +
VarGatherWaitTime := 10000
 +
}
 +
 
 +
GetPos()
 
{
 
{
 +
Msgbox, Create a NEW flax bed anywhere and press ok
 +
Msgbox,,, Open the menu on it and then dont move the mouse. (And wait for 4 seconds)
 +
Sleep 4000
 +
MouseGetPos, xpos, ypos
 +
Msgbox, Now hover the mouse over UTILITY. (And wait for 4 seconds)
 +
sleep 4000
 +
MouseGetPos, xpos2, ypos2
 +
xpos := xpos2 - xpos
 +
ypos := ypos2 - ypos
 +
Msgbox, Change the virable VarXUtilityMenu to %xpos% and VarYUtilityMenu  to %ypos%
 +
 +
 +
Msgbox, Create a NEW flax bed anywhere. Open the menu on it and choose tear down. Once the "Are you sure you want to tear down this Flax bed?" dialog is shown press OK.
 +
sleep 1000
 +
MsgBox,,, HOVER the mouse over the "Tear Down" button., 3
 +
sleep 2000
 +
MouseGetPos, xpos, ypos
 +
Msgbox, Change the virable VarXTearDownConfirmButton to %xpos% and VarYTearDownConfirmButton  to %ypos%
 +
 +
Msgbox, Create a two flax beds nicly becide each other (east-west) and press OK.
 +
sleep 1000
 +
MsgBox,,, HOVER the mouse over the Middle of the Left Bed., 3
 +
sleep 2000
 +
MouseGetPos, xpos, ypos
 +
MsgBox,,, HOVER the mouse over the Middle of the Right Bed., 3
 +
sleep 2000
 +
MouseGetPos, xpos2, ypos2
 +
xpos := Xpos2 - Xpos
 +
Msgbox, Change the virable Width to %xpos%
 +
 +
}
  
global dimension
 
  
dimension := 5
+
MovetoMiddle()
 +
{
 +
global Dimension
 +
global Width
 +
global Xcenter
 +
global Ycenter
 +
 +
global VarMenuDistance
 +
 +
 +
global VarXUtilityMenu
 +
global VarYUtilityMenu
 +
 +
 +
global VarYTeardownMenu
 +
 +
global VarXTearDownConfirmButton
 +
global VarYTearDownConfirmButton
 +
 +
X := - dimension
 +
X /= 2
 +
X := X * width
 +
 +
;click the middle flax bed to bring up the menu
 +
MouseClick, right,  Xcenter + X,  Ycenter + X
 +
Sleep, 300
 +
 +
;Click the utility Menu
 +
MouseClick, right,  Xcenter + X + VarXUtilityMenu,  Ycenter + X + VarYUtilityMenu
 +
Sleep, 300
 +
 +
;Click "tear down this building"
 +
MouseClick, right,  Xcenter + X + VarXUtilityMenu + VarMenuDistance,  Ycenter + X + VarYUtilityMenu + VarYTeardownMenu
 +
Sleep, 300
 +
 +
;Click confirm
 +
MouseClick, Left, VarXTearDownConfirmButton, VarYTearDownConfirmButton
 +
Sleep, 2500
 +
 +
;Click where the flax bed WAS to run to that spot
 +
MouseClick, left,  Xcenter + X,  Ycenter + X
 +
Sleep, 2500
  
SetScreen()
 
  
Loop 4 {
+
; end of function
 +
}
  
Plant()
 
MovetoMiddle()
 
  
Sleep 12000
+
Flax4()
Weedwaterhavest()
+
{
  
Sleep 1500
+
Global Dimension
Weedwaterhavest()
+
 +
SetScreen()
  
Sleep 4000
+
Loop 4 {
Weedwaterhavest()
 
  
MouseClick, left,  659,  395
+
FlaxOne()
Sleep, 500
+
 
}
 
}
  
 
}
 
}
  
Seed()
+
FlaxOne()
 
{
 
{
 +
; Must set the screen before flaxing one set
  
 +
global Xcenter
 +
global Ycenter
 +
global width
 
global dimension
 
global dimension
 +
global VarWaitTime1
 +
global VarWaitTime2
 +
global VarWaitTime3
  
dimension := 7
+
SetVars()  
 
+
SetScreen()
 
 
Plant()
 
Plant()
 
 
Gatherseeds()
+
MovetoMiddle()
 +
 
 +
Sleep VarWaitTime1
 +
Weedwaterhavest()
 +
 
 +
Sleep VarWaitTime2
 +
Weedwaterhavest()
  
;MovetoMiddle()
+
Sleep VarWaitTime3
 +
Weedwaterhavest()
  
;Sleep 12000
+
Move(Up, Dimension /= 2)
;Weedwaterhavest()
+
Move(Left, Dimension /= 2)
 +
Sleep, 500
 +
}
  
;Sleep 1500
 
;Weedwaterhavest()
 
  
;Sleep 4000
 
;Weedwaterhavest()
 
  
}
 
  
 
SetScreen()
 
SetScreen()
 
{
 
{
 
 
global Xcenter
 
global Xcenter
 
global Ycenter
 
global Ycenter
global width
+
 
+
message := "Please close your friends list and minimize chat and stat tabs in order to ensure proper macroage.`n"
+
SetVars()
message .= "Ensure that Hotkeys on Flax is disabled`n"
 
message .= "Also disable camera moves very fast and camera moves unreasonably fast.`n`n"
 
message .= "Pin the plant menu at the very top left corner of the screen`n`n"
 
message .= "IN CASE OF EMERGENCY: HIT ALT-Q"
 
MsgBox,,, %message%, 10
 
 
 
; Wait for the window to become active, then get the window stats
 
WinWait, eGenesis Client,
 
IfWinNotActive, eGenesis Client, , WinActivate, eGenesis Client,
 
WinWaitActive, eGenesis Client,
 
WinGetActiveStats, win_Title, Xmax, Ymax, win_Xpos, win_Ypos
 
  
 +
 
Send {F5}{F8}{F8}
 
Send {F5}{F8}{F8}
 
MouseMove, 0,0
 
MouseMove, 0,0
Line 124: Line 288:
 
MouseMove, 0, 0
 
MouseMove, 0, 0
 
Sleep 5000
 
Sleep 5000
Xcenter := Xmax//2 - 3
+
Ycenter := Ymax//2 + 16
 
;Flax beds are ~55 coords wide at this zoom level
 
; Changed to 70 for 1920X1200 res
 
width := 70
 
 
MouseMove, Xcenter, Ycenter, 0
 
MouseMove, Xcenter, Ycenter, 0
  
Line 148: Line 308:
 
i += 1
 
i += 1
 
Plant_Row("right", dimension)
 
Plant_Row("right", dimension)
Move("down")
 
 
if (i >= dimension)
 
if (i >= dimension)
 
break
 
break
 +
Move("down")
  
 
i += 1
 
i += 1
 
Plant_Row("left", dimension)
 
Plant_Row("left", dimension)
Move("down")
 
 
if (i >= dimension)
 
if (i >= dimension)
 
break
 
break
 +
Move("down")
 
}
 
}
  
Line 163: Line 323:
 
}
 
}
  
MovetoMiddle()
 
{
 
 
MouseClick, right,  647,  395
 
Sleep, 333
 
MouseClick, left,  681,  422
 
Sleep, 333
 
MouseClick, left,  730,  418
 
Sleep, 333
 
MouseClick, left,  818,  590
 
Sleep, 3330
 
MouseClick, left,  659,  395
 
Sleep, 250
 
 
 
 
 
; end of function
 
}
 
  
  
 
Weedwaterhavest()
 
Weedwaterhavest()
 
{
 
{
 
+
global Xcenter
 
+
global Ycenter
MouseClick, right,  650,  465
+
global width
Sleep, 333
+
global dimension
MouseClick, left,  687,  469
+
global VarMenuDistance
Sleep, 333
+
global VarHavestSpeed
MouseClick, right,  731,  457
+
Sleep, 333
+
Y := - dimension
MouseClick, left,  768,  460
+
Y /= 2
Sleep, 333
+
Y := Y * width
MouseClick, right,  806,  456
+
Sleep, 333
+
Flip := False
MouseClick, left,  840,  453
+
Loop %dimension% {
Sleep, 333
+
MouseClick, right,  862,  445
+
X := - dimension
Sleep, 333
+
X /= 2
MouseClick, left,  898,  448
+
X := X * width
Sleep, 333
+
Loop %dimension% {
MouseClick, right,  941,  470
+
Sleep, 333
+
if NOT ((X == 0) && (Y == 0)) {
MouseClick, left,  964,  471
+
;MsgBox,,, %X% %Y%, 5
Sleep, 333
+
MouseClick, right,  944,  510
+
if Flip {
Sleep, 333
+
Sleep VarHavestSpeed
MouseClick, left,  969,  514
+
MouseClick, right,  300, Ycenter + Y
Sleep, 333
+
Sleep, VarHavestSpeed
MouseClick, right,  879,  533
+
MouseClick, right,  Xcenter - XYcenter + Y
Sleep, 333
+
Sleep, VarHavestSpeed
MouseClick, left,  920,  528
+
MouseClick, right,  Xcenter - X + VarMenuDistanceYcenter + Y
Sleep, 333
+
} else {
MouseClick, right,  822,  522
+
Sleep VarHavestSpeed
Sleep, 333
+
MouseClick, right,  300Ycenter + Y
MouseClick, left,  854,  525
+
Sleep, VarHavestSpeed
Sleep, 333
+
MouseClick, right,  Xcenter + XYcenter + Y
MouseClick, right,  745,  526
+
Sleep, VarHavestSpeed
Sleep, 333
+
MouseClick, right,  Xcenter + X + VarMenuDistanceYcenter + Y
MouseClick, left,  763,  526
+
}
Sleep, 333
+
MouseClick, right,  674,  540
+
}
Sleep, 333
+
MouseClick, left,  703,  542
+
X := X + width
Sleep, 333
+
}
MouseClick, right,  680,  598
+
Y := Y + width
Sleep, 333
+
Flip := Not Flip
MouseClick, left,  714,  600
+
}
Sleep, 333
+
MouseClick, right,  743,  596
 
Sleep, 333
 
MouseClick, left,  778,  602
 
Sleep, 333
 
MouseClick, right,  866,  601
 
Sleep, 333
 
MouseClick, left,  894,  601
 
Sleep, 333
 
MouseClick, right,  945,  603
 
Sleep, 333
 
MouseClick, left,  979,  608
 
Sleep, 333
 
MouseClick, right,  939,  660
 
Sleep, 333
 
MouseClick, left,  972,  655
 
Sleep, 333
 
MouseClick, right, 889, 663
 
Sleep, 333
 
MouseClick, left,  939,  656
 
Sleep, 333
 
MouseClick, right,  819,  664
 
Sleep, 333
 
MouseClick, left,  848662
 
Sleep, 333
 
MouseClick, right,  755657
 
Sleep, 333
 
MouseClick, left,  789,  659
 
Sleep, 333
 
MouseClick, right,  680667
 
Sleep, 333
 
MouseClick, left,  709,  666
 
Sleep, 333
 
MouseClick, right,  686735
 
Sleep, 333
 
MouseClick, left,  721, 730
 
Sleep, 333
 
MouseClick, right,  747742
 
Sleep, 333
 
MouseClick, left,  796,  747
 
Sleep, 333
 
MouseClick, right,  835747
 
Sleep, 333
 
MouseClick, left,  870,  744
 
Sleep, 333
 
MouseClick, right,  897,  739
 
Sleep, 333
 
MouseClick, left,  934,  743
 
Sleep, 333
 
MouseClick, right,  965,  737
 
Sleep, 333
 
MouseClick, left,  982,  737
 
Sleep, 333
 
 
 
 
; end of function
 
; end of function
 
}
 
}
 
  
 
Move(direction, count = 1) {
 
Move(direction, count = 1) {
Line 325: Line 412:
 
}
 
}
  
GatherSeeds()
+
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
Seed()
 
{
 
{
  
MouseClick, left,  294,  597
+
global Xcenter
Sleep, 7000
+
global Ycenter
MouseClick, left,  780,  112
+
global width
Sleep, 7000
+
global VarSeedLength
MouseClick, left,  893,  601
+
global VarMenuDistance
Sleep, 500
+
global VarGatherWaitTime
MouseClick, left,  919,  601
+
 
Sleep, 500
+
 
MouseClick, left,  934,  601
+
SetVars()
Sleep, 500
+
MouseClick, left,  967,  607
+
Plant_Row("right", VarSeedLength)
Sleep, 500
+
Move("down")
MouseClick, left,  953,  600
+
Sleep, 500
+
Plant_Row("left", VarSeedLength)
MouseClick, left,  977,  601
+
Sleep, 500
+
Move("left", 2)
MouseClick, left,  943,  597
+
Move("up")
Sleep, 500
+
MouseClick, left,  1011,  596
+
Sleep %VarGatherWaitTime%
Sleep, 500
+
GatherSeeds()
MouseClick, left,  951,  593
+
Sleep, 500
+
}
MouseClick, left,  1003,  590
 
Sleep, 500
 
MouseClick, left,  947,  598
 
Sleep, 500
 
MouseClick, left,  1010,  599
 
Sleep, 500
 
MouseClick, left,  948,  597
 
Sleep, 500
 
MouseClick, left,  1026,  593
 
Sleep, 500
 
MouseClick, left,  883,  665
 
Sleep, 500
 
MouseClick, left,  957,  667
 
Sleep, 500
 
MouseClick, left,  787,  651
 
Sleep, 500
 
MouseClick, left,  873,  647
 
Sleep, 500
 
MouseClick, left,  718,  641
 
Sleep, 500
 
MouseClick, left,  766,  643
 
Sleep, 500
 
MouseClick, left,  678,  627
 
Sleep, 500
 
MouseClick, left,  741,  624
 
Sleep, 500
 
MouseClick, left,  664,  617
 
Sleep, 500
 
MouseClick, left,  726,  615
 
Sleep, 500
 
MouseClick, left,  673,  606
 
Sleep, 500
 
MouseClick, left,  730,  604
 
Sleep, 500
 
MouseClick, left,  672,  600
 
Sleep, 500
 
MouseClick, left,  737,  602
 
Sleep, 500
 
MouseClick, left,  741,  667
 
Sleep, 500
 
MouseClick, left,  792,  665
 
Sleep, 500
 
MouseClick, left,  834,  651
 
Sleep, 500
 
MouseClick, left,  874,  649
 
Sleep, 500
 
MouseClick, left,  905,  653
 
Sleep, 500
 
MouseClick, left,  964,  655
 
Sleep, 500
 
MouseClick, left,  936,  634
 
Sleep, 500
 
MouseClick, left,  964,  633
 
Sleep, 500
 
MouseClick, left,  949,  615
 
Sleep, 500
 
MouseClick, left,  991,  612
 
Sleep, 500
 
MouseClick, left,  944,  603
 
Sleep, 500
 
MouseClick, left,  991,  601
 
Sleep, 500
 
MouseClick, left,  950,  600
 
Sleep, 500
 
MouseClick, left,  988,  601
 
Sleep, 500
 
MouseClick, left,  876,  669
 
Sleep, 500
 
MouseClick, left,  928,  664
 
Sleep, 500
 
MouseClick, left,  784,  642
 
Sleep, 500
 
MouseClick, left,  820,  640
 
Sleep, 500
 
MouseClick, left,  716,  649
 
Sleep, 500
 
MouseClick, left,  742,  648
 
Sleep, 500
 
MouseClick, left,  677,  620
 
Sleep, 500
 
MouseClick, left,  736,  618
 
Sleep, 500
 
MouseClick, left,  670,  617
 
Sleep, 500
 
MouseClick, left,  716,  620
 
Sleep, 500
 
MouseClick, left,  674,  606
 
Sleep, 500
 
MouseClick, left,  704,  607
 
Sleep, 500
 
MouseClick, left,  677,  602
 
Sleep, 500
 
MouseClick, left,  720,  598
 
Sleep, 500
 
MouseClick, left,  734,  668
 
Sleep, 500
 
MouseClick, left,  763,  663
 
Sleep, 500
 
MouseClick, left,  821,  646
 
Sleep, 500
 
MouseClick, left,  844,  651
 
Sleep, 500
 
MouseClick, left,  892,  649
 
Sleep, 500
 
MouseClick, left,  961,  650
 
Sleep, 500
 
MouseClick, left,  933,  633
 
Sleep, 500
 
MouseClick, left,  1005,  632
 
Sleep, 500
 
MouseClick, left,  948,  612
 
Sleep, 500
 
MouseClick, left,  1000,  608
 
Sleep, 500
 
MouseClick, left,  947,  609
 
Sleep, 500
 
MouseClick, left,  1011,  607
 
Sleep, 500
 
MouseClick, left,  945,  599
 
Sleep, 500
 
MouseClick, left,  998,  600
 
Sleep, 500
 
MouseClick, left,  875,  670
 
Sleep, 500
 
MouseClick, left,  939,  668
 
Sleep, 500
 
MouseClick, left,  777,  652
 
Sleep, 500
 
MouseClick, left,  857,  644
 
Sleep, 500
 
MouseClick, left,  705,  657
 
Sleep, 500
 
MouseClick, left,  763,  654
 
Sleep, 500
 
MouseClick, left,  675,  629
 
Sleep, 500
 
MouseClick, left,  722,  628
 
Sleep, 500
 
MouseClick, left,  667,  609
 
Sleep, 500
 
MouseClick, left,  752,  609
 
Sleep, 500
 
MouseClick, left,  667,  606
 
Sleep, 500
 
MouseClick, left,  740,  608
 
Sleep, 500
 
MouseClick, left, 667,  601
 
Sleep, 500
 
MouseClick, left, 744,  596
 
Sleep, 500
 
MouseClick, left,  733,  671
 
Sleep, 500
 
MouseClick, left,  809,  671
 
Sleep, 500
 
MouseClick, left,  831,  644
 
Sleep, 500
 
MouseClick, left,  895,  642
 
Sleep, 500
 
MouseClick, left,  895,  642
 
Sleep, 500
 
MouseClick, left,  965,  639
 
Sleep, 500
 
MouseClick, left,  938,  631
 
Sleep, 500
 
MouseClick, left,  995,  630
 
Sleep, 500
 
MouseClick, left,  940,  618
 
Sleep, 500
 
MouseClick, left,  989,  616
 
Sleep, 500
 
MouseClick, left,  957,  612
 
Sleep, 500
 
MouseClick, left,  1023,  607
 
Sleep, 500
 
MouseClick, left,  933,  599
 
Sleep, 500
 
MouseClick, left,  994,  596
 
Sleep, 500
 
MouseClick, left,  874,  672
 
Sleep, 500
 
  
 +
GatherSeeds()
 +
{
 +
Global VarSeedLength
 +
Global VarMenuDistance
 +
Global VarHavestTime
 +
Global Xcenter
 +
Global YCenter
 +
Global Width
 +
 +
SetVars()
 +
 +
loop {
  
 +
loop %VarSeedLength% {
 +
MouseClick, right,  Xcenter + (2 * Width),  Ycenter
 +
Sleep 200
 +
MouseClick, right,  Xcenter + (2 * Width) + VarMenuDistance,  Ycenter
 +
Sleep 1300
 +
}
 +
 +
Move("right", 3)
 +
Move("down")
 +
 +
loop %VarSeedLength% {
 +
MouseClick, right,  Xcenter - (2 * Width),  Ycenter
 +
Sleep 200
 +
MouseClick, right,  Xcenter - (2 * Width) + VarMenuDistance,  Ycenter
 +
Sleep %VarHavestTime%
 +
}
  
 +
Move("left", 3)
 +
Move("up")
 +
}
 +
 +
; end of function
 
}
 
}
 +
  
  
Line 539: Line 487:
 
Gui, Destroy
 
Gui, Destroy
 
return
 
return
 
END OF SCRIPT
 

Latest revision as of 10:11, 22 February 2009

A script for Quin.

  1. SingleInstance force
Turn off Flax hotkeys!
Pin the plant menu to the TOP LEFT of your window
Turn off " Right click pins a menu" under interface options. (Makes any errors less likly to stop the hole cycle )
You can set some virables to match your system. They are all found one page down in the function SetVars
If you change the dimension pick 3 5 or 7. You will also need to change the waittimes (less for larger plots)
This is set up for 7 but 7X7 is hard to get to work ... try 5 for a start it's alot more forgiving.
Alt X (Set screen) will set the zoom level of F8. Personally after it's set I lock it with Alt L
Alt P (Set the screen first) will help you set the correct virables for your system
Alt F will set the screen and then do 4 flax runs
Alt I will do one flax run. (Set the screen first)
Alt F1 will reload a script if you change any code. ( Save First!! )
Alt S will pause the script.
Alt Q will Quit
Alt T will do one harvest Cycle. (Useful if you had to fix a cycle halfway through)
Alt E will do Line of plots to the east and then a line back below it. Great for gathering seeds
Flat 4 needs tweaking. Recommend use single cycles for now.

!F1::

Reload the script when you make changes

reload return

!s:: suspend toggle return

!q:: ExitApp return

!f:: Flax4() return

!p:: GetPos() return


!x:: SetScreen() return

!t:: GatherSeeds() return


!i:: FlaxOne() return


!e:: Seed() return

!v:: SetVars() return


SetVars() { global dimension global VarWaitTime1 global VarWaitTime2 global VarWaitTime3 global VarHavestSpeed

global width global VarMenuDistance

global VarXUtilityMenu global VarYUtilityMenu

global VarYTeardownMenu global VarXTearDownConfirmButton global VarYTearDownConfirmButton global Xcenter global Ycenter

global VarSeedLength global VarHavestTime global VarGatherWaitTime

;This does 5X5-1 or 24 beds ;dimension := 5 ;VarWaitTime1 := 11000 ;VarWaitTime2 := 5000 ;VarWaitTime3 := 5000 ;VarHavestSpeed := 333

;This does 5X5-1 or 24 beds dimension := 7 VarWaitTime1 := 230 VarWaitTime2 := 200 VarWaitTime3 := 200 VarHavestSpeed := 70


;75 for 1920X1200 res width := 75


VarMenuDistance := 40


VarXUtilityMenu := 56 VarYUtilityMenu := 22

VarXTearDownConfirmButton := 806 VarYTearDownConfirmButton := 596


VarYTeardownMenu := -10


; Wait for the window to become active, then get the window stats WinWait, eGenesis Client, IfWinNotActive, eGenesis Client, , WinActivate, eGenesis Client, WinWaitActive, eGenesis Client, WinGetActiveStats, win_Title, Xmax, Ymax, win_Xpos, win_Ypos Xcenter := Xmax//2 - 3 Ycenter := Ymax//2 + 16

VarSeedLength := 25 VarHavestTime := 1300 VarGatherWaitTime := 10000 }

GetPos() { Msgbox, Create a NEW flax bed anywhere and press ok Msgbox,,, Open the menu on it and then dont move the mouse. (And wait for 4 seconds) Sleep 4000 MouseGetPos, xpos, ypos Msgbox, Now hover the mouse over UTILITY. (And wait for 4 seconds) sleep 4000 MouseGetPos, xpos2, ypos2 xpos := xpos2 - xpos ypos := ypos2 - ypos Msgbox, Change the virable VarXUtilityMenu to %xpos% and VarYUtilityMenu to %ypos%


Msgbox, Create a NEW flax bed anywhere. Open the menu on it and choose tear down. Once the "Are you sure you want to tear down this Flax bed?" dialog is shown press OK. sleep 1000 MsgBox,,, HOVER the mouse over the "Tear Down" button., 3 sleep 2000 MouseGetPos, xpos, ypos Msgbox, Change the virable VarXTearDownConfirmButton to %xpos% and VarYTearDownConfirmButton to %ypos%

Msgbox, Create a two flax beds nicly becide each other (east-west) and press OK. sleep 1000 MsgBox,,, HOVER the mouse over the Middle of the Left Bed., 3 sleep 2000 MouseGetPos, xpos, ypos MsgBox,,, HOVER the mouse over the Middle of the Right Bed., 3 sleep 2000 MouseGetPos, xpos2, ypos2 xpos := Xpos2 - Xpos Msgbox, Change the virable Width to %xpos%

}


MovetoMiddle() { global Dimension global Width global Xcenter global Ycenter

global VarMenuDistance


global VarXUtilityMenu global VarYUtilityMenu


global VarYTeardownMenu

global VarXTearDownConfirmButton global VarYTearDownConfirmButton

X := - dimension X /= 2 X := X * width

;click the middle flax bed to bring up the menu MouseClick, right, Xcenter + X, Ycenter + X Sleep, 300

;Click the utility Menu MouseClick, right, Xcenter + X + VarXUtilityMenu, Ycenter + X + VarYUtilityMenu Sleep, 300

;Click "tear down this building" MouseClick, right, Xcenter + X + VarXUtilityMenu + VarMenuDistance, Ycenter + X + VarYUtilityMenu + VarYTeardownMenu Sleep, 300

;Click confirm MouseClick, Left, VarXTearDownConfirmButton, VarYTearDownConfirmButton Sleep, 2500

;Click where the flax bed WAS to run to that spot MouseClick, left, Xcenter + X, Ycenter + X Sleep, 2500


end of function

}


Flax4() {

Global Dimension

SetScreen()

Loop 4 {

FlaxOne()

}

}

FlaxOne() {

Must set the screen before flaxing one set

global Xcenter global Ycenter global width global dimension global VarWaitTime1 global VarWaitTime2 global VarWaitTime3

SetVars()

Plant()

MovetoMiddle()

Sleep VarWaitTime1 Weedwaterhavest()

Sleep VarWaitTime2 Weedwaterhavest()

Sleep VarWaitTime3 Weedwaterhavest()

Move(Up, Dimension /= 2) Move(Left, Dimension /= 2) Sleep, 500 }



SetScreen() { global Xcenter global Ycenter


SetVars()


Send {F5}{F8}{F8} MouseMove, 0,0 Sleep 5000 MouseMove, 0, 0 Sleep 5000

MouseMove, Xcenter, Ycenter, 0

Loop 9 { MouseClick, WheelDown Sleep 3330 }

end of function

}

Plant() { global dimension


i = 0 Loop { i += 1 Plant_Row("right", dimension) if (i >= dimension) break Move("down")

i += 1 Plant_Row("left", dimension) if (i >= dimension) break Move("down") }


end of function

}


Weedwaterhavest() { global Xcenter global Ycenter global width global dimension global VarMenuDistance global VarHavestSpeed

Y := - dimension Y /= 2 Y := Y * width

Flip := False Loop %dimension% {

X := - dimension X /= 2 X := X * width Loop %dimension% {

if NOT ((X == 0) && (Y == 0)) { ;MsgBox,,, %X% %Y%, 5

if Flip { Sleep VarHavestSpeed MouseClick, right, 300, Ycenter + Y Sleep, VarHavestSpeed MouseClick, right, Xcenter - X, Ycenter + Y Sleep, VarHavestSpeed MouseClick, right, Xcenter - X + VarMenuDistance, Ycenter + Y } else { Sleep VarHavestSpeed MouseClick, right, 300, Ycenter + Y Sleep, VarHavestSpeed MouseClick, right, Xcenter + X, Ycenter + Y Sleep, VarHavestSpeed MouseClick, right, Xcenter + X + VarMenuDistance, Ycenter + Y }

}

X := X + width } Y := Y + width Flip := Not Flip }

end of function

}

Move(direction, count = 1) { global width global Xcenter global Ycenter

distance := width * count time := 650 * count MouseMove, Xcenter, Ycenter, 0

if (direction == "right") { MouseClick,, distance, 0,, 0,, R } else if (direction == "left") { MouseClick,, -(distance), 0,, 0,, R } else if (direction == "down") { MouseClick,, 0, distance,, 0,, R } else if (direction == "up") { MouseClick,, 0, -(distance),, 0,, R } Sleep %time% }


Plant_Row(direction, num) { MouseClick,, 40, 40,, 0 if (num <= 0) { return } num -= 1 Loop %num% { Move(direction) MouseClick,, 40, 40,, 0 } return }





Seed() {

global Xcenter global Ycenter global width global VarSeedLength global VarMenuDistance global VarGatherWaitTime


SetVars()

Plant_Row("right", VarSeedLength) Move("down")

Plant_Row("left", VarSeedLength)

Move("left", 2) Move("up")

Sleep %VarGatherWaitTime% GatherSeeds()

}

GatherSeeds() { Global VarSeedLength Global VarMenuDistance Global VarHavestTime Global Xcenter Global YCenter Global Width

SetVars()

loop {

loop %VarSeedLength% { MouseClick, right, Xcenter + (2 * Width), Ycenter Sleep 200 MouseClick, right, Xcenter + (2 * Width) + VarMenuDistance, Ycenter Sleep 1300 }

Move("right", 3) Move("down")

loop %VarSeedLength% { MouseClick, right, Xcenter - (2 * Width), Ycenter Sleep 200 MouseClick, right, Xcenter - (2 * Width) + VarMenuDistance, Ycenter Sleep %VarHavestTime% }

Move("left", 3) Move("up") }

end of function

}


GuiClose: Gui, Destroy return