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:Cegaiel/Macros/Potash/Code"

From A Tale in the Desert
Jump to navigationJump to search
Line 1: Line 1:
 
<pre>
 
<pre>
;Make Potash with 6 kettles (MAY work with other stoked kettle projects)
+
;Make Potash with 6 kettles (MAY work with other stoked kettle projects, just change coordinates of Click Potash button)
 
;Requires:
 
;Requires:
 
;168 Wood
 
;168 Wood
Line 11: Line 11:
 
;Ctrl+R to reload
 
;Ctrl+R to reload
 
;Ctrl+P to pause
 
;Ctrl+P to pause
 +
;Emergency: Hold F2 button down 2 seconds to Abort current countdown and hit Stoke Max immediately
 +
;The current countdown will abort, but subsequent countdowns will continue normally.
 +
 +
;Trust the script, only use Emergency F2 when you have more than 32s when the Wood count turns to zero
 +
;As long as there is less than 32s, when the wood hits zero, then dont interupt the script
  
 
^r::reload
 
^r::reload
Line 16: Line 21:
 
^!w::
 
^!w::
  
IfWinExist eGenesis Client
+
IfWinExist eGenesis Client
{
+
{
 
WinGet, GameWinHandle, ID, eGenesis Client
 
WinGet, GameWinHandle, ID, eGenesis Client
}
+
} else {
 +
Msgbox, eGenesis client not running, exiting...
 +
Exit
 +
}
 +
 
 +
 
 +
Gui, +AlwaysOnTop +ToolWindow
 +
Gui, Add, Text,, Type of Kettles?
 +
Gui, Add, DropDownList, vKettle Choose2, Private|Public
 +
Gui, Add, Button, Default gStart, GO
 +
Gui, Show
 +
return
 +
 
  
seconds = 5
+
Start:
 +
seconds = 2
  
 +
Gui, Submit
 +
Gui, Destroy
 +
Msgbox, Ingredients needed to run 6 kettles:`n`n168 Wood`n150 Water`n30 Ash`n`nMake sure you have that in your inventory!`n`nKettle Type: %Kettle%`n`nClick OK to continue...
 
Gui, +AlwaysOnTop +ToolWindow
 
Gui, +AlwaysOnTop +ToolWindow
 
Gui, Font, bold
 
Gui, Font, bold
Line 29: Line 50:
 
Gui, Show
 
Gui, Show
 
GuiControl, Text, MineCycleText, %seconds% seconds before the script will begin ...
 
GuiControl, Text, MineCycleText, %seconds% seconds before the script will begin ...
 +
 +
  
  
Line 44: Line 67:
 
GuiControl, Text, MineCycleText, Focusing to eGenesis client ...
 
GuiControl, Text, MineCycleText, Focusing to eGenesis client ...
  
WinActivate
+
WinActivate, eGenesis Client
 +
 
 +
;Click Potash Button
 +
 
 +
PotashY = 165
 +
if (Kettle == "Public")
 +
{
 +
PotashY := PotashY + 15
 +
}
  
  
;Click Potash Button
 
 
GuiControl, Text, MineCycleText, Clicking Potash, Pot 1
 
GuiControl, Text, MineCycleText, Clicking Potash, Pot 1
Click, 45, 165 ;Pot 1
+
Click, 45, %PotashY% ;Pot 1
 
sleep 200
 
sleep 200
 
GuiControl, Text, MineCycleText, Click Potash, Pot 2
 
GuiControl, Text, MineCycleText, Click Potash, Pot 2
Click, 220, 165 ;Pot 2
+
Click, 220, %PotashY% ;Pot 2
 
sleep 200
 
sleep 200
 
GuiControl, Text, MineCycleText, Click Potash, Pot 3
 
GuiControl, Text, MineCycleText, Click Potash, Pot 3
Click, 385, 165 ;Pot 3
+
Click, 385, %PotashY% ;Pot 3
 
sleep 200
 
sleep 200
 
GuiControl, Text, MineCycleText, Click Potash, Pot 4
 
GuiControl, Text, MineCycleText, Click Potash, Pot 4
Click, 555, 165 ;Pot 4
+
Click, 555, %PotashY% ;Pot 4
 
sleep 200
 
sleep 200
 
GuiControl, Text, MineCycleText, Click Potash, Pot 5
 
GuiControl, Text, MineCycleText, Click Potash, Pot 5
Click, 725, 165 ;Pot 5
+
Click, 725, %PotashY% ;Pot 5
 
sleep 200
 
sleep 200
 
GuiControl, Text, MineCycleText, Click Potash, Pot 6
 
GuiControl, Text, MineCycleText, Click Potash, Pot 6
Click, 890, 165 ;Pot 6
+
Click, 890, %PotashY% ;Pot 6
 
sleep 200
 
sleep 200
  
  
 
;Click Begin button
 
;Click Begin button
 +
 +
BeginIgniteY = 240
 +
if (Kettle == "Public")
 +
{
 +
BeginIgniteY := BeginIgniteY + 15
 +
}
 +
 +
 
GuiControl, Text, MineCycleText, Click Begin, Pot 1
 
GuiControl, Text, MineCycleText, Click Begin, Pot 1
Click, 45, 240 ;Pot 1
+
Click, 45, %BeginIgniteY% ;Pot 1
 
sleep 200
 
sleep 200
 
GuiControl, Text, MineCycleText, Click Begin, Pot 2
 
GuiControl, Text, MineCycleText, Click Begin, Pot 2
Click, 220, 240 ;Pot 2
+
Click, 220, %BeginIgniteY% ;Pot 2
 
sleep 200
 
sleep 200
 
GuiControl, Text, MineCycleText, Click Begin, Pot 3
 
GuiControl, Text, MineCycleText, Click Begin, Pot 3
Click, 385, 240 ;Pot 3
+
Click, 385, %BeginIgniteY% ;Pot 3
 
sleep 200
 
sleep 200
 
GuiControl, Text, MineCycleText, Click Begin, Pot 4
 
GuiControl, Text, MineCycleText, Click Begin, Pot 4
Click, 555, 240 ;Pot 4
+
Click, 555, %BeginIgniteY% ;Pot 4
 
sleep 200
 
sleep 200
 
GuiControl, Text, MineCycleText, Click Begin, Pot 5
 
GuiControl, Text, MineCycleText, Click Begin, Pot 5
Click, 725, 240 ;Pot 5
+
Click, 725, %BeginIgniteY% ;Pot 5
 
sleep 200
 
sleep 200
 
GuiControl, Text, MineCycleText, Click Begin, Pot 6
 
GuiControl, Text, MineCycleText, Click Begin, Pot 6
Click, 890, 240 ;Pot 6
+
Click, 890, %BeginIgniteY% ;Pot 6
 
sleep 200
 
sleep 200
  
Line 96: Line 134:
 
;Pot 1
 
;Pot 1
 
GuiControl, Text, MineCycleText, Igniting/Refreshing Pot 1
 
GuiControl, Text, MineCycleText, Igniting/Refreshing Pot 1
Click, 45, 240 ;Ignite
+
Click, 45, %BeginIgniteY% ;Ignite
 
sleep 200
 
sleep 200
 
Click, 515, 420 ;Max button
 
Click, 515, 420 ;Max button
Line 105: Line 143:
 
;Pot 2
 
;Pot 2
 
GuiControl, Text, MineCycleText, Igniting/Refreshing Pot 2
 
GuiControl, Text, MineCycleText, Igniting/Refreshing Pot 2
Click, 215, 240 ;Ignite
+
Click, 215, %BeginIgniteY% ;Ignite
 
sleep 200
 
sleep 200
 
Click, 515, 420 ;Max button
 
Click, 515, 420 ;Max button
Line 114: Line 152:
 
;Pot 3
 
;Pot 3
 
GuiControl, Text, MineCycleText, Igniting/Refreshing Pot 3
 
GuiControl, Text, MineCycleText, Igniting/Refreshing Pot 3
Click, 385, 240 ;Ignite
+
Click, 385, %BeginIgniteY% ;Ignite
 
sleep 200
 
sleep 200
 
Click, 515, 420 ;Max button
 
Click, 515, 420 ;Max button
Line 123: Line 161:
 
;Pot 4
 
;Pot 4
 
GuiControl, Text, MineCycleText, Igniting/Refreshing Pot 4
 
GuiControl, Text, MineCycleText, Igniting/Refreshing Pot 4
Click, 560, 240 ;Ignite
+
Click, 560, %BeginIgniteY% ;Ignite
 
sleep 200
 
sleep 200
 
Click, 515, 420 ;Max button
 
Click, 515, 420 ;Max button
Line 132: Line 170:
 
;Pot 5
 
;Pot 5
 
GuiControl, Text, MineCycleText, Igniting/Refreshing Pot 5
 
GuiControl, Text, MineCycleText, Igniting/Refreshing Pot 5
Click, 725, 240 ;Ignite
+
Click, 725, %BeginIgniteY% ;Ignite
 
sleep 200
 
sleep 200
 
Click, 515, 420 ;Max button
 
Click, 515, 420 ;Max button
Line 141: Line 179:
 
;Pot 6
 
;Pot 6
 
GuiControl, Text, MineCycleText, Igniting/Refreshing Pot 6
 
GuiControl, Text, MineCycleText, Igniting/Refreshing Pot 6
Click, 895, 240 ;Ignite
+
Click, 895, %BeginIgniteY% ;Ignite
 
sleep 200
 
sleep 200
 
Click, 515, 420 ;Max button
 
Click, 515, 420 ;Max button
Line 159: Line 197:
 
seconds --
 
seconds --
 
Sleep 1000
 
Sleep 1000
 +
 +
GetKeyState, state, F2
 +
if state = D
 +
{
 +
break
 +
}
 
}
 
}
  
Line 174: Line 218:
 
seconds --
 
seconds --
 
Sleep 1000
 
Sleep 1000
 +
 +
GetKeyState, state, F2
 +
if state = D
 +
{
 +
break
 +
}
 +
 
}
 
}
  
Line 188: Line 239:
 
seconds --
 
seconds --
 
Sleep 1000
 
Sleep 1000
 +
 +
GetKeyState, state, F2
 +
if state = D
 +
{
 +
break
 +
}
 +
 
}
 
}
  
Line 202: Line 260:
 
seconds --
 
seconds --
 
Sleep 1000
 
Sleep 1000
 +
 +
GetKeyState, state, F2
 +
if state = D
 +
{
 +
break
 +
}
 
}
 
}
  
Line 209: Line 273:
 
;Stoke 5 (6 water) countdown
 
;Stoke 5 (6 water) countdown
  
seconds = 100
+
seconds = 96
 
Loop, %seconds%
 
Loop, %seconds%
 
{
 
{
Line 215: Line 279:
 
seconds --
 
seconds --
 
Sleep 1000
 
Sleep 1000
 +
GetKeyState, state, F2
 +
if state = D
 +
{
 +
break
 +
}
 
}
 
}
  
Line 221: Line 290:
  
 
;Countdown until complete
 
;Countdown until complete
seconds = 180
+
seconds = 175
 
Loop, %seconds%
 
Loop, %seconds%
 
{
 
{
GuiControl, Text, MineCycleText, %seconds% seconds until complete
+
GuiControl, Text, MineCycleText, %seconds% seconds until complete...
 
seconds --
 
seconds --
 
Sleep 1000
 
Sleep 1000
Line 230: Line 299:
  
 
Gui, Destroy
 
Gui, Destroy
Gui, Add, Text,, Middle-click on this window to end the script.
+
Gui, Add, Text,, Done!.
 
Gui, Show
 
Gui, Show
 
return
 
return
Line 238: Line 307:
  
 
StokeMax:
 
StokeMax:
WinActivate
+
 
 +
WinActivate, eGenesis Client
 +
 
 +
StokeMaxY = 75
 +
if (Kettle == "Public")
 +
{
 +
StokeMaxY := StokeMaxY + 15
 +
}
  
 
;Click Stoke Max
 
;Click Stoke Max
 
MouseGetPos, OldMX, OldMY
 
MouseGetPos, OldMX, OldMY
 
GuiControl, Text, MineCycleText, Stoking, Pot 1
 
GuiControl, Text, MineCycleText, Stoking, Pot 1
Click, 50, 75 ; Pot 1
+
Click, 50, %StokeMaxY% ; Pot 1
 
sleep 200
 
sleep 200
 
GuiControl, Text, MineCycleText, Stoking, Pot 2
 
GuiControl, Text, MineCycleText, Stoking, Pot 2
Click, 250, 75 ; Pot 2
+
Click, 250, %StokeMaxY% ; Pot 2
 
sleep 200
 
sleep 200
 
GuiControl, Text, MineCycleText, Stoking, Pot 3
 
GuiControl, Text, MineCycleText, Stoking, Pot 3
Click, 420, 75 ; Pot 3
+
Click, 420, %StokeMaxY% ; Pot 3
 
sleep 200
 
sleep 200
 
GuiControl, Text, MineCycleText, Stoking, Pot 4
 
GuiControl, Text, MineCycleText, Stoking, Pot 4
Click, 590, 75 ; Pot 4
+
Click, 590, %StokeMaxY% ; Pot 4
 
sleep 200
 
sleep 200
 
GuiControl, Text, MineCycleText, Stoking, Pot 5
 
GuiControl, Text, MineCycleText, Stoking, Pot 5
Click, 750, 75 ; Pot 5
+
Click, 750, %StokeMaxY% ; Pot 5
 
sleep 200
 
sleep 200
 
GuiControl, Text, MineCycleText, Stoking, Pot 6
 
GuiControl, Text, MineCycleText, Stoking, Pot 6
Click, 910, 75 ; Pot 6
+
Click, 910, %StokeMaxY% ; Pot 6
 
sleep 200
 
sleep 200
 
MouseMove, %OldMX%, %OldMY%, 0
 
MouseMove, %OldMX%, %OldMY%, 0
 
+
return
return</pre>
+
</pre>

Revision as of 05:27, 29 January 2010

;Make Potash with 6 kettles (MAY work with other stoked kettle projects, just change coordinates of Click Potash button)
;Requires:
;168 Wood
;150 Water
;30 Ash

;Pin 6 kettle menus from left to right

;Ctrl+Alt+W to start script
;Ctrl+R to reload
;Ctrl+P to pause
;Emergency: Hold F2 button down 2 seconds to Abort current countdown and hit Stoke Max immediately
;The current countdown will abort, but subsequent countdowns will continue normally.

;Trust the script, only use Emergency F2 when you have more than 32s when the Wood count turns to zero
;As long as there is less than 32s, when the wood hits zero, then dont interupt the script

^r::reload
^p::Pause
^!w::

	IfWinExist eGenesis Client
	{
	WinGet, GameWinHandle, ID, eGenesis Client
	} else {
	Msgbox, eGenesis client not running, exiting...
	Exit
	}


	Gui, +AlwaysOnTop +ToolWindow
	Gui, Add, Text,, Type of Kettles?
	Gui, Add, DropDownList, vKettle Choose2, Private|Public
	Gui, Add, Button, Default gStart, GO
	Gui, Show
	return


	Start:
	seconds = 2

	Gui, Submit
	Gui, Destroy
	Msgbox, Ingredients needed to run 6 kettles:`n`n168 Wood`n150 Water`n30 Ash`n`nMake sure you have that in your inventory!`n`nKettle Type: %Kettle%`n`nClick OK to continue...
	Gui, +AlwaysOnTop +ToolWindow
	Gui, Font, bold
	Gui, Add, Text, vMineCycleText, %seconds% seconds before the script will begin ...
	Gui, Font, norm
	Gui, Show
	GuiControl, Text, MineCycleText, %seconds% seconds before the script will begin ...






	Loop, %seconds%
	{
	GuiControl, Text, MineCycleText, %seconds% seconds before the script will begin ...
	seconds --
	Sleep 1000
	}



	GuiControl, Text, MineCycleText, Focusing to eGenesis client ...

	WinActivate, eGenesis Client

;Click Potash Button

	PotashY = 165
	if (Kettle == "Public")
	{
	PotashY := PotashY + 15
	}


	GuiControl, Text, MineCycleText, Clicking Potash, Pot 1
	Click, 45, %PotashY% ;Pot 1
	sleep 200
	GuiControl, Text, MineCycleText, Click Potash, Pot 2
	Click, 220, %PotashY% ;Pot 2
	sleep 200
	GuiControl, Text, MineCycleText, Click Potash, Pot 3
	Click, 385, %PotashY% ;Pot 3
	sleep 200
	GuiControl, Text, MineCycleText, Click Potash, Pot 4
	Click, 555, %PotashY% ;Pot 4
	sleep 200
	GuiControl, Text, MineCycleText, Click Potash, Pot 5
	Click, 725, %PotashY% ;Pot 5
	sleep 200
	GuiControl, Text, MineCycleText, Click Potash, Pot 6
	Click, 890, %PotashY% ;Pot 6
	sleep 200


;Click Begin button

	BeginIgniteY = 240
	if (Kettle == "Public")
	{
	BeginIgniteY := BeginIgniteY + 15
	}


	GuiControl, Text, MineCycleText, Click Begin, Pot 1
	Click, 45, %BeginIgniteY% ;Pot 1			
	sleep 200
	GuiControl, Text, MineCycleText, Click Begin, Pot 2
	Click, 220, %BeginIgniteY% ;Pot 2			
	sleep 200
	GuiControl, Text, MineCycleText, Click Begin, Pot 3
	Click, 385, %BeginIgniteY% ;Pot 3			
	sleep 200
	GuiControl, Text, MineCycleText, Click Begin, Pot 4
	Click, 555, %BeginIgniteY% ;Pot 4			
	sleep 200
	GuiControl, Text, MineCycleText, Click Begin, Pot 5
	Click, 725, %BeginIgniteY% ;Pot 5			
	sleep 200
	GuiControl, Text, MineCycleText, Click Begin, Pot 6
	Click, 890, %BeginIgniteY% ;Pot 6			
	sleep 200




;Click Ignite + Max button, then Refresh Menu (to show Stoke Max option)


	;Pot 1
	GuiControl, Text, MineCycleText, Igniting/Refreshing Pot 1
	Click, 45, %BeginIgniteY% ;Ignite			
	sleep 200
	Click, 515, 420 ;Max button
	sleep 200
	Click, 70, 45 ;Click Menu to refresh	
	sleep 200

	;Pot 2		
	GuiControl, Text, MineCycleText, Igniting/Refreshing Pot 2
	Click, 215, %BeginIgniteY% ;Ignite			
	sleep 200
	Click, 515, 420 ;Max button
	sleep 200
	Click, 245, 45 ;Click Menu to refresh	
	sleep 200

	;Pot 3
	GuiControl, Text, MineCycleText, Igniting/Refreshing Pot 3
	Click, 385, %BeginIgniteY% ;Ignite			
	sleep 200
	Click, 515, 420 ;Max button
	sleep 200
	Click, 415, 45 ;Click Menu to refresh	
	sleep 200

	;Pot 4
	GuiControl, Text, MineCycleText, Igniting/Refreshing Pot 4
	Click, 560, %BeginIgniteY% ;Ignite			
	sleep 200
	Click, 515, 420 ;Max button
	sleep 200
	Click, 580, 45 ;Click Menu to refresh	
	sleep 200

	;Pot 5
	GuiControl, Text, MineCycleText, Igniting/Refreshing Pot 5
	Click, 725, %BeginIgniteY% ;Ignite			
	sleep 200
	Click, 515, 420 ;Max button
	sleep 200
	Click, 750, 45 ;Click Menu to refresh	
	sleep 200

	;Pot 6
	GuiControl, Text, MineCycleText, Igniting/Refreshing Pot 6
	Click, 895, %BeginIgniteY% ;Ignite			
	sleep 200
	Click, 515, 420 ;Max button
	sleep 200
	Click, 915, 45 ;Click Menu to refresh	
	sleep 200




;Stoke 1 countdown

seconds = 130
	Loop, %seconds%
	{
	GuiControl, Text, MineCycleText, %seconds% seconds until Stoke 1/5  (24 water)
	seconds --
	Sleep 1000

GetKeyState, state, F2
if state = D
{
break
}
	}

Gosub, StokeMax




;Stoke 2 (19 water) countdown

seconds = 165
	Loop, %seconds%
	{
	GuiControl, Text, MineCycleText, %seconds% seconds until Stoke 2/5  (19 water)
	seconds --
	Sleep 1000

GetKeyState, state, F2
if state = D
{
break
}

	}

Gosub, StokeMax



;Stoke 3 (14 water) countdown

seconds = 165
	Loop, %seconds%
	{
	GuiControl, Text, MineCycleText, %seconds% seconds until Stoke 3/5  (14 water)
	seconds --
	Sleep 1000

GetKeyState, state, F2
if state = D
{
break
}

	}

Gosub, StokeMax



;Stoke 4 (9 water) countdown

seconds = 165
	Loop, %seconds%
	{
	GuiControl, Text, MineCycleText, %seconds% seconds until Stoke 4/5  (9 water)
	seconds --
	Sleep 1000

GetKeyState, state, F2
if state = D
{
break
}
	}

Gosub, StokeMax


;Stoke 5 (6 water) countdown

seconds = 96 
	Loop, %seconds%
	{
	GuiControl, Text, MineCycleText, %seconds% seconds until Stoke 5/5  (6 water)
	seconds --
	Sleep 1000
GetKeyState, state, F2
if state = D
{
break
}
	}

Gosub, StokeMax


;Countdown until complete
seconds = 175
	Loop, %seconds%
	{
	GuiControl, Text, MineCycleText, %seconds% seconds until complete...
	seconds --
	Sleep 1000
	}

	Gui, Destroy
	Gui, Add, Text,, Done!.
	Gui, Show
	return




	StokeMax:

	WinActivate, eGenesis Client

	StokeMaxY = 75
	if (Kettle == "Public")
	{
	StokeMaxY := StokeMaxY + 15
	}

	;Click Stoke Max
	MouseGetPos, OldMX, OldMY
	GuiControl, Text, MineCycleText, Stoking, Pot 1
	Click, 50, %StokeMaxY% ; Pot 1			
	sleep 200
	GuiControl, Text, MineCycleText, Stoking, Pot 2
	Click, 250, %StokeMaxY% ; Pot 2			
	sleep 200
	GuiControl, Text, MineCycleText, Stoking, Pot 3
	Click, 420, %StokeMaxY% ; Pot 3			
	sleep 200
	GuiControl, Text, MineCycleText, Stoking, Pot 4
	Click, 590, %StokeMaxY% ; Pot 4			
	sleep 200
	GuiControl, Text, MineCycleText, Stoking, Pot 5
	Click, 750, %StokeMaxY% ; Pot 5			
	sleep 200
	GuiControl, Text, MineCycleText, Stoking, Pot 6
	Click, 910, %StokeMaxY% ; Pot 6			
	sleep 200
	MouseMove, %OldMX%, %OldMY%, 0			
	return