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