-------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------
-- Written by: Bounce a.k.a. Dreuger (Rexxar, US)
--Version: 2.0.1
--Version Notes:
-- +Basic Trash Selling Addon.
-- +Lets you know what Items Sold and if you had nothing to sell.
--Upcoming Additions:
-- +Profit display
-------------------------------------------------------------------------------------------------------------
--Used Variables: trash, bvBag, bvSlot, bvILink, bv
-------------------------------------------------------------------------------------------------------------
--Developed for educational purposes. Any similarities between this and
--any other original works by other authors are purely coincedential. All
--information used in the development of this addon is from WoWWiki and
--http://wowprogramming.com/
-------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------
local function bvSell()
local trash = 0
for bvBag=0,4 do
for bvSlot=0,GetContainerNumSlots(bvBag) do
local bvILink = GetContainerItemLink(bvBag, bvSlot)
if bvILink and select(3, GetItemInfo(bvILink)) == 0 then
ShowMerchantSellCursor(1)
UseContainerItem(bvBag, bvSlot)
ChatFrame1:AddMessage("[BounceVendor]:Item Sold: " .. GetItemInfo(bvILink) .. "!")
trash = trash +1
end
end
end
if trash == 0 then
ChatFrame1:AddMessage("[BounceVendor]:No Items to sell")
end
if CanMerchantRepair() then
if GetMoney() > GetRepairAllCost() then
local RepCost = GetRepairAllCost()
local GoldCost = 0
local SilverCost = 0
local CopperCost = 0
if RepCost <= 99 then
CopperCost = RepCost
elseif RepCost <= 9999 then
CopperCost = RepCost
SilverCost = RepCost / 100
elseif RepCost >= 10000 then
CopperCost = RepCost
SilverCost = RepCost / 100
Goldcost = RepCost / 10000
end
if RepCost == 0 then
ChatFrame1:AddMessage("[BounceVendor]: Nothing to Repair!")
else
ChatFrame1:AddMessage("[BounceVendor]:Repair Cost: " .. GoldCost .. " Gold, " .. SilverCost .. " Silver, " .. CopperCost .. " Copper" .. "!")
end
RepairAllItems()
end
end
end
local f = CreateFrame("Frame")
f:RegisterEvent("MERCHANT_SHOW")
f:SetScript("OnEvent", bvSell)
if MerchantFrame:IsVisible() then
bvSell()
end