Skip to content

Instantly share code, notes, and snippets.

@Cellane
Created January 12, 2010 18:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Cellane/275419 to your computer and use it in GitHub Desktop.
Save Cellane/275419 to your computer and use it in GitHub Desktop.
Modified selljunk.lua to sell both junk and uncommon armor & weapons
--------------------------------------------------------------------
-- CREDIT : FatalEntity
--------------------------------------------------------------------
local AddOn = CreateFrame("Frame")
local OnEvent = function(self, event, ...) self[event](self, event, ...) end
AddOn:SetScript("OnEvent", OnEvent)
------------------------------------------------------------------------
-- Auto SELL JUNK
------------------------------------------------------------------------
local function MERCHANT_SHOW(...)
for bagIndex = 0, 4 do
if GetContainerNumSlots(bagIndex) > 0 then
for slotIndex = 1, GetContainerNumSlots(bagIndex) do
if select(2,GetContainerItemInfo(bagIndex, slotIndex)) then
local quality = select(3, string.find(GetContainerItemLink(bagIndex, slotIndex), "(|c%x+)"))
if quality == ITEM_QUALITY_COLORS[0].hex then
UseContainerItem(bagIndex, slotIndex)
end
--[[
For Mr. Mozzin
No idea if it works
Because I can't be arsed with testing
-- Miloso
]]--
if quality == ITEM_QUALITY_COLORS[2].hex then
local itemLink = GetContainerItemLink(bagIndex, slowIntex)
local _, _, _, _, _, itemType = GetItemInfo(itemLink)
if itemType == "Armor" or itemType == "Weapon" then
UseContainterItem(bagIndex, slotIndex)
end
end
end
end
end
end
end
AddOn:RegisterEvent("MERCHANT_SHOW")
AddOn["MERCHANT_SHOW"] = MERCHANT_SHOW
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment