classic has the item api retail uses, at least according to the code extract. Here's what I use in a retail weakaura to track and loot openable looted items:
Lua Code:
if event=="BAG_UPDATE_DELAYED" then
if not aura_env.combat and not InCombatLockdown() then
for b=BACKPACK_CONTAINER,NUM_BAG_SLOTS do
for s=1,GetContainerNumSlots(b) do
if GetContainerItemID(b,s)==45724 then
aura_env[(Item:CreateFromBagAndSlot(b,s):GetItemGUID())]=1
UseContainerItem(b,s)
end
end
end
end
elseif event=="LOOT_OPENED" then
for i=GetNumLootItems(),1,-1 do
if aura_env[(GetLootSourceInfo(i))] then
LootSlot(i)
end
end
end
The bag update event opens the specific openable I'm tracking while saving that bag's GUID, then the loot opened event checks the loot source and if it's a guid I saved, autoloot it all.