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:Akiiki Bastet"
From A Tale in the Desert
Jump to navigationJump to search| Line 71: | Line 71: | ||
== My Thistle Garden Recording Macro == | == My Thistle Garden Recording Macro == | ||
To use: | To use: | ||
| − | * Uses AHK - Windows Auto Hot Keys | + | * Uses AHK - Windows Auto Hot Keys |
| − | * You will need the image files to make this go. The zip should contain ONLY bmp images. Be suspicious of exe's, etc! | + | * You will need the [[http://www.atitd.org/wiki/tale4/Image:ThistleImages.zip image]] files to make this go. The zip should contain ONLY bmp images. Be suspicious of exe's, etc! |
* Ensure you have adequate water, dung, seeds, etc for your macro before you run. | * Ensure you have adequate water, dung, seeds, etc for your macro before you run. | ||
* Edit the Tick# lines to program the operations. N adds Nit, P pot, H water, O aerates and S toggles sun. Use letters multiple times per row if you wish. | * Edit the Tick# lines to program the operations. N adds Nit, P pot, H water, O aerates and S toggles sun. Use letters multiple times per row if you wish. | ||
Latest revision as of 06:57, 14 September 2010
My Gravel Macro
To use:
- Uses AHK - Windows Auto Hot Keys
- Move to an open area. Drop your stones. Bring a sledgehammer. I prefer F8F8 view, zoomed moderately in - you can play with this if you get 'too far' messages. Don't wear white!
- CLOSE CHAT! It uses hotkeys, sorry
- Ctrl+F1 to get the splash screen.
- F2 to start
- F3 to pause - you'll want to exit the macro before using maps!
- It will try to use 'S' to Smash stones or Scoop gravel.
- Failing that, it will use Right Click to pick up piles of multiple gravel (which do not scoop)
F3::Pause Toggle
^F1::Setup()
F2::Harvest()
Setup() {
MsgBox, Graveller F2 to launch F3 to Pause
}
Harvest() {
WinWait, eGenesis Client,
IfWinNotActive, eGenesis Client, , WinActivate, eGenesis Client,
WinWaitActive, eGenesis Client,
WinGetActiveStats, win_Title, win_Width, win_Height, win_Xpos, win_Ypos
ScreenWidth := win_Width
ScreenHeight := win_Height
PapyColour := 0xFFFFFF
Loop {
PixelSearch, x, y, ScreenWidth/10*4, ScreenHeight/10*4, ScreenWidth/10*6, ScreenHeight/10*6, %PapyColour%, 6, Fast RGB
if (ErrorLevel == 0) {
MouseMove, x, y
Send s
Sleep, 2000
Click Right
} else {
PixelSearch, x, y, ScreenWidth/10*3, ScreenHeight/10*3, ScreenWidth/10*7, ScreenHeight/10*7, %PapyColour%, 6, Fast RGB
if (ErrorLevel == 0) {
MouseMove, x, y
Send s
Sleep, 2000
Click Right
} else {
PixelSearch, x, y, ScreenWidth/10*2, ScreenHeight/10*2, ScreenWidth/10*8, ScreenHeight/10*8, %PapyColour%, 6, Fast RGB
if (ErrorLevel == 0) {
MouseMove, x, y
Send s
Sleep, 2000
Click Right
} else {
PixelSearch, x, y, ScreenWidth/10, ScreenHeight/10, ScreenWidth/10*9, ScreenHeight/10*9, %PapyColour%, 6, Fast RGB
if (ErrorLevel == 0) {
MouseMove, x, y
Send s
Sleep, 2000
Click Right
}
}
}
}
Sleep, 2000
}
}
My Thistle Garden Recording Macro
To use:
- Uses AHK - Windows Auto Hot Keys
- You will need the [image] files to make this go. The zip should contain ONLY bmp images. Be suspicious of exe's, etc!
- Ensure you have adequate water, dung, seeds, etc for your macro before you run.
- Edit the Tick# lines to program the operations. N adds Nit, P pot, H water, O aerates and S toggles sun. Use letters multiple times per row if you wish.
- Ctrl+F1 to get the splash screen.
- F1 while mouse is within the area of your garden window to locate it
- F2 to start. It will run the programmed set of moves.
- F3 to pause - you'll want to exit the macro before using maps!
- It uses the mouse, but no keys, so feel free to chat.
- Outputs observed nutrients from ticks 0 to 39 into ThistleResults.txt
; Thistle Macro
; Outputs ThistleGardenResults.txt into the same dir with the numbers it observes.
; Globals
; ======================================
;
; Tending instructions
;
; Each tick, the string should have one N, P, H, O or S for each time you want the button clicked.
; You might also need to set the sun properly the first time, since that's a toggle.
; ======================================
Tick0 := "HHOO"
Tick1 := ""
Tick2 := ""
Tick3 := ""
Tick4 := ""
Tick5 := ""
Tick6 := ""
Tick7 := ""
Tick8 := ""
Tick9 := ""
Tick10 := ""
Tick11 := ""
Tick12 := ""
Tick13 := ""
Tick14 := ""
Tick15 := "N"
Tick16 := "HHHHHOOOOO"
Tick17 := "O"
Tick18 := ""
Tick19 := ""
Tick20 := ""
Tick21 := ""
Tick22 := ""
Tick23 := ""
Tick24 := ""
Tick25 := ""
Tick26 := ""
Tick27 := ""
Tick28 := ""
Tick29 := ""
Tick30 := ""
Tick31 := ""
Tick32 := ""
Tick33 := ""
Tick34 := ""
Tick35 := ""
Tick36 := ""
Tick37 := ""
Tick38 := ""
Tick39 := ""
; ======================================
TickTime := 10 * 1000 * 1.1
OCount := 0
Ox1 := 0
Oy1 := 0
Ox2 := 0
Oy2 := 0
Ox3 := 0
Oy3 := 0
Ox4 := 0
Oy4 := 0
Ox5 := 0
Oy5 := 0
Ox6 := 0
Oy6 := 0
Ox7 := 0
Oy7 := 0
Ox8 := 0
Oy8 := 0
Oy9 := 0
; Constants
bordercolor := 0x2E5072
; F3 to pause
F3::Pause
; Ctrl+F1 to re-initialize
^F1::Init()
; F1 to mark a garden dialog
F1::MarkGarden()
; F2 to begin
F2::StartGardens()
^F2::TestImage()
Init() {
MsgBox, Welcome to Auto-Thistle.`n F1 to mark a garden dialog.`n F2 to Start.`n F3 to Pause, Auto-Thistle
OCount := 0
Progress, SHOW, Completed setup, Mark gardens with F1 and press F2 to Start, AutoThistle
Progress, x100 y100, Completed Setup, Mark gardens with F1 and press F2 to Start, Glass!
}
MarkGarden() {
global Tick0, Tick1, Tick2, Tick3, Tick4, Tick5, Tick6, Tick7, Tick8, Tick9, Tick10, Tick11, Tick12, Tick13, Tick14, Tick15, Tick16, Tick17, Tick18, Tick19, Tick20, Tick21, Tick22, Tick23, Tick24, Tick25, Tick26, Tick27, Tick28, Tick29, Tick30, Tick31, Tick32, Tick33, Tick34, Tick35, Tick36, Tick37, Tick38, Tick39
global OCount, Ox1, Oy1, Ox2, Oy2, Ox3, Oy3, Ox4, Oy4, Ox5, Oy5, Ox6, Oy6, Ox7, Oy7, Ox8, Oy9
global bordercolor, TickTime
MouseGetPos, mouseX, mouseY
PixelSearch, , zeroY, mouseX, mouseY, mouseX, mouseY+300, %Bordercolor%
PixelSearch, zeroX , , mouseX, mouseY, mouseX + 400, mouseY, %Bordercolor%
if ErrorLevel {
MsgBox, Garden Dialog Point not found, please try again
} else {
MouseMove, zeroX, zeroY
;MsgBox, Found corner here, Auto-CC
OCount := OCount + 1
Ox%OCount% := zeroX
Oy%OCount% := zeroY
}
}
TestImage() {
WinWait, eGenesis Client,
IfWinNotActive, eGenesis Client, , WinActivate, eGenesis Client,
WinWaitActive, eGenesis Client,
WinGetActiveStats, win_Title, win_Width, win_Height, win_Xpos, win_Ypos
digit := 0
ImageSearch, PCx, PCy, 0, 0, win_Width, win_Height, *60 ThistleLite%digit%.bmp
if (ErrorLevel == 0) {
MouseMove, PCx, PCy
} else {
MsgBox, Error was %ErrorLevel% for file ThistleLite%digit%.bmp
SoundPlay, *48
}
}
StartGardens() {
global Tick0, Tick1, Tick2, Tick3, Tick4, Tick5, Tick6, Tick7, Tick8, Tick9, Tick10, Tick11, Tick12, Tick13, Tick14, Tick15, Tick16, Tick17, Tick18, Tick19, Tick20, Tick21, Tick22, Tick23, Tick24, Tick25, Tick26, Tick27, Tick28, Tick29, Tick30, Tick31, Tick32, Tick33, Tick34, Tick35, Tick36, Tick37, Tick38, Tick39
global OCount, Ox1, Oy1, Ox2, Oy2, Ox3, Oy3, Ox4, Oy4, Ox5, Oy5, Ox6, Oy6, Ox7, Oy7, Ox8, Oy9
global bordercolor, TickTime
ThisGarden := 0
; Action timers
Timer1 := -10000
Timer2 := -10000
Timer3 := -10000
Timer4 := -10000
Timer5 := -10000
Timer6 := -10000
Timer7 := -10000
Timer8 := -10000
Timer9 := -10000
;Tick counts
Garden1 := 0
Garden2 := 0
Garden3 := 0
Garden4 := 0
Garden5 := 0
Garden6 := 0
Garden7 := 0
Garden8 := 0
Garden9 := 0
GardenDone1 := 0
GardenDone2 := 0
GardenDone3 := 0
GardenDone4 := 0
GardenDone5 := 0
GardenDone6 := 0
GardenDone7 := 0
GardenDone8 := 0
GardenDone9 := 0
; Fire up the gardens. Image search for 'plant' button
if(OCount == 1) {
FileAppend, === Garden Run ===`n, ThistleGardenResults.txt
}
Loop %OCount% {
ThisGarden := A_Index
zeroX := Ox%ThisGarden%
zeroY := Oy%ThisGarden%
Ux := zeroX - 420
Uy := zeroY - 330
;MouseMove, Ux, Uy
;Sleep, 1000
;MouseMove, zeroX, zeroY
;ImageSearch, PCx, PCy, Ux, Uy, zeroX, zeroY, *60 ThistlesPlantCrop.bmp
ImageSearch, PCx, PCy, Ux, Uy, zeroX, zeroY, *60 ThistlesPlantCrop.bmp
if (ErrorLevel >= 1) {
MsgBox, Unable to find start button.
return
}
startx := PCx
starty := PCy
MouseMove, startx, starty
Click Right
}
ThisGarden := 0
Sleep, 1000
Loop {
ThisGarden := ThisGarden + 1
if(ThisGarden > OCount) {
ThisGarden := 1
}
if(GardenDone%ThisGarden% == 0) {
zeroX := Ox%ThisGarden%
zeroY := Oy%ThisGarden%
; Find the 'nit' button and work from there.
Ux := zeroX - 420
Uy := zeroY - 330
ImageSearch, PCx, PCy, Ux, Uy, zeroX, zeroY, *60 ThistlesNit.bmp
ButtonY := PCy + 5
NitX := PCx + 5
PotX := PCx + 35
H2OX := PCx + 65
OxyX := PCx + 95
SunX := PCx + 125
NumbersX := NitX-30
NumbersX2 := NitX+5
NumbersY := ButtonY
NumbersY2 := zeroY
AscX := PCx + 183
BioX := PCx + 210
CarX := PCx + 240
FolX := PCx + 268
NiaX := PCx + 297
PyrX := PCx + 325
ThiX := PCx + 354
Now := A_TickCount
Current := Garden%ThisGarden%
ImageSearch, PCx, PCy, NumbersX, NumbersY, NumbersX2, NumbersY2, *60 Thistle%Current%.bmp
if(ErrorLevel == 0) {
TickText := Tick%Current%
Loop {
if(StrLen(TickText) <= 0) {
break
}
char := SubStr(TickText, 1, 1)
TickText := SubStr(TickText, 2)
if(char == "N") {
Click Right %NitX%, %ButtonY%
}
if(char == "P") {
Click Right %PotX%, %ButtonY%
}
if(char == "H") {
Click Right %H2OX%, %ButtonY%
}
if(char == "O") {
Click Right %OxyX%, %ButtonY%
}
if(char == "S") {
Click Right %SunX%, %ButtonY%
}
}
if(OCount == 1) {
Y1 := PCy -1
Y2 := Y1 + 10
; Asc tens digit
Asc := ""
Loop 9 {
digit := A_Index
ImageSearch, dx, dy, AscX, Y1, AscX+8, Y2, *60 ThistleLite%digit%.bmp
if(ErrorLevel == 0) {
Asc .= digit
break
}
}
;Asc ones digit
Loop 10 {
digit := A_Index - 1
ImageSearch, dx, dy, AscX+6, Y1, AscX+12, Y2, *60 ThistleLite%digit%.bmp
if(ErrorLevel == 0) {
Asc .= digit
break
}
}
; Bio tens digit
Bio := ""
Loop 9 {
digit := A_Index
ImageSearch, dx, dy, BioX, Y1, BioX+8, Y2, *60 ThistleLite%digit%.bmp
if(ErrorLevel == 0) {
Bio .= digit
break
}
}
;Bio ones digit
Loop 10 {
digit := A_Index - 1
ImageSearch, dx, dy, BioX+6, Y1, BioX+12, Y2, *60 ThistleLite%digit%.bmp
if(ErrorLevel == 0) {
Bio .= digit
break
}
}
; Car tens digit
Car := ""
Loop 9 {
digit := A_Index
ImageSearch, dx, dy, CarX, Y1, CarX+8, Y2, *60 ThistleLite%digit%.bmp
if(ErrorLevel == 0) {
Car .= digit
break
}
}
;Car ones digit
Loop 10 {
digit := A_Index - 1
ImageSearch, dx, dy, CarX+6, Y1, CarX+12, Y2, *60 ThistleLite%digit%.bmp
if(ErrorLevel == 0) {
Car .= digit
break
}
}
; Fol tens digit
Fol := ""
Loop 9 {
digit := A_Index
ImageSearch, dx, dy, FolX, Y1, FolX+8, Y2, *60 ThistleLite%digit%.bmp
if(ErrorLevel == 0) {
Fol .= digit
break
}
}
;Fol ones digit
Loop 10 {
digit := A_Index - 1
ImageSearch, dx, dy, FolX+6, Y1, FolX+12, Y2, *60 ThistleLite%digit%.bmp
if(ErrorLevel == 0) {
Fol .= digit
break
}
}
; Nia tens digit
Nia := ""
Loop 9 {
digit := A_Index
ImageSearch, dx, dy, NiaX, Y1, NiaX+8, Y2, *60 ThistleLite%digit%.bmp
if(ErrorLevel == 0) {
Nia .= digit
break
}
}
;Nia ones digit
Loop 10 {
digit := A_Index - 1
ImageSearch, dx, dy, NiaX+6, Y1, NiaX+12, Y2, *60 ThistleLite%digit%.bmp
if(ErrorLevel == 0) {
Nia .= digit
break
}
}
; Pyr tens digit
Pyr := ""
Loop 9 {
digit := A_Index
ImageSearch, dx, dy, PyrX, Y1, PyrX+8, Y2, *60 ThistleLite%digit%.bmp
if(ErrorLevel == 0) {
Pyr .= digit
break
}
}
;Pyr ones digit
Loop 10 {
digit := A_Index - 1
ImageSearch, dx, dy, PyrX+6, Y1, PyrX+12, Y2, *60 ThistleLite%digit%.bmp
if(ErrorLevel == 0) {
Pyr .= digit
break
}
}
; Thi tens digit
Thi := ""
Loop 9 {
digit := A_Index
ImageSearch, dx, dy, ThiX, Y1, ThiX+8, Y2, *60 ThistleLite%digit%.bmp
if(ErrorLevel == 0) {
Thi .= digit
break
}
}
;Thi ones digit
Loop 10 {
digit := A_Index - 1
ImageSearch, dx, dy, ThiX+6, Y1, ThiX+12, Y2, *60 ThistleLite%digit%.bmp
if(ErrorLevel == 0) {
Thi .= digit
break
}
}
FileAppend, %Asc%`, %Bio%`, %Car%`, %Fol%`, %Nia%`, %Pyr%`, %thi%`,`n, ThistleGardenResults.txt
}
Garden%ThisGarden%++
if(Garden%ThisGarden% >= 40) {
GardenDone%ThisGarden% := 1
}
}
}
OneLeft := 0
Loop %OCount% {
if(GardenDone%A_Index% == 0) {
OneLeft := 1
break
}
}
if(!OneLeft) {
break
}
Progress, 100, First Garden at %Garden1%, Woot, Thistles!
Sleep,400
}
SoundPlay *-1
}