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 2: Line 2:
 
;Make Potash with 6 kettles (MAY work with other stoked kettle projects, just change coordinates of Click Potash button)
 
;Make Potash with 6 kettles (MAY work with other stoked kettle projects, just change coordinates of Click Potash button)
 
;Requires:
 
;Requires:
;168 Wood
+
;168, 336, 504, 672, 840 Wood
 
;150 Water
 
;150 Water
;30 Ash
+
;30, 60, 90, 120, 150 Ash
  
 
;Pin 6 kettle menus from left to right
 
;Pin 6 kettle menus from left to right
Line 16: Line 16:
 
;Trust the script, only use Emergency F2 when you have more than 32s when the Wood count turns to zero
 
;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
 
;As long as there is less than 32s, when the wood hits zero, then dont interupt the script
 +
;When it hits zero wood, its still a full 32 seconds before the kettle goes out
  
 
^r::reload
 
^r::reload
 
^p::Pause
 
^p::Pause
 
^!w::
 
^!w::
 +
 +
  
 
IfWinExist eGenesis Client
 
IfWinExist eGenesis Client
Line 30: Line 33:
  
  
 +
WinGetActiveStats, win_Title, Xmax, Ymax, win_Xpos, win_Ypos
  
;=========================================
+
;======================================================================
;Check to see if we are in the correct resolution, or else exit script.
+
;Check to see if we are in the correct resolution, or else exit script.
;You may remove this entire routine, if you wish.
+
;You may remove this entire routine, if you wish.
  
 
if (Xmax = 1032) && (Ymax = 746)
 
if (Xmax = 1032) && (Ymax = 746)
Line 42: Line 46:
 
EXIT
 
EXIT
 
}
 
}
;=========================================
+
;======================================================================
  
  
Line 48: Line 52:
 
Gui, +AlwaysOnTop +ToolWindow
 
Gui, +AlwaysOnTop +ToolWindow
 
Gui, Add, Text,, Type of Kettles?
 
Gui, Add, Text,, Type of Kettles?
Gui, Add, DropDownList, vKettle Choose2, Private|Public
+
Gui, Add, DropDownList, vKettle Choose1, Private|Public
 
Gui, Add, Button, Default gStart, GO
 
Gui, Add, Button, Default gStart, GO
 
Gui, Show
 
Gui, Show
Line 89: Line 93:
 
PotashY = 165
 
PotashY = 165
 
if (Kettle == "Public")
 
if (Kettle == "Public")
{
 
 
PotashY := PotashY + 15
 
PotashY := PotashY + 15
}
 
  
  
Line 118: Line 120:
 
BeginIgniteY = 240
 
BeginIgniteY = 240
 
if (Kettle == "Public")
 
if (Kettle == "Public")
{
 
 
BeginIgniteY := BeginIgniteY + 15
 
BeginIgniteY := BeginIgniteY + 15
}
 
  
  
Line 218: Line 218:
 
GetKeyState, state, F2
 
GetKeyState, state, F2
 
if state = D
 
if state = D
{
 
 
break
 
break
}
 
 
}
 
}
  
Line 260: Line 258:
 
GetKeyState, state, F2
 
GetKeyState, state, F2
 
if state = D
 
if state = D
{
 
 
break
 
break
}
 
  
 
}
 
}
Line 281: Line 277:
 
GetKeyState, state, F2
 
GetKeyState, state, F2
 
if state = D
 
if state = D
{
 
 
break
 
break
}
 
 
}
 
}
  
Line 299: Line 293:
 
GetKeyState, state, F2
 
GetKeyState, state, F2
 
if state = D
 
if state = D
{
 
 
break
 
break
}
 
 
}
 
}
  
Line 311: Line 303:
 
Loop, %seconds%
 
Loop, %seconds%
 
{
 
{
GuiControl, Text, MineCycleText, %seconds% seconds until complete...
+
GuiControl, Text, MineCycleText, %seconds% seconds until Kettles complete...
 
seconds --
 
seconds --
 
Sleep 1000
 
Sleep 1000
 
}
 
}
 +
 +
;Add Keywait Numpad +, to take from each menu. Take button is same button locations as Begin/Ignite buttons
 +
  
 
Gui, Destroy
 
Gui, Destroy
Line 330: Line 325:
 
StokeMaxY = 75
 
StokeMaxY = 75
 
if (Kettle == "Public")
 
if (Kettle == "Public")
{
 
 
StokeMaxY := StokeMaxY + 15
 
StokeMaxY := StokeMaxY + 15
}
+
 
  
 
;Click Stoke Max
 
;Click Stoke Max

Revision as of 15:31, 25 February 2010

;Make Potash with 6 kettles (MAY work with other stoked kettle projects, just change coordinates of Click Potash button)
;Requires:
;168, 336, 504, 672, 840 Wood
;150 Water
;30, 60, 90, 120, 150 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 on all pots
;Only the current countdown will abort. It will move on to the next countdown and 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
;When it hits zero wood, its still a full 32 seconds before the kettle goes out

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



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


	WinGetActiveStats, win_Title, Xmax, Ymax, win_Xpos, win_Ypos

	;======================================================================
	;Check to see if we are in the correct resolution, or else exit script.
	;You may remove this entire routine, if you wish.

	if (Xmax = 1032) && (Ymax = 746)
	{
	nothing = 0
	} else {
	Msgbox, You are not in 1024x768 resolution`n`nExiting...
	EXIT
	}
	;======================================================================



	Gui, +AlwaysOnTop +ToolWindow
	Gui, Add, Text,, Type of Kettles?
	Gui, Add, DropDownList, vKettle Choose1, 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)

	MaxButtonX = 515
	MaxButtonY = 420

	;Pot 1
	GuiControl, Text, MineCycleText, Igniting/Refreshing Pot 1
	Click, 45, %BeginIgniteY% ;Ignite			
	sleep 200
	Click, %MaxButtonX%, %MaxButtonY% ;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, %MaxButtonX%, %MaxButtonY% ;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, %MaxButtonX%, %MaxButtonY% ;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, %MaxButtonX%, %MaxButtonY% ;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, %MaxButtonX%, %MaxButtonY% ;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, %MaxButtonX%, %MaxButtonY% ;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 Kettles complete...
	seconds --
	Sleep 1000
	}

;Add Keywait Numpad +, to take from each menu. Take button is same button locations as Begin/Ignite buttons


	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