Created
January 12, 2010 18:10
-
-
Save Cellane/275419 to your computer and use it in GitHub Desktop.
Modified selljunk.lua to sell both junk and uncommon armor & weapons
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-------------------------------------------------------------------- | |
-- 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