tekkub (owner)

Revisions

gist: 44115 Download_button fork
public
Public Clone URL: git://gist.github.com/44115.git
Embed All Files: show embed
mine.lua #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
local function OnEvent()
for bag=0,4 do
for slot=0,GetContainerNumSlots(bag) do
local link = GetContainerItemLink(bag, slot)
if link and select(3, GetItemInfo(link)) == 0 then
ShowMerchantSellCursor(1)
UseContainerItem(bag, slot)
end
end
end
end
 
local f = CreateFrame("Frame")
f:RegisterEvent("MERCHANT_SHOW")
f:SetScript("OnEvent", OnEvent)
 
if MerchantFrame:IsVisible() then OnEvent() end
 
 
 
theirs.lua #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
-------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------
-- 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