For Pygar

v01d

Well-Known Member
Code:
;
; Loot Code
;

atom(script) LootWindowBusy()
{
	echo Clearing Busy LootWindow
	EQ2UIPage[Inventory,Loot].Child[button,Loot.button LootAll]:LeftClick
}

atom(script) NoTradeWindow()
{
	echo No Trade Confirmation
	EQ2UIPage[Hud,Choice].Child[button,Choice.Choice1]:LeftClick
}

atom(script) LoreWindow()
{
	echo Lore Confirmation
;	EQ2UIPage[Hud,Choice].Child[button,Choice.Choice1]:LeftClick
}

atom(script) LootWindow(string ID)
{
	declare i int local
	if ${ID.Equal[${LastWindow}]}
	{
		echo Skipping LootWindow (ID: ${ID})
	}
	else
	{
		echo Processing LootWindow (ID: ${ID})
		if ${LootWindow.NumItems}
		{
			i:Set[1]
			while ${i} <= ${LootWindow.NumItems}
			{
				if ${LootWindow.Item[${i}].Lore} && ${Me.Inventory[${LootWindow.Item[${i}].Name}](exists)}
				{
					echo Destroying Lore Item ${LootWindow.Item[${i}].Name}
					Me.Inventory[${LootWindow.Item[${i}].Name}]:Destroy
				}
				i:Inc
			}
			LootWindow:LootAll
		}
	}
	LastWindow:Set[${ID}]
}

atom(script) atexit()
{
	Event[EQ2_onLootWindowAppeared]:DetachAtom[LootWindow]	
}

function main()
{
	declare LastWindow string script

	Event[EQ2_onLootWindowAppeared]:AttachAtom[LootWindow]	

	AddTrigger LootWindowBusy "@*@You are too busy to loot right now@*@"
	AddTrigger NoTradeWindow "@*@You must confirm you want to loot@*@which is a no trade item@*@"
}


function loot()
{
	while ${Actor[corpse,radius,10](exists)}
	{
		EQ2execute "/apply_verb ${Actor[corpse,radius,10].ID} loot"
		wait 5
	}
	if ${Actor[Chest,radius,10](exists)}
	{
		Actor[Chest]:DoubleClick
		wait 5
	}
}
 
Last edited:
Top Bottom