Project

General

Profile

 

Also available in: PDF

Automatically Sacrifice Items Added to Altar

To use this test script, create a file in your /innerspace/scripts folder called EQ2AutoSacrifice.iss and place the entire text below. Then, you can run the script by typing the following command in the InnerSpace console (while in the game): run EQ2AutoSacrifice.   The script will cause any item added to an altar to be automatically sacrificed.


variable bool ItemAddedToAltarForSacrifice = FALSE
variable uint ItemAddedToAltarForSacrifice_ItemIndex = 0

atom EQ2_ItemAddedToAltarForSacrifice(int ItemIndex)
{
	ItemAddedToAltarForSacrifice:Set[TRUE]
	ItemAddedToAltarForSacrifice_ItemIndex:Set[${ItemIndex}]
}

function main()
{
	if (!${ISXEQ2(exists)} || !${ISXEQ2.IsReady})
	{
		echo "\arERROR - ISXEQ2 not loaded or ready\ax"
		return
	}
	Event[EQ2_ItemAddedToAltarForSacrifice]:AttachAtom[EQ2_ItemAddedToAltarForSacrifice]

	echo "\ayNow automatically sacrificing any item added to an altar.\ax"

	do 
	{
		if (${ItemAddedToAltarForSacrifice})
		{
			wait ${Math.Calc[${Math.Rand[2]}+1].Precision[0]}
			eq2execute /deity_offer ${ItemAddedToAltarForSacrifice_ItemIndex} 1	
			ItemAddedToAltarForSacrifice_ItemIndex:Set[0]
			ItemAddedToAltarForSacrifice:Set[FALSE]
		}	

		if (${ChoiceWindow(exists)})
		{
			if (${ChoiceWindow.Child[text,Text].GetProperty[text].Find[want to sacrifice]} > 0)
			{
				wait ${Math.Calc[${Math.Rand[2]}+1].Precision[0]}
				ChoiceWindow:DoChoice1
			}
		}

		wait 2
	}
	while (${ISXEQ2(exists)} && ${ISXEQ2.IsReady})

	return
}

function atexit()
{
	Event[EQ2_ItemAddedToAltarForSacrifice]:DetachAtom[EQ2_ItemAddedToAltarForSacrifice]
	echo "\ayScript Ended.\ax"
}