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 28: Line 28:
 
Exit
 
Exit
 
}
 
}
 +
 +
 +
 +
;=========================================
 +
;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
 +
}
 +
;=========================================
 +
  
  
Line 131: Line 147:
 
;Click Ignite + Max button, then Refresh Menu (to show Stoke Max option)
 
;Click Ignite + Max button, then Refresh Menu (to show Stoke Max option)
  
 +
MaxButtonX = 515
 +
MaxButtonY = 420
  
 
;Pot 1
 
;Pot 1
Line 136: Line 154:
 
Click, 45, %BeginIgniteY% ;Ignite
 
Click, 45, %BeginIgniteY% ;Ignite
 
sleep 200
 
sleep 200
Click, 515, 420 ;Max button
+
Click, %MaxButtonX%, %MaxButtonY% ;Max button
 
sleep 200
 
sleep 200
 
Click, 70, 45 ;Click Menu to refresh
 
Click, 70, 45 ;Click Menu to refresh
Line 145: Line 163:
 
Click, 215, %BeginIgniteY% ;Ignite
 
Click, 215, %BeginIgniteY% ;Ignite
 
sleep 200
 
sleep 200
Click, 515, 420 ;Max button
+
Click, %MaxButtonX%, %MaxButtonY% ;Max button
 
sleep 200
 
sleep 200
 
Click, 245, 45 ;Click Menu to refresh
 
Click, 245, 45 ;Click Menu to refresh
Line 154: Line 172:
 
Click, 385, %BeginIgniteY% ;Ignite
 
Click, 385, %BeginIgniteY% ;Ignite
 
sleep 200
 
sleep 200
Click, 515, 420 ;Max button
+
Click, %MaxButtonX%, %MaxButtonY% ;Max button
 
sleep 200
 
sleep 200
 
Click, 415, 45 ;Click Menu to refresh
 
Click, 415, 45 ;Click Menu to refresh
Line 163: Line 181:
 
Click, 560, %BeginIgniteY% ;Ignite
 
Click, 560, %BeginIgniteY% ;Ignite
 
sleep 200
 
sleep 200
Click, 515, 420 ;Max button
+
Click, %MaxButtonX%, %MaxButtonY% ;Max button
 
sleep 200
 
sleep 200
 
Click, 580, 45 ;Click Menu to refresh
 
Click, 580, 45 ;Click Menu to refresh
Line 172: Line 190:
 
Click, 725, %BeginIgniteY% ;Ignite
 
Click, 725, %BeginIgniteY% ;Ignite
 
sleep 200
 
sleep 200
Click, 515, 420 ;Max button
+
Click, %MaxButtonX%, %MaxButtonY% ;Max button
 
sleep 200
 
sleep 200
 
Click, 750, 45 ;Click Menu to refresh
 
Click, 750, 45 ;Click Menu to refresh
Line 181: Line 199:
 
Click, 895, %BeginIgniteY% ;Ignite
 
Click, 895, %BeginIgniteY% ;Ignite
 
sleep 200
 
sleep 200
Click, 515, 420 ;Max button
+
Click, %MaxButtonX%, %MaxButtonY% ;Max button
 
sleep 200
 
sleep 200
 
Click, 915, 45 ;Click Menu to refresh
 
Click, 915, 45 ;Click Menu to refresh

Revision as of 02:09, 3 February 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
	}



;=========================================
;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 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)

	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 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