define script AIStuff
//define script ExtraMiracles
define script Test
define script LocationTest

/*run script main
begin script main
	oTest = 0
start
	//enable global influence
	set toolbar state to MENU_TOOLBAR_STATE_CLOSED
	increment tribute by 1000000

	disable load screen
	set fade in time 1

	run background script AIStuff
	run background script ExtraMiracles
	run background script ResearchStandardArtefacts
	run background script KalevFPS
	//run background script InfiniteMana

	//run background script Test
	//run background script LocationTest
	//run background script VisualEffectTest
	//run background script MathsTest

end script main*/

begin script Test
	lPos = 0
start
/*
	wait until key KB_2 down
	lPos = marker at hand position
	run background script MiracleEmitter(1, 1, 30.0, lPos, 2, 0)
	wait 1.0 seconds
	run background script MiracleEmitter(1, 2, 30.0, lPos, 2, 0)
	//run background script MiracleEmitter(1, 3, 30.0, lPos, 2, 1)
	//run background script MiracleEmitter(1, 4, 30.0, lPos, 2, 1)
	//run background script MiracleEmitter(1, 5, 30.0, lPos, 2, 1)
	//run background script MiracleEmitter(1, 6, 30.0, lPos, 2, 1)
*/

end script Test

begin script AIStuff
start
	run script CreateTownArray
	run background script RunTownAIForAll

end script AIStuff


begin script LocationTest
	oLocObject = 0
	nLocationIsValid = 0
	lLoc = 0
start
	begin loop
		if key KB_1 down
			lLoc = marker at hand position

			oLocObject = create SCRIPT_OBJECT_TYPE_VILLAGER VILLAGER_INFO_AZTEC_HOUSEWIFE_FEMALE at {lLoc}
			if oLocObject can navigate to {oLocObject}
				nLocationIsValid = 1
			else
				nLocationIsValid = 0
			end if
			delete oLocObject

			increment tribute by nLocationIsValid
			wait 1.0 seconds
		end if
	end loop

end script LocationTest