Loot quest items/money addon, help updating

Hi, I recently returned to WoW and started leveling and noticed one of addons isn’t working. It’s just a small addon that automatically loots money/currency and quest items. I managed to get the money part working but not quest items, haven’t tested currency. I’m sure it’s just a simple function/string name change. Any help appreciated.

local f = CreateFrame(“Frame”)
f:RegisterEvent(“LOOT_OPENED”)
f:SetScript(“OnEvent”, function(self, event, …)
for i = GetNumLootItems(), 1, -1 do
local slotType = GetLootSlotType(i)
local _, _, _, _, locked, isQuestItem = GetLootSlotType(i)
if not locked and (isQuestItem or slotType == LOOT_SLOT_MONEY or slotType == LOOT_SLOT_CURRENCY) then
LootSlot(i)
end
end
end)

Untested:

local f = CreateFrame("Frame")
f:RegisterEvent("LOOT_OPENED")
f:SetScript("OnEvent", function(self, event, ...)
	for i = GetNumLootItems(), 1, -1 do
		local slotType = GetLootSlotType(i)
		local _, _, _, _, _, locked, isQuestItem = GetLootSlotInfo(i)
		if not locked and (isQuestItem or slotType == LOOT_SLOT_MONEY or slotType == LOOT_SLOT_CURRENCY) then
			LootSlot(i)
		end
	end
end)

Bump

I tried looking through the 9.0 api changes, couldn’t find anything. It’s got to be a simple fix but I don’t see it.

Did you try Fizzle’s code? Do you have a Lua error to share?
/console scriptErrors 1

1 Like

There’s an error, but I didn’t see it yesterday because my BugSack is being weird and not showing it in the main UI but only on the minimap icon. Dunno why.

Here’s the error: "Unexpected symbol near ‘[]’"x4
Forums not letting me include an imgur link. But that’s what it says.

Stupid forums. I reformatted the code in my original post to get rid of the “smart” formatting. Try it again.

4x Loot\core.lua:10: ‘end’ expected (to close ‘function’ at line 3) near ‘’

Is what I’m getting now, sorry.

Now it’s just being nasty and stole my end bracket lol. Should be good now.

1 Like

Bug free, all working now.

Thanks Fizzle.

1 Like