public
Description: WoW Addon - Automatically restock items from vendors and your bank
Homepage: http://www.tekkub.net
Clone URL: git://github.com/tekkub/stealyourcarbon.git
Click here to lend your support to: stealyourcarbon and make a donation at www.pledgie.com !
Add automatic water upgrading
tekkub (author)
Sun Feb 17 19:57:16 -0800 2008
commit  a3a8c975a5824fbb41fdfadb6be4cacd1cd23f36
tree    dbd258c0f67a18798e10bb561e2d4b388c7b2e2b
parent  05f89f0ad36dc738a303820033a41f0cfad8d053
...
20
21
22
 
23
24
25
...
60
61
62
 
 
 
 
...
20
21
22
23
24
25
26
...
61
62
63
64
65
66
67
0
@@ -20,6 +20,7 @@ SlashCmdList.CARBON = function(input)
0
     ChatFrame1:AddMessage(" |cffff9933del|r: Remove an item from the restock list")
0
     ChatFrame1:AddMessage(" |cffff9933list|r: List current restock items")
0
     ChatFrame1:AddMessage(" |cffff9933overstock|r: Ensure that the quantity specified is always purchased for items offered in stacks from vendor")
0
+ ChatFrame1:AddMessage(" |cffff9933upgradewater|r: Automatically upgrade to better water as player levels")
0
     ChatFrame1:AddMessage(" |cffff9933chatter|r: Give chat feedback when purchasing items")
0
   end
0
 end
0
@@ -60,3 +61,7 @@ function StealYourCarbon:CMD_CHATTER()
0
 end
0
 
0
 
0
+function StealYourCarbon:CMD_UPGRADEWATER()
0
+ self.db.upgradewater = not self.db.upgradewater
0
+ self:Print("Auto-upgrading water", (self.db.upgradewater and "|cff00ff00enabled" or "|cffff0000disabled"))
0
+end
...
28
29
30
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31
32
33
...
51
52
53
 
 
54
55
56
...
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
...
73
74
75
76
77
78
79
80
0
@@ -28,6 +28,28 @@ function StealYourCarbon:Print(...) ChatFrame1:AddMessage(string.join(" ", "|cFF
0
 function StealYourCarbon:PrintF(fmsg, ...) ChatFrame1:AddMessage(string.format("|cFF33FF99Steal Your Carbon|r: "..fmsg, ...)) end
0
 
0
 
0
+local waterupgrades = {27860,28399,8766,1645,1708,1205,1179,159}
0
+function StealYourCarbon:UpgradeWater()
0
+ local level = UnitLevel("player")
0
+
0
+ local buy, found, oldid = 0
0
+ for _,id in pairs(waterupgrades) do
0
+ if found then
0
+ buy = buy + (self.db.stocklist[id] or 0)
0
+ if self.db.stocklist[id] then oldid = id end
0
+ self.db.stocklist[id] = nil
0
+ elseif level >= select(5, GetItemInfo(id)) then
0
+ found = id
0
+ end
0
+ end
0
+
0
+ if found and buy > 0 then
0
+ if self.db.chatter then self:PrintF("Upgrading %s to %s", select(2, GetItemInfo(oldid)), select(2, GetItemInfo(found))) end
0
+ self.db.stocklist[found] = buy
0
+ end
0
+end
0
+
0
+
0
 ----------------------
0
 -- Events --
0
 ----------------------
0
@@ -51,6 +73,8 @@ end
0
 
0
 
0
 function StealYourCarbon:MERCHANT_SHOW()
0
+ if self.db.upgradewater then self:UpgradeWater() end
0
+
0
   for i=1,GetMerchantNumItems() do
0
     local link = GetMerchantItemLink(i)
0
     local itemID = link and ids[link]

Comments

    No one has commented yet.