Thread: Sell gray items
View Single Post
09-19-14, 04:56 PM   #3
Nimhfree
A Frostmaul Preserver
AddOn Author - Click to view addons
Join Date: Aug 2006
Posts: 267
I use:

Code:
--	Create a simple frame that allows grey quality items to be sold automatically
local sellFrame = CreateFrame("Frame")
sellFrame:SetScript("OnEvent", function()
		for bag = 0, 4 do
			for slot = 1, GetContainerNumSlots(bag) do
				local _, _, locked, _, _, _, link = GetContainerItemInfo(bag, slot)	-- will return -1 for quality a lot
				if nil ~= link then
					local _, _, realQuality, _, _, _, _, _, _, _, vendorPrice = GetItemInfo(link)
					if 0 == realQuality and 0 ~= vendorPrice and not locked then
						UseContainerItem(bag, slot)
					end
				end
			end
		end
	end)
sellFrame:RegisterEvent("MERCHANT_SHOW")
  Reply With Quote