Files
wow-weakauras/Complete Projects/BFA/Anna Trade.lua

22 lines
494 B
Lua

--TRADE_SHOW
function()
if UnitName("target") == "Melna" then
local items = 0
for i = 0, 4 do
for j = 1, GetContainerNumSlots(i) do
local link = select(7, GetContainerItemInfo(i, j))
if link then
local type = select(7, GetItemInfo(link))
if (type == "Cooking" or type == "Cloth") and items < 6 then
UseContainerItem(i, j)
items = items + 1
elseif items >= 6 then
AcceptTrade()
return
end
end
end
end
AcceptTrade()
end
end