
;==============Command line parameters (leave blank if not desired)================
extraparams = -window -dxlog -debug_steamapi -network_debug -nostartup

;Runs Aok HD with command line parameters designated in Settings

Run, AoK HD.exe %extraparams%, %exeLoc%
    	Sleep, 1000


;Assures Game is the active window

WinWait, Age of Empires II HD, 
IfWinNotActive, Age of Empires II HD, , WinActivate, Age of Empires II HD, 
WinWaitActive, Age of Empires II HD, 

;This script will resize the active window

;Number key will change size of active window

ResizeWin(800,600)

ResizeWin(Width = 0,Height = 0)

{
  WinGetPos,X,Y,W,H,A
  If %Width% = 0
    Width := W

  If %Height% = 0
    Height := H

  WinMove,A,,%X%,%Y%,%Width%,%Height%
}
	
WinMove, 103, 10  

	Sleep, 1000 


;||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||

;Launches and takes a screenshot of scenario

Run, X:\AoK_HD\BVT\Huns\Huns1.1.ahk

		WinWait, mbox.ahk, 
		IfWinNotActive, mbox.ahk, , WinActivate, mbox.ahk, 
		WinWaitActive, mbox.ahk, 

	Sleep, 100

	Send, {ENTER}

	Sleep, 100

	WinWait, Age of Empires II HD, 
	IfWinNotActive, Age of Empires II HD, , WinActivate, Age of Empires II HD, 
	WinWaitActive, Age of Empires II HD, 

ResizeWin(800,600)
WinMove, 103, 10  

;Launches and takes a screenshot of scenario
Run, X:\AoK_HD\BVT\Huns\Huns1.2.ahk

		WinWait, mbox.ahk, 
		IfWinNotActive, mbox.ahk, , WinActivate, mbox.ahk, 
		WinWaitActive, mbox.ahk, 

	Sleep, 100

	Send, {ENTER}

	Sleep, 100

	WinWait, Age of Empires II HD, 
	IfWinNotActive, Age of Empires II HD, , WinActivate, Age of Empires II HD, 
	WinWaitActive, Age of Empires II HD, 

ResizeWin(800,600)
WinMove, 103, 10  

;Launches and takes a screenshot of scenario

Run, X:\AoK_HD\BVT\Huns\Huns1.3.ahk

		WinWait, mbox.ahk, 
		IfWinNotActive, mbox.ahk, , WinActivate, mbox.ahk, 
		WinWaitActive, mbox.ahk, 

	Sleep, 100

	Send, {ENTER}

	Sleep, 100

	WinWait, Age of Empires II HD, 
	IfWinNotActive, Age of Empires II HD, , WinActivate, Age of Empires II HD, 
	WinWaitActive, Age of Empires II HD, 

ResizeWin(800,600)
WinMove, 103, 10  

;Launches and takes a screenshot of scenario

Run, X:\AoK_HD\BVT\Huns\Huns1.4.ahk

		WinWait, mbox.ahk, 
		IfWinNotActive, mbox.ahk, , WinActivate, mbox.ahk, 
		WinWaitActive, mbox.ahk, 

	Sleep, 100

	Send, {ENTER}

	Sleep, 100

	WinWait, Age of Empires II HD, 
	IfWinNotActive, Age of Empires II HD, , WinActivate, Age of Empires II HD, 
	WinWaitActive, Age of Empires II HD, 

ResizeWin(800,600)
WinMove, 103, 10  

;Launches and takes a screenshot of scenario

Run, X:\AoK_HD\BVT\Huns\Huns1.5.ahk

		WinWait, mbox.ahk, 
		IfWinNotActive, mbox.ahk, , WinActivate, mbox.ahk, 
		WinWaitActive, mbox.ahk, 

	Sleep, 100

	Send, {ENTER}

	Sleep, 100

	WinWait, Age of Empires II HD, 
	IfWinNotActive, Age of Empires II HD, , WinActivate, Age of Empires II HD, 
	WinWaitActive, Age of Empires II HD, 

ResizeWin(800,600)
WinMove, 103, 10  

;Launches and takes a screenshot of scenario

Run, X:\AoK_HD\BVT\Huns\Huns1.6.ahk

		WinWait, mbox.ahk, 
		IfWinNotActive, mbox.ahk, , WinActivate, mbox.ahk, 
		WinWaitActive, mbox.ahk, 

	Sleep, 100

	Send, {ENTER}

	Sleep, 100

	WinWait, Age of Empires II HD, 
	IfWinNotActive, Age of Empires II HD, , WinActivate, Age of Empires II HD, 
	WinWaitActive, Age of Empires II HD, 

ResizeWin(800,600)
WinMove, 103, 10  


;||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||


;Launches and takes a screenshot of scenario

Run, X:\AoK_HD\BVT\ElCid\ElCid1.1.ahk

		WinWait, mbox.ahk, 
		IfWinNotActive, mbox.ahk, , WinActivate, mbox.ahk, 
		WinWaitActive, mbox.ahk, 

	Sleep, 100

	Send, {ENTER}

	Sleep, 100

	WinWait, Age of Empires II HD, 
	IfWinNotActive, Age of Empires II HD, , WinActivate, Age of Empires II HD, 
	WinWaitActive, Age of Empires II HD, 

ResizeWin(800,600)
WinMove, 103, 10  

;Launches and takes a screenshot of scenario
Run, X:\AoK_HD\BVT\ElCid\ElCid1.2.ahk

		WinWait, mbox.ahk, 
		IfWinNotActive, mbox.ahk, , WinActivate, mbox.ahk, 
		WinWaitActive, mbox.ahk, 

	Sleep, 100

	Send, {ENTER}

	Sleep, 100

	WinWait, Age of Empires II HD, 
	IfWinNotActive, Age of Empires II HD, , WinActivate, Age of Empires II HD, 
	WinWaitActive, Age of Empires II HD, 

ResizeWin(800,600)
WinMove, 103, 10  

;Launches and takes a screenshot of scenario

Run, X:\AoK_HD\BVT\ElCid\ElCid1.3.ahk

		WinWait, mbox.ahk, 
		IfWinNotActive, mbox.ahk, , WinActivate, mbox.ahk, 
		WinWaitActive, mbox.ahk, 

	Sleep, 100

	Send, {ENTER}

	Sleep, 100

	WinWait, Age of Empires II HD, 
	IfWinNotActive, Age of Empires II HD, , WinActivate, Age of Empires II HD, 
	WinWaitActive, Age of Empires II HD, 

ResizeWin(800,600)
WinMove, 103, 10  

;Launches and takes a screenshot of scenario

Run, X:\AoK_HD\BVT\ElCid\ElCid1.4.ahk

		WinWait, mbox.ahk, 
		IfWinNotActive, mbox.ahk, , WinActivate, mbox.ahk, 
		WinWaitActive, mbox.ahk, 

	Sleep, 100

	Send, {ENTER}

	Sleep, 100

	WinWait, Age of Empires II HD, 
	IfWinNotActive, Age of Empires II HD, , WinActivate, Age of Empires II HD, 
	WinWaitActive, Age of Empires II HD, 

ResizeWin(800,600)
WinMove, 103, 10  

;Launches and takes a screenshot of scenario

Run, X:\AoK_HD\BVT\ElCid\ElCid1.5.ahk

		WinWait, mbox.ahk, 
		IfWinNotActive, mbox.ahk, , WinActivate, mbox.ahk, 
		WinWaitActive, mbox.ahk, 

	Sleep, 100

	Send, {ENTER}

	Sleep, 100

	WinWait, Age of Empires II HD, 
	IfWinNotActive, Age of Empires II HD, , WinActivate, Age of Empires II HD, 
	WinWaitActive, Age of Empires II HD, 

ResizeWin(800,600)

WinMove, 103, 10  

;Launches and takes a screenshot of scenario

Run, X:\AoK_HD\BVT\ElCid\ElCid1.6.ahk

		WinWait, mbox.ahk, 
		IfWinNotActive, mbox.ahk, , WinActivate, mbox.ahk, 
		WinWaitActive, mbox.ahk, 

	Sleep, 100

	Send, {ENTER}

	Sleep, 100

	WinWait, Age of Empires II HD, 
	IfWinNotActive, Age of Empires II HD, , WinActivate, Age of Empires II HD, 
	WinWaitActive, Age of Empires II HD, 

ResizeWin(800,600)
WinMove, 103, 10  


;||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||




;Launches and takes a screenshot of scenario

Run, X:\AoK_HD\BVT\MZuma\MZuma1.1.ahk

		WinWait, mbox.ahk, 
		IfWinNotActive, mbox.ahk, , WinActivate, mbox.ahk, 
		WinWaitActive, mbox.ahk, 

	Sleep, 100

Send, {ENTER}

	WinWait, Age of Empires II HD, 
	IfWinNotActive, Age of Empires II HD, , WinActivate, Age of Empires II HD, 
	WinWaitActive, Age of Empires II HD, 

ResizeWin(800,600)
WinMove, 103, 10  

;Launches and takes a screenshot of scenario

Run, X:\AoK_HD\BVT\MZuma\MZuma1.2.ahk

		WinWait, mbox.ahk, 
		IfWinNotActive, mbox.ahk, , WinActivate, mbox.ahk, 
		WinWaitActive, mbox.ahk, 

	Sleep, 100

Send, {ENTER}

	WinWait, Age of Empires II HD, 
	IfWinNotActive, Age of Empires II HD, , WinActivate, Age of Empires II HD, 
	WinWaitActive, Age of Empires II HD, 

ResizeWin(800,600)
WinMove, 103, 10  

;Launches and takes a screenshot of scenario

Run, X:\AoK_HD\BVT\MZuma\MZuma1.3.ahk

		WinWait, mbox.ahk, 
		IfWinNotActive, mbox.ahk, , WinActivate, mbox.ahk, 
		WinWaitActive, mbox.ahk, 

	Sleep, 100

Send, {ENTER}

	WinWait, Age of Empires II HD, 
	IfWinNotActive, Age of Empires II HD, , WinActivate, Age of Empires II HD, 
	WinWaitActive, Age of Empires II HD, 

ResizeWin(800,600)
WinMove, 103, 10  

;Launches and takes a screenshot of scenario

Run, X:\AoK_HD\BVT\MZuma\MZuma1.4.ahk

		WinWait, mbox.ahk, 
		IfWinNotActive, mbox.ahk, , WinActivate, mbox.ahk, 
		WinWaitActive, mbox.ahk, 

	Sleep, 100

Send, {ENTER}

	WinWait, Age of Empires II HD, 
	IfWinNotActive, Age of Empires II HD, , WinActivate, Age of Empires II HD, 
	WinWaitActive, Age of Empires II HD, 

ResizeWin(800,600)
WinMove, 103, 10  

;Launches and takes a screenshot of scenario

Run, X:\AoK_HD\BVT\MZuma\MZuma1.5.ahk

		WinWait, mbox.ahk, 
		IfWinNotActive, mbox.ahk, , WinActivate, mbox.ahk, 
		WinWaitActive, mbox.ahk, 

	Sleep, 100

Send, {ENTER}

	WinWait, Age of Empires II HD, 
	IfWinNotActive, Age of Empires II HD, , WinActivate, Age of Empires II HD, 
	WinWaitActive, Age of Empires II HD, 

ResizeWin(800,600)
WinMove, 103, 10  

;Launches and takes a screenshot of scenario

Run, X:\AoK_HD\BVT\MZuma\MZuma1.6.ahk

		WinWait, mbox.ahk, 
		IfWinNotActive, mbox.ahk, , WinActivate, mbox.ahk, 
		WinWaitActive, mbox.ahk, 

	Sleep, 100

Send, {ENTER}

	WinWait, Age of Empires II HD, 
	IfWinNotActive, Age of Empires II HD, , WinActivate, Age of Empires II HD, 
	WinWaitActive, Age of Empires II HD, 

ResizeWin(800,600)
WinMove, 103, 10  


;||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||


;Launches and takes a screenshot of scenario

Run, X:\AoK_HD\BVT\Barbarossa\Barbarossa1.1.ahk

		WinWait, mbox.ahk, 
		IfWinNotActive, mbox.ahk, , WinActivate, mbox.ahk, 
		WinWaitActive, mbox.ahk, 

	Sleep, 100

Send, {ENTER}

	WinWait, Age of Empires II HD, 
	IfWinNotActive, Age of Empires II HD, , WinActivate, Age of Empires II HD, 
	WinWaitActive, Age of Empires II HD, 

ResizeWin(800,600)
WinMove, 103, 10  

;Launches and takes a screenshot of scenario
Run, X:\AoK_HD\BVT\Barbarossa\Barbarossa1.2.ahk

		WinWait, mbox.ahk, 
		IfWinNotActive, mbox.ahk, , WinActivate, mbox.ahk, 
		WinWaitActive, mbox.ahk, 

	Sleep, 100


Send, {ENTER}

ResizeWin(800,600)
WinMove, 103, 10  

;Launches and takes a screenshot of scenario

Run, X:\AoK_HD\BVT\Barbarossa\Barbarossa1.3.ahk

		WinWait, mbox.ahk, 
		IfWinNotActive, mbox.ahk, , WinActivate, mbox.ahk, 
		WinWaitActive, mbox.ahk, 

	Sleep, 100

	WinWait, Age of Empires II HD, 
	IfWinNotActive, Age of Empires II HD, , WinActivate, Age of Empires II HD, 
	WinWaitActive, Age of Empires II HD, 

Send, {ENTER}

ResizeWin(800,600)
WinMove, 103, 10  

;Launches and takes a screenshot of scenario

Run, X:\AoK_HD\BVT\Barbarossa\Barbarossa1.4.ahk

		WinWait, mbox.ahk, 
		IfWinNotActive, mbox.ahk, , WinActivate, mbox.ahk, 
		WinWaitActive, mbox.ahk, 

	Sleep, 100


Send, {ENTER}

ResizeWin(800,600)
WinMove, 103, 10  

;Launches and takes a screenshot of scenario

Run, X:\AoK_HD\BVT\Barbarossa\Barbarossa1.5.ahk

		WinWait, mbox.ahk, 
		IfWinNotActive, mbox.ahk, , WinActivate, mbox.ahk, 
		WinWaitActive, mbox.ahk, 

	Sleep, 100


Send, {ENTER}

	WinWait, Age of Empires II HD, 
	IfWinNotActive, Age of Empires II HD, , WinActivate, Age of Empires II HD, 
	WinWaitActive, Age of Empires II HD, 

ResizeWin(800,600)
WinMove, 103, 10  

;Launches and takes a screenshot of scenario

Run, X:\AoK_HD\BVT\Barbarossa\Barbarossa1.6.ahk

		WinWait, mbox.ahk, 
		IfWinNotActive, mbox.ahk, , WinActivate, mbox.ahk, 
		WinWaitActive, mbox.ahk, 

	Sleep, 100

Send, {ENTER}

	WinWait, Age of Empires II HD, 
	IfWinNotActive, Age of Empires II HD, , WinActivate, Age of Empires II HD, 
	WinWaitActive, Age of Empires II HD, 

ResizeWin(800,600)
WinMove, 103, 10  

	Sleep, 100


;|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||


ExitApp

;+++ Keybinding [END] to force close all running AHK scripts
~End::
;process, close, AoK HD.exe
;	Sleep, 500

Run, X:\AOK_HD\AoK_Resolution_automation\tools\kill.ahk