The Wiki for Tale 5 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 "Takhetu/Macros"

From ATITD5
Jump to navigationJump to search
 
(15 intermediate revisions by the same user not shown)
Line 1: Line 1:
First test.
+
== Charcoal ==
 +
Tested with 1 to 15, should do fine with 20+
  
<pre>
+
- Open and pin the cc oven windows on screen.
;Ctrl+R to reload
 
;Ctrl+P to pause
 
  
IfWinExist eGenesis Client
+
- Start the macro
{
 
WinGet, GameWinHandle, ID, eGenesis Client
 
} else {
 
Msgbox, eGenesis client not running, exiting...
 
Exit
 
}
 
  
WinActivate, eGenesis Client
+
- CTRL+R will reload the macro (use if you change the window positions or number of windows)
WinGetActiveStats, win_Title, Xmax, Ymax, win_Xpos, win_Ypos
 
StartXGUI := Xmax+win_Xpos-255
 
StartYGUI := win_Ypos+35
 
Gui, +AlwaysOnTop +ToolWindow -Border +Background
 
Gui, Add, Text,,Type in how many rows and columns `nof kettles you will be working with:
 
Gui, Add, Text, x10 y40, Rows:
 
Gui, Add, Edit,xp+35 yp-4 vnumRows, 4
 
Gui, Add, Text,xp+20 y40, Columns:
 
Gui, Add, Edit,xp+45 yp-4 vnumColumns, 4
 
Gui, Add, Button, x10 y70 gNext, Next »
 
Gui, Add, Button, x200 y5 gClose, Close
 
; Generated using SmartGUI Creator 4.0
 
Gui, Show, X%StartXGUI% Y%StartYGUI% w240 h100, New GUI Window
 
Return
 
  
Next:
+
- CTRL+S will start all visible ovens
Gui, submit
 
Gui, Destroy
 
;Get Top Left
 
Gui, +AlwaysOnTop +ToolWindow -Border +Background
 
Gui, Add, Text,,Using F8F8 camera view make `nsure you can see all kettles.
 
Gui, Add, Text,,Position your mouse over `nthe topleft kettle and press the F2 key.
 
Gui, Add, Button, x200 y5 gClose, Close
 
Gui, Show, X%StartXGUI% Y%StartYGUI% w240 h100, New GUI Window
 
  
loop
+
- CTRL+P will pause/resume the macro (use if you need to move the mouse)
{
 
WinActivate eGenesis Client
 
KeyWait, F2, D
 
KeyWait, F2
 
MouseGetPos, FirstX, FirstY, WinHandle
 
if (WinHandle = GameWinHandle)
 
{
 
Gosub, GotTopLeft
 
}
 
}
 
return
 
  
GotTopLeft:
+
[http://www.atitd.org/wiki/tale5/images/b/b0/TakCharcoal.zip CC Ovens]
Gui, Destroy
 
;Get Bottom Right
 
Gui, +AlwaysOnTop +ToolWindow -Border +Background
 
Gui, Add, Text,,Position your mouse over `nthe bottom right kettle `nand press the F2 key.
 
Gui, Add, Button, x200 y5 gClose, Close
 
Gui, Show, X%StartXGUI% Y%StartYGUI% w240 h100, New GUI Window
 
  
loop
+
== Kettles ==
{
+
-F8F8 view
WinActivate eGenesis Client
 
KeyWait, F2, D
 
KeyWait, F2
 
MouseGetPos, LastX, LastY, WinHandle
 
if (WinHandle = GameWinHandle)
 
{
 
Gosub, GotBottomRight
 
}
 
}
 
return
 
  
GotBottomRight:
+
-Zoom in such a way that you can see all kettles, make sure the top and bottom rows are not too close to top/bottom of screen.
Gui, Destroy
 
;Open Windows
 
Gui, +AlwaysOnTop +ToolWindow -Border +Background
 
Gui, Add, Text,vTimeLeft,Leave your mouse alone, `nopening windows in 5 seconds.
 
Gui, Add, Button, x200 y5 gClose, Close
 
Gui, Show, X%StartXGUI% Y%StartYGUI% w240 h100, New GUI Window
 
  
SmallPause := 5
+
-If the macro fails to arrange the windows restart with CTRL+R
Loop, %SmallPause%
 
{
 
GuiControl, Text, TimeLeft, Leave your mouse alone, `nopening windows in %SmallPause% seconds.
 
SmallPause --
 
Sleep 1000
 
}
 
  
GuiControl, Text, TimeLeft, Opening Windows Now.
+
-Macro won't take over kettles that are already burning wood or have mats in them.
WinActivate eGenesis Client
 
  
topNotFound := true
+
[http://www.atitd.org/wiki/tale5/images/f/f2/TakKettles.zip Kettles]
Loop, %numColumns%
 
{
 
curColumn := A_Index
 
openPosX := FirstX+(A_Index-1)*floor((LastX-FirstX)/(numColumns-1))
 
Loop, %numRows%
 
{
 
openPosY := FirstY+(A_Index-1)*floor((LastY-FirstY)/(numRows-1))
 
MouseClick,Right,openPosX,openPosY
 
sleep, 200
 
startSeaX := openPosX+5
 
finishSeaY := openPosY-200
 
If topNotFound
 
{
 
Loop, 20
 
{
 
curStartB := openPosY-(10*A_Index)
 
curStartT := openPosY-(10*A_Index)-10
 
PixelSearch,OutX,OutY,%startSeaX%,%curStartT%,%startSeaX%,%curStartB%,0x000000,Fast
 
if ErrorLevel < 1
 
{
 
break
 
}
 
}
 
PixelSearch,OutX,OutY,%startSeaX%,%curStartB%,%startSeaX%,%curStartT%,0x000000
 
curStartB := openPosY-OutY+3
 
curStartT := openPosY-OutY-3
 
topNotFound := false
 
}
 
startSeaYB := openPosY-curStartB
 
startSeaYT := openPosY-curStartT
 
PixelSearch,OutX,OutY,%startSeaX%,%startSeaYT%,%startSeaX%,%startSeaYB%,0x000000,50
 
arrX := 18+20*(numColumns)*(curColumn-1)+20*(A_Index-1)
 
MouseClick,Left,%OutX%,%OutY%,,,D
 
sleep 100
 
MouseMove,%arrX%,50
 
sleep 300
 
MouseClick,Left,,,,,U
 
sleep, 100
 
}
 
}
 
 
 
Close:
 
ExitApp
 
 
 
^r::reload
 
^p::Pause
 
</pre>
 

Latest revision as of 09:22, 18 November 2010

Charcoal

Tested with 1 to 15, should do fine with 20+

- Open and pin the cc oven windows on screen.

- Start the macro

- CTRL+R will reload the macro (use if you change the window positions or number of windows)

- CTRL+S will start all visible ovens

- CTRL+P will pause/resume the macro (use if you need to move the mouse)

CC Ovens

Kettles

-F8F8 view

-Zoom in such a way that you can see all kettles, make sure the top and bottom rows are not too close to top/bottom of screen.

-If the macro fails to arrange the windows restart with CTRL+R

-Macro won't take over kettles that are already burning wood or have mats in them.

Kettles