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.

User:Peptide

From A Tale in the Desert
Jump to navigationJump to search

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