Language:
Lua     Change language:
Pastebin: 33883
Author: Toraa
Subject: Re: automagic basePrice change
Created: 2007-05-18 05:36:01
Download and save
Toggle line numbers
1-- very slightly modified version of Bishop's excellent modifications 
2 
3-- min profit for bid 
4local bidMinProfitRel = 0.20 --Toraa custom setting 
5local bidMinProfitAbs = 5000 --Toraa custom setting 
6 
7-- min profit for buy 
8local buyMinProfitRel = 0.30 --Toraa custom setting 
9local buyMinProfitAbs = 5000 --Toraa custom setting 
10 
11-- Enchanting reagents 
12local VOID = 22450 
13local NEXUS = 20725 
14local LPRISMATIC = 22449 
15local LBRILLIANT = 14344 
16local LRADIANT = 11178 
17local LGLOWING = 11139 
18local LGLIMMERING = 11084 
19local SPRISMATIC = 22448 
20local SBRILLIANT = 14343 
21local SRADIANT = 11177 
22local SGLOWING = 11138 
23local SGLIMMERING = 10978 
24local GPLANAR = 22446 
25local GETERNAL = 16203 
26local GNETHER = 11175 
27local GMYSTIC = 11135 
28local GASTRAL = 11082 
29local GMAGIC = 10939 
30local LPLANAR = 22447 
31local LETERNAL = 16202 
32local LNETHER = 11174 
33local LMYSTIC = 11134 
34local LASTRAL = 10998 
35local LMAGIC = 10938 
36local ARCANE = 22445 
37local ILLUSION = 16204 
38local DREAM = 11176 
39local VISION = 11137 
40local SOUL = 11083 
41local STRANGE = 10940 
42 
43local priceUpperLimit = { 
44[22450] = 750000, -- Void Crystal 
45[20725] =  75000, -- Nexus Crystal 
46 
47[22449] = 180000, -- Large Prismatic Shard 
48[14344] =  85000, -- Large Brilliant Shard 
49[11178] =  75000, -- Large Radiant Shard 
50[11139] =  15000, -- Large Glowing Shard 
51[11084] =   5000, -- Large Glimmering Shard 
52 
53[22448] =  50000, -- Small Prismatic Shard 
54[14343] =  10000, -- Small Brilliant Shard 
55[11177] =  50000, -- Small Radiant Shard 
56[11138] =   3500, -- Small Glowing Shard 
57[10978] =   2500, -- Small Glimmering Shard 
58 
59[22446] =  52500, -- Greater Planar Essence 
60[16203] =  82500, -- Greater Eternal Essence 
61[11175] =  45000, -- Greater Nether Essence 
62[11135] =   6000, -- Greater Mystic Essence 
63[11082] =   4500, -- Greater Astral Essence 
64[10939] =   4500, -- Greater Magic Essence 
65 
66[22447] =  17500, -- Lesser Planar Essence 
67[16202] =  27500, -- Lesser Eternal Essence 
68[11174] =  15000, -- Lesser Nether Essence 
69[11134] =   2000, -- Lesser Mystic Essence 
70[10998] =   1500, -- Lesser Astral Essence 
71[10938] =   1500, -- Lesser Magic Essence 
72 
73[22445] =  18500, -- Arcane Dust 
74[16204] =  17500, -- Illusion Dust 
75[11176] =   5000, -- Dream Dust 
76[11137] =   1500, -- Vision Dust 
77[11083] =   1500, -- Soul Dust 
78[10940] =    750, -- Strange Dust 
79} 
80 
81-- A price adjustment to favour/disfavour particular reagents 
82-- depending on the market and how much of the reagent I have 
83-- already. Set manually, but I am working on automating this 
84 
85-- I bid/buy, DE, list, all in one swell foop. Prices M-T on mats 
86-- are lower on my server than they are F-S, hence the lazy way 
87-- of toggling between the two. - Toraa 
88-- local myDefaultPrice = 1      -- The weekend price. - Toraa 
89local myDefaultPrice = 0.85 -- The weekday price. - Toraa 
90local priceAdjustment = { 
91 [VOID]        = myDefaultPrice - 0.3
92 [NEXUS]       = myDefaultPrice - 0.3
93 
94 [LPRISMATIC]  = myDefaultPrice - 0.4
95 [LBRILLIANT]  = myDefaultPrice, 
96 [LRADIANT]    = myDefaultPrice, 
97 [LGLOWING]    = myDefaultPrice, 
98 [LGLIMMERING] = myDefaultPrice, 
99 
100 [SPRISMATIC]  = myDefaultPrice, 
101 [SBRILLIANT]  = myDefaultPrice, 
102 [SRADIANT]    = myDefaultPrice, 
103 [SGLOWING]    = myDefaultPrice, 
104 [SGLIMMERING] = myDefaultPrice, 
105 
106 [GPLANAR]     = myDefaultPrice, 
107 [GETERNAL]    = myDefaultPrice, 
108 [GNETHER]     = myDefaultPrice - 0.3
109 [GMYSTIC]     = myDefaultPrice - 0.2
110 [GASTRAL]     = myDefaultPrice, 
111 [GMAGIC]      = myDefaultPrice - 0.2
112 
113 [LPLANAR]     = myDefaultPrice, 
114 [LETERNAL]    = myDefaultPrice, 
115 [LNETHER]     = myDefaultPrice - 0.3
116 [LMYSTIC]     = myDefaultPrice, 
117 [LASTRAL]     = myDefaultPrice, 
118 [LMAGIC]      = myDefaultPrice - 0.2
119 
120 [ARCANE]      = myDefaultPrice + 0.1
121 [ILLUSION]    = myDefaultPrice + 0.1
122 [DREAM]       = myDefaultPrice - 0.2
123 [VISION]      = myDefaultPrice, 
124 [SOUL]        = myDefaultPrice, 
125 [STRANGE]     = myDefaultPrice - 0.2
126} 
127 
128-- item types 
129local WEAPON = 0 
130local ARMOR = 1 
131 
132-- item qualities 
133local UNCOMMON = 2 
134local RARE = 3 
135local EPIC = 4 
136 
137-- convert an item type string to an integer type 
138local typeStringToType = { 
139 ["Weapon"] = WEAPON, 
140 ["Armor"]  = ARMOR, 
141} 
142 
143-- disenchanting level bracket upper bounds, e.g. an ilevel 52 item 
144-- goes into bracket 55 
145local levelUpperBounds = { 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 85, 99, 120 } 
146 
147-- bad items that look like they should be disenchantable but aren't 
148local badItem = { 
149  [11287] = {}, -- Lesser Magic Wand     
150  [11288] = {}, -- Greater Magic Wand 
151  [11289] = {}, -- Lesser Mystic Wand 
152  [11290] = {}, -- Greater Mystic Wand 
153  [20406] = {}, -- Twilight Cultist Mantle 
154  [20407] = {}, -- Twilight Cultist Robe 
155  [20408] = {}, -- Twilight Cultist Cowl 
156} 
157 
158-- the big disenchant table, indexed by [quality][type][level bracket] 
159-- and yielding { { reagent type, drop probability, average drop quantity }, ... } 
160-- I would use Enchantrix, but it lacks data for new items 
161local disenchantTable = { 
162 [UNCOMMON] = { 
163  [WEAPON] = { 
164   [15]  = { { STRANGE , 0.20, 1.5 }, { LMAGIC  , 0.80, 1.5 }, }
165   [20]  = { { STRANGE , 0.20, 2.5 }, { GMAGIC  , 0.75, 1.5 }, { SGLIMMERING, 0.05, 1.0 }, }
166   [25]  = { { STRANGE , 0.15, 5.0 }, { GMAGIC  , 0.75, 1.5 }, { SGLIMMERING, 0.10, 1.0 }, }
167   [30]  = { { SOUL    , 0.20, 1.5 }, { GMAGIC  , 0.75, 1.5 }, { LGLIMMERING, 0.05, 1.0 }, }
168   [35]  = { { SOUL    , 0.20, 3.5 }, { LMYSTIC , 0.75, 1.5 }, { SGLOWING   , 0.05, 1.0 }, }
169   [40]  = { { VISION  , 0.20, 1.5 }, { GMYSTIC , 0.75, 1.5 }, { LGLOWING   , 0.05, 1.0 }, }
170   [45]  = { { VISION  , 0.15, 3.5 }, { LNETHER , 0.80, 1.5 }, { SRADIANT   , 0.05, 1.0 }, }
171   [50]  = { { DREAM   , 0.20, 1.5 }, { GNETHER , 0.75, 1.5 }, { LRADIANT   , 0.05, 1.0 }, }
172   [55]  = { { DREAM   , 0.20, 3.5 }, { LETERNAL, 0.75, 1.5 }, { SBRILLIANT , 0.05, 1.0 }, }
173   [60]  = { { ILLUSION, 0.20, 1.5 }, { GETERNAL, 0.75, 1.5 }, { LBRILLIANT , 0.05, 1.0 }, }
174   [65]  = { { ILLUSION, 0.20, 3.5 }, { GETERNAL, 0.75, 2.5 }, { LBRILLIANT , 0.05, 1.0 }, }
175   [85]  = { { ARCANE  , 0.20, 2.5 }, { LPLANAR , 0.75, 2.5 }, { SPRISMATIC , 0.05, 1.0 }, }
176   [99]  = { { ARCANE  , 0.20, 2.5 }, { LPLANAR , 0.75, 2.5 }, { SPRISMATIC , 0.05, 1.0 }, }
177   [120] = { { ARCANE  , 0.20, 3.5 }, { GPLANAR , 0.75, 1.5 }, { LPRISMATIC , 0.05, 1.0 }, }
178  }
179  [ARMOR] = { 
180   [15]  = { { STRANGE , 0.80, 1.5 }, { LMAGIC  , 0.20, 1.5 }, }
181   [20]  = { { STRANGE , 0.75, 2.5 }, { GMAGIC  , 0.20, 1.5 }, { SGLIMMERING, 0.05, 1.0 }, }
182   [25]  = { { STRANGE , 0.75, 5.0 }, { LASTRAL , 0.15, 1.5 }, { SGLIMMERING, 0.10, 1.0 }, }
183   [30]  = { { SOUL    , 0.75, 1.5 }, { GASTRAL , 0.20, 1.5 }, { LGLIMMERING, 0.05, 1.0 }, }
184   [35]  = { { SOUL    , 0.75, 3.5 }, { LMYSTIC , 0.20, 1.5 }, { SGLOWING   , 0.05, 1.0 }, }
185   [40]  = { { VISION  , 0.75, 1.5 }, { GMYSTIC , 0.20, 1.5 }, { LGLOWING   , 0.05, 1.0 }, }
186   [45]  = { { VISION  , 0.80, 3.5 }, { LNETHER , 0.15, 1.5 }, { SRADIANT   , 0.05, 1.0 }, }
187   [50]  = { { DREAM   , 0.75, 1.5 }, { GNETHER , 0.20, 1.5 }, { LRADIANT   , 0.05, 1.0 }, }
188   [55]  = { { DREAM   , 0.75, 3.5 }, { LETERNAL, 0.20, 1.5 }, { SBRILLIANT , 0.05, 1.0 }, }
189   [60]  = { { ILLUSION, 0.75, 1.5 }, { GETERNAL, 0.20, 1.5 }, { LBRILLIANT , 0.05, 1.0 }, }
190   [65]  = { { ILLUSION, 0.75, 3.5 }, { GETERNAL, 0.20, 2.5 }, { LBRILLIANT , 0.05, 1.0 }, }
191   [85]  = { { ARCANE  , 0.75, 2.5 }, { LPLANAR , 0.20, 2.5 }, { SPRISMATIC , 0.05, 1.0 }, }
192   [99]  = { { ARCANE  , 0.75, 2.5 }, { LPLANAR , 0.20, 2.5 }, { SPRISMATIC , 0.05, 1.0 }, }
193   [120] = { { ARCANE  , 0.75, 3.5 }, { GPLANAR , 0.20, 1.5 }, { LPRISMATIC , 0.05, 1.0 }, }
194  }
195 }
196 [RARE] = { 
197  [WEAPON] = { 
198   [20]  = { { SGLIMMERING, 1.00, 1.0 }, }, [25] = { { SGLIMMERING, 1.00, 1.0 }, }
199   [30]  = { { LGLIMMERING, 1.00, 1.0 }, }, [35] = { { SGLOWING   , 1.00, 1.0 }, }
200   [40]  = { { LGLOWING   , 1.00, 1.0 }, }, [45] = { { SRADIANT   , 1.00, 1.0 }, }
201   [50]  = { { LRADIANT   , 1.00, 1.0 }, }, [55] = { { SBRILLIANT , 1.00, 1.0 }, }
202   [60]  = { { LBRILLIANT , 0.99, 1.0 }, { NEXUS, 0.01, 1.0 }, }
203   [65]  = { { LBRILLIANT , 0.99, 1.0 }, { NEXUS, 0.01, 1.0 }, }
204   [85]  = { { SPRISMATIC , 0.99, 1.0 }, { NEXUS, 0.01, 1.0 }, }
205   [99]  = { { SPRISMATIC , 0.99, 1.0 }, { VOID , 0.01, 1.0 }, }
206   [120] = { { LPRISMATIC , 0.99, 1.0 }, { VOID , 0.01, 1.0 }, }
207  }
208  [ARMOR] = { 
209   [20]  = { { SGLIMMERING, 1.00, 1.0 }, }, [25] = { { SGLIMMERING, 1.00, 1.0 }, }
210   [30]  = { { LGLIMMERING, 1.00, 1.0 }, }, [35] = { { SGLOWING   , 1.00, 1.0 }, }
211   [40]  = { { LGLOWING   , 1.00, 1.0 }, }, [45] = { { SRADIANT   , 1.00, 1.0 }, }
212   [50]  = { { LRADIANT   , 1.00, 1.0 }, }, [55] = { { SBRILLIANT , 1.00, 1.0 }, }
213   [60]  = { { LBRILLIANT , 0.99, 1.0 }, { NEXUS, 0.01, 1.0 }, }
214   [65]  = { { LBRILLIANT , 0.99, 1.0 }, { NEXUS, 0.01, 1.0 }, }
215   [85]  = { { SPRISMATIC , 0.99, 1.0 }, { NEXUS, 0.01, 1.0 }, }
216   [99]  = { { SPRISMATIC , 0.99, 1.0 }, { VOID , 0.01, 1.0 }, }
217   [120] = { { LPRISMATIC , 0.99, 1.0 }, { VOID , 0.01, 1.0 }, }
218  }
219 }
220 [EPIC] = { 
221  [WEAPON] = { 
222   [45] = { { SRADIANT  , 1.00, 3.5 }, }, [50]  = { { LRADIANT  , 1.00, 3.5 }, }
223   [55] = { { SBRILLIANT, 1.00, 3.5 }, }, [60]  = { { NEXUS     , 1.00, 1.0 }, }
224   [65] = { { NEXUS     , 1.00, 1.0 }, }, [85]  = { { NEXUS     , 1.00, 1.0 }, }
225   [99] = { { VOID      , 1.00, 1.0 }, }, [120] = { { VOID      , 1.00, 1.5 }, }
226  }
227  [ARMOR] = { 
228   [45] = { { SRADIANT  , 1.00, 3.5 }, }, [50]  = { { LRADIANT  , 1.00, 3.5 }, }
229   [55] = { { SBRILLIANT, 1.00, 3.5 }, }, [60]  = { { NEXUS     , 1.00, 1.0 }, }
230   [65] = { { NEXUS     , 1.00, 1.0 }, }, [85]  = { { NEXUS     , 1.00, 1.0 }, }
231   [99] = { { VOID      , 1.00, 1.0 }, }, [120] = { { VOID      , 1.00, 1.5 }, }
232  }
233 }
234} 
235 
236---------------------------------------- 
237 
238local watchList = { 
239  -- 10-19 weapons 
240  [1935]  = 1500000, -- Assassin's Blade 
241  [1482]  = 1300000, -- Shadowfang 
242  [890]   =  360000, -- Twisted Chanter's Staff 
243  [2567]  =  350000, -- Evocator's Blade 
244  [1318]  =  340000, -- Night Reaver 
245  [1484]  =  300000, -- Witching Stave 
246 
247  -- 10-19 armor 
248  [2059]  =  510000, -- Sentry Cloak 
249  [8350]  =  490000, -- The 1 Ring 
250  [1486]  =  490000, -- Tree Bark Jacket 
251  [1121]  =  400000, -- Feet of the Lynx 
252  [12977] =  300000, -- Magefist Gloves 
253 
254  -- 20-29 weapons 
255  [776]   =  920000, -- Vendetta 
256  [4454]  =  490000, -- Talon of Vultros 
257  [8226]  =  450000, -- The Butcher 
258  [4446]  =  410000, -- Blackvenom Blade 
259  [13033] =  400000, -- Zealot Blade 
260  [3413]  =  390000, -- Doomspike 
261  [7730]  =  300000, -- Cobalt Crusher 
262 
263  -- 20-29 armor 
264  [9491]  =  630000, -- Hotshot Pilot's Gloves 
265  [2264]  =  780000, -- Mantle of Thieves 
266  [1978]  =  530000, -- Wolfclaw Gloves 
267  [2039]  =  500000, -- Plains Ring 
268  [9510]  =  410000, -- Caverndeep Trudgers 
269  [13108] =  400000, -- Tigerstrike Mantle 
270  [2278]  =  390000, -- Forest Tracker Epaulets 
271  [2292]  =  390000, -- Necrology Robes 
272  [9509]  =  370000, -- Petrolspill Leggings 
273  [1491]  =  360000, -- Ring of Precision 
274  [7728]  =  320000, -- Beguiler Robes 
275  [12998] =  300000, -- Magician's Mantle 
276 
277  -- 30-39 weapons 
278  [873]   = 2300000, -- Staff of Jordan 
279  [2825]  = 1200000, -- Bow of Searing Arrows 
280  [870]   = 1200000, -- Fiery War Axe 
281  [9425]  = 1100000, -- Pendulum of Doom 
282  [869]   = 1000000, -- Dazzling Longsword 
283  [1982]  = 1000000, -- Nightblade 
284  [9424]  =  580000, -- Ginn-su Sword 
285  [868]   =  550000, -- Ardent Custodian 
286  [9426]  =  430000, -- Monolithic Bow 
287  [9718]  =  410000, -- Reforged Blade of Heroes 
288  [8223]  =  390000, -- Blade of the Basilisk 
289  [13034] =  380000, -- Speedsteel Rapier 
290  [9384]  =  380000, -- Stonevault Shiv 
291  [9392]  =  330000, -- Annealed Blade 
292  [10570] =  320000, -- Manslayer 
293  [6327]  =  320000, -- The Pacifier 
294  [13064] =  300000, -- Jaina's Firestarter 
295  [5756]  =  300000, -- Sliverblade 
296 
297  -- 30-39 armor 
298  [10583] = 1500000, -- Quillward Harness 
299  [2955]  = 1400000, -- First Mate Hat 
300  [867]   = 1100000, -- Gloves of Holy Might 
301  [9429]  = 1100000, -- Miner's Hat of the Deep 
302  [1981]  =  930000, -- Icemail Jerkin 
303  [7755]  =  740000, -- Flintrock Shoulders 
304  [10574] =  660000, -- Corpseshroud 
305  [5257]  =  540000, -- Dark Hooded Cape 
306  [9420]  =  510000, -- Adventurer's Pith Helmet 
307  [10328] =  500000, -- Scarlet Chestpiece 
308  [1204]  =  490000, -- The Green Tower 
309  [9431]  =  410000, -- Papal Fez 
310  [1980]  =  400000, -- Underworld Band 
311  [9396]  =  370000, -- Legguards of the Vault 
312  [10332] =  370000, -- Scarlet Boots 
313  [13110] =  360000, -- Wolffear Harness 
314  [1718]  =  350000, -- Basilisk Hide Pants 
315  [2277]  =  350000, -- Necromancer Leggings 
316  [2951]  =  350000, -- Ring of the Underwood 
317  [9375]  =  320000, -- Expert Goldminer's Helmet 
318  [10581] =  310000, -- Death's Head Vestment 
319  [13117] =  300000, -- Ogron's Sash 
320  [13084] =  300000, -- Kaleidoscope Chain 
321--custom wathc 
322  [942]   =  850000, -- Freezing Band 
323} 
324 
325---------------------------------------- 
326 
327-- calculate value of a stack of reagents based on 
328-- auctioneer data and price tables above 
329local getReagentValue = function(itemID, itemCount) 
330  local upperLimit = priceUpperLimit[itemID] 
331  local adjust = priceAdjustment[itemID] or 1 
332 
333  if not upperLimit then return nil end 
334 
335  local median, snapshot, snapshotCount = nil, nil, nil 
336  local _, link = GetItemInfo(itemID) 
337  if link then 
338    local key = Auctioneer.ItemDB.CreateItemKeyFromLink(link) 
339    if key then 
340      median = Auctioneer.Statistic.GetItemHistoricalMedianBuyout(key) 
341      snapshot, snapshotCount = Auctioneer.Statistic.GetItemSnapshotMedianBuyout(key) 
342    end 
343  end 
344 
345  median = median or upperLimit 
346  snapshot = snapshot or upperLimit 
347  snapshotCount = snapshotCount or 1 
348 
349  median = math.min(median, upperLimit) 
350  snapshot = math.min(snapshot, upperLimit) 
351 
352  local snapshotWeight = 0 
353  if snapshotCount >= 5 and snapshot < median then 
354    snapshotWeight = math.log10(snapshotCount) / math.log10(20
355  end 
356  snapshotWeight = math.min(math.max(snapshotWeight, 0), 1
357  local medianWeight = 1 - snapshotWeight 
358 
359  local combined = median * medianWeight + snapshot * snapshotWeight 
360  return combined * adjust * itemCount 
361end 
362 
363-- take an ilevel and round it up to the corresponding bracket 
364local roundupLevel = function(level) 
365  for _, bracket in pairs(levelUpperBounds) do 
366    if bracket >= level then 
367      return bracket 
368    end 
369  end 
370  return nil 
371end 
372 
373-- get entry from disenchant table (or nil if nothing found) 
374local getDisenchants = function(quality, type, level) 
375  if disenchantTable[quality] and disenchantTable[quality][type] and 
376 
377disenchantTable[quality][type][level] then 
378    return disenchantTable[quality][type][level] 
379  end 
380  return nil 
381end 
382 
383-- calculate disenchant value of item based on disenchant table and 
384-- calculated reagent values 
385local getDisenchantValue = function(itemID) 
386  local result = nil 
387  local _, _, quality, level, _, typeString, _, _, _, _ = GetItemInfo(itemID) 
388  if quality >= UNCOMMON and quality <= EPIC and not badItem[itemID] then 
389    local type = typeStringToType[typeString] 
390    if type then 
391      level = roundupLevel(level) 
392      if level then 
393        local disenchants = getDisenchants(quality, type, level) 
394        if disenchants then 
395          result = 0 
396          for _, stats in pairs(disenchants) do 
397            local reagent, chance, count = stats[1], stats[2], stats[3
398            result = result + getReagentValue(reagent, chance * count) 
399          end 
400        end 
401      end 
402    end 
403  end 
404  return result 
405end 
406 
407-------------------------------------------------------------------------------- 
408-- now decide what to do with the auction 
409 
410-- mark down unknown rares by this much 
411local blueAdjust = 0.5 -- Toraa custom setting 
412 
413-- if buyout is close enough to low enough bid, just buy it anyway 
414local buyMaxBidNear = 0.01 
415 
416-- adjust low bids upwards, but no closer to maximum bid than this 
417local bidLess = 0.20 
418 
419-- assume item is worthless until proven otherwise 
420local myBasePrice = 0 
421 
422-- prevent equipable greens from showing up for resale 
423local _,_, quality, _, _, class, _,_,_ = GetItemInfo(itemID) 
424if (quality==2 and (class =="Weapon" or class == "Armor")) 
425 then 
426  myBasePrice = (basePrice * 0.25)  --Toraa custom setting 
427  BasePrice = myBasePrice           --Toraa custom setting 
428end 
429 
430-- calculate disenchant value or reagent value depending on the type of item 
431local disenchantValue = getDisenchantValue(itemID) 
432if disenchantValue then 
433  myBasePrice = disenchantValue 
434  reason = "Disenchant" 
435  depositCost = 0 
436  depositRate = 0 
437else 
438  local reagentValue = getReagentValue(itemID, itemCount) 
439  if reagentValue then 
440    myBasePrice = reagentValue 
441    reason = "Reagent" 
442    depositCost = 0 
443    depositRate = 0 
444        -- force auctioneer to use this value in case it wants to resale 
445    basePrice = reagentValue 
446  end 
447end 
448 
449-- account for AH cut 
450local resaleValue = myBasePrice * 0.95 
451 
452-- decide whether or not to buy 
453 
454local buyMaxRel = resaleValue * (1 - buyMinProfitRel) 
455local buyMaxAbs = resaleValue - buyMinProfitAbs 
456local bidMaxRel = resaleValue * (1 - bidMinProfitRel) 
457local bidMaxAbs = resaleValue - bidMinProfitAbs 
458 
459if watchList[itemID] then 
460  myBasePrice = watchList[itemID] * 0.85 --Toraa custom setting 
461  local bidMax = myBasePrice * 0.85 
462  if buyPrice ~= 0 and buyPrice <= bidMax then 
463    action = "buy" 
464    reason = "Watch List" 
465    basePrice = watchList[itemID] 
466  elseif bidPrice ~= 0 and bidPrice <= bidMax then 
467    action = "bid" 
468    reason = "Watch List" 
469    basePrice = watchList[itemID] 
470  end 
471else 
472  -- mark down blues 
473  local _,_, quality, _, _, class, _,_,_ = GetItemInfo(itemID) 
474  if quality == RARE and (class == "Weapon" or class == "Armor") then 
475    basePrice = basePrice * blueAdjust 
476  end 
477  if buyPrice ~= 0 and buyPrice <= buyMaxRel and buyPrice <= buyMaxAbs then 
478    action = "buy" 
479    reason = reason .. " (buy)" 
480    basePrice = resaleValue 
481  elseif bidPrice ~= 0 and bidPrice <= bidMaxRel and bidPrice <= bidMaxAbs then 
482    if buyPrice ~= 0 and bidPrice >= buyPrice * (1 - buyMaxBidNear) then 
483      action = "buy" 
484      reason = reason .. " (buy near bid)" 
485      basePrice = resaleValue 
486    else 
487      action = "bid" 
488      reason = reason .. " (bid, orig = " .. bidPrice .. ")" 
489      local bidRelUp = (resaleValue * (1 - bidMinProfitRel)) * (1 - bidLess) 
490      local bidAbsUp = (resaleValue - bidMinProfitAbs) * (1 - bidLess) 
491      bidPrice = math.max(bidPrice, math.min(bidRelUp, bidAbsUp)) 
492      basePrice = resaleValue 
493    end 
494  end 
495end 
496 
497-- extra rule to grab all large prismatic DE's up for 10g or less 
498local _,_, quality, level, _, class, _,_,_ = GetItemInfo(itemID) 
499if (quality >= RARE and (class =="Weapon" or class == "Armor") and level >= 100) then 
500 if buyPrice <= 100000 then 
501  action = "buy" 
502  reason = "Cheap Prismatic" 
503  basePrice = priceUpperLimit[LPRISMATIC] 
504 elseif bidPrice <= 100000 then 
505  action = "bid" 
506  reason = "Cheap Prismatic" 
507  basePrice = priceUpperLimit[LPRISMATIC] 
508 end 
509end 
510 
511if (action ~= "bid" and action ~= "buy") then  --Toraa 
512  basePrice = basePrice * 0.85                 --Toraa 
513end                                            --Toraa 
Download and save
Toggle line numbers
Thread:
[33883] Re: automagic basePrice change by Toraa at 2007-05-18 05:36:01
Tip: Click the line numbers to toggle highliting on that line.

Paste followup:

Language:
Author:
Subject:


    Tabstop:     bigger biggest
Note: You can prefix a line with "@@@" to highlight it.