Not signed in (Sign In)
    •  
      CommentAuthorDeckard
    • CommentTimeApr 28th 2007 edited
     
    This thread is now outdated, as the new versions of BottomScanner included with Auctioneer Classic and AucAdvanced no longer use BaseRules, they use Evaluators. Some of the code contained in this thread may be useful in creating Evaluators, so I will leave it stickied here for the time being.

    I'm starting a new thread, the old one has gotten very long and unwieldy to use. You can still access it here.

    I've posted Chardonnay's BaseRule here from the previous thread so he can continue to edit and modify it for the rest of us.

    From Chardonnay:

    Here's my disenchant baserule, not my latest version but you may find some useful stuff in here.

    Edit: added data from Onyx and Bishop for ilevel 100+ items. Thanks folks!
    Edit 2007-04-26: pasted in my current version. Includes some extra stuff for picking up twink items with prices from WoWHead (1500g so far :). Few extra comments, take it or leave it. :P

    -- Enchanting reagents
    local VOID = 22450
    local NEXUS = 20725
    local LPRISMATIC = 22449
    local LBRILLIANT = 14344
    local LRADIANT = 11178
    local LGLOWING = 11139
    local LGLIMMERING = 11084
    local SPRISMATIC = 22448
    local SBRILLIANT = 14343
    local SRADIANT = 11177
    local SGLOWING = 11138
    local SGLIMMERING = 10978
    local GPLANAR = 22446
    local GETERNAL = 16203
    local GNETHER = 11175
    local GMYSTIC = 11135
    local GASTRAL = 11082
    local GMAGIC = 10939
    local LPLANAR = 22447
    local LETERNAL = 16202
    local LNETHER = 11174
    local LMYSTIC = 11134
    local LASTRAL = 10998
    local LMAGIC = 10938
    local ARCANE = 22445
    local ILLUSION = 16204
    local DREAM = 11176
    local VISION = 11137
    local SOUL = 11083
    local STRANGE = 10940

    local priceUpperLimit = {
    [22450] = 750000, -- Void Crystal
    [20725] = 75000, -- Nexus Crystal

    [22449] = 180000, -- Large Prismatic Shard
    [14344] = 85000, -- Large Brilliant Shard
    [11178] = 75000, -- Large Radiant Shard
    [11139] = 15000, -- Large Glowing Shard
    [11084] = 5000, -- Large Glimmering Shard

    [22448] = 50000, -- Small Prismatic Shard
    [14343] = 10000, -- Small Brilliant Shard
    [11177] = 50000, -- Small Radiant Shard
    [11138] = 3500, -- Small Glowing Shard
    [10978] = 2500, -- Small Glimmering Shard

    [22446] = 52500, -- Greater Planar Essence
    [16203] = 82500, -- Greater Eternal Essence
    [11175] = 45000, -- Greater Nether Essence
    [11135] = 6000, -- Greater Mystic Essence
    [11082] = 4500, -- Greater Astral Essence
    [10939] = 4500, -- Greater Magic Essence

    [22447] = 17500, -- Lesser Planar Essence
    [16202] = 27500, -- Lesser Eternal Essence
    [11174] = 15000, -- Lesser Nether Essence
    [11134] = 2000, -- Lesser Mystic Essence
    [10998] = 1500, -- Lesser Astral Essence
    [10938] = 1500, -- Lesser Magic Essence

    [22445] = 18500, -- Arcane Dust
    [16204] = 17500, -- Illusion Dust
    [11176] = 5000, -- Dream Dust
    [11137] = 1500, -- Vision Dust
    [11083] = 1500, -- Soul Dust
    [10940] = 750, -- Strange Dust
    }

    -- A price adjustment to favour/disfavour particular reagents
    -- depending on the market and how much of the reagent I have
    -- already. Set manually, but I am working on automating this
    local priceAdjustment = {
    [VOID] = 0.5,
    [NEXUS] = 0.5,

    [LPRISMATIC] = 1,
    [LBRILLIANT] = 1,
    [LRADIANT] = 1,
    [LGLOWING] = 1,
    [LGLIMMERING] = 1,

    [SPRISMATIC] = 1,
    [SBRILLIANT] = 1,
    [SRADIANT] = 1,
    [SGLOWING] = 1,
    [SGLIMMERING] = 1,

    [GPLANAR] = 1,
    [GETERNAL] = 1,
    [GNETHER] = 1,
    [GMYSTIC] = 1,
    [GASTRAL] = 1,
    [GMAGIC] = 1,

    [LPLANAR] = 1,
    [LETERNAL] = 1,
    [LNETHER] = 1,
    [LMYSTIC] = 1,
    [LASTRAL] = 1,
    [LMAGIC] = 1,

    [ARCANE] = 1,
    [ILLUSION] = 1,
    [DREAM] = 1,
    [VISION] = 1,
    [SOUL] = 1,
    [STRANGE] = 1,
    }

    -- item types
    local WEAPON = 0
    local ARMOR = 1

    -- item qualities
    local UNCOMMON = 2
    local RARE = 3
    local EPIC = 4

    -- convert an item type string to an integer type
    local typeStringToType = {
    ["Weapon"] = WEAPON,
    ["Armor"] = ARMOR,
    }

    -- disenchanting level bracket upper bounds, e.g. an ilevel 52 item
    -- goes into bracket 55
    local levelUpperBounds = { 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 85, 99, 120 }

    -- bad items that look like they should be disenchantable but aren't
    local badItem = {
    [11287] = {}, -- Lesser Magic Wand
    [11288] = {}, -- Greater Magic Wand
    [11289] = {}, -- Lesser Mystic Wand
    [11290] = {}, -- Greater Mystic Wand
    [20406] = {}, -- Twilight Cultist Mantle
    [20407] = {}, -- Twilight Cultist Robe
    [20408] = {}, -- Twilight Cultist Cowl
    }

    -- the big disenchant table, indexed by [quality][type][level bracket]
    -- and yielding { { reagent type, drop probability, average drop quantity }, ... }
    -- I would use Enchantrix, but it lacks data for new items
    local disenchantTable = {
    [UNCOMMON] = {
    [WEAPON] = {
    [15] = { { STRANGE , 0.20, 1.5 }, { LMAGIC , 0.80, 1.5 }, },
    [20] = { { STRANGE , 0.20, 2.5 }, { GMAGIC , 0.75, 1.5 }, { SGLIMMERING, 0.05, 1.0 }, },
    [25] = { { STRANGE , 0.15, 5.0 }, { GMAGIC , 0.75, 1.5 }, { SGLIMMERING, 0.10, 1.0 }, },
    [30] = { { SOUL , 0.20, 1.5 }, { GMAGIC , 0.75, 1.5 }, { LGLIMMERING, 0.05, 1.0 }, },
    [35] = { { SOUL , 0.20, 3.5 }, { LMYSTIC , 0.75, 1.5 }, { SGLOWING , 0.05, 1.0 }, },
    [40] = { { VISION , 0.20, 1.5 }, { GMYSTIC , 0.75, 1.5 }, { LGLOWING , 0.05, 1.0 }, },
    [45] = { { VISION , 0.15, 3.5 }, { LNETHER , 0.80, 1.5 }, { SRADIANT , 0.05, 1.0 }, },
    [50] = { { DREAM , 0.20, 1.5 }, { GNETHER , 0.75, 1.5 }, { LRADIANT , 0.05, 1.0 }, },
    [55] = { { DREAM , 0.20, 3.5 }, { LETERNAL, 0.75, 1.5 }, { SBRILLIANT , 0.05, 1.0 }, },
    [60] = { { ILLUSION, 0.20, 1.5 }, { GETERNAL, 0.75, 1.5 }, { LBRILLIANT , 0.05, 1.0 }, },
    [65] = { { ILLUSION, 0.20, 3.5 }, { GETERNAL, 0.75, 2.5 }, { LBRILLIANT , 0.05, 1.0 }, },
    [85] = { { ARCANE , 0.20, 2.5 }, { LPLANAR , 0.75, 2.5 }, { SPRISMATIC , 0.05, 1.0 }, },
    [99] = { { ARCANE , 0.20, 2.5 }, { LPLANAR , 0.75, 2.5 }, { SPRISMATIC , 0.05, 1.0 }, },
    [120] = { { ARCANE , 0.20, 3.5 }, { GPLANAR , 0.75, 1.5 }, { LPRISMATIC , 0.05, 1.0 }, },
    },
    [ARMOR] = {
    [15] = { { STRANGE , 0.80, 1.5 }, { LMAGIC , 0.20, 1.5 }, },
    [20] = { { STRANGE , 0.75, 2.5 }, { GMAGIC , 0.20, 1.5 }, { SGLIMMERING, 0.05, 1.0 }, },
    [25] = { { STRANGE , 0.75, 5.0 }, { LASTRAL , 0.15, 1.5 }, { SGLIMMERING, 0.10, 1.0 }, },
    [30] = { { SOUL , 0.75, 1.5 }, { GASTRAL , 0.20, 1.5 }, { LGLIMMERING, 0.05, 1.0 }, },
    [35] = { { SOUL , 0.75, 3.5 }, { LMYSTIC , 0.20, 1.5 }, { SGLOWING , 0.05, 1.0 }, },
    [40] = { { VISION , 0.75, 1.5 }, { GMYSTIC , 0.20, 1.5 }, { LGLOWING , 0.05, 1.0 }, },
    [45] = { { VISION , 0.80, 3.5 }, { LNETHER , 0.15, 1.5 }, { SRADIANT , 0.05, 1.0 }, },
    [50] = { { DREAM , 0.75, 1.5 }, { GNETHER , 0.20, 1.5 }, { LRADIANT , 0.05, 1.0 }, },
    [55] = { { DREAM , 0.75, 3.5 }, { LETERNAL, 0.20, 1.5 }, { SBRILLIANT , 0.05, 1.0 }, },
    [60] = { { ILLUSION, 0.75, 1.5 }, { GETERNAL, 0.20, 1.5 }, { LBRILLIANT , 0.05, 1.0 }, },
    [65] = { { ILLUSION, 0.75, 3.5 }, { GETERNAL, 0.20, 2.5 }, { LBRILLIANT , 0.05, 1.0 }, },
    [85] = { { ARCANE , 0.75, 2.5 }, { LPLANAR , 0.20, 2.5 }, { SPRISMATIC , 0.05, 1.0 }, },
    [99] = { { ARCANE , 0.75, 2.5 }, { LPLANAR , 0.20, 2.5 }, { SPRISMATIC , 0.05, 1.0 }, },
    [120] = { { ARCANE , 0.75, 3.5 }, { GPLANAR , 0.20, 1.5 }, { LPRISMATIC , 0.05, 1.0 }, },
    },
    },
    [RARE] = {
    [WEAPON] = {
    [20] = { { SGLIMMERING, 1.00, 1.0 }, }, [25] = { { SGLIMMERING, 1.00, 1.0 }, },
    [30] = { { LGLIMMERING, 1.00, 1.0 }, }, [35] = { { SGLOWING , 1.00, 1.0 }, },
    [40] = { { LGLOWING , 1.00, 1.0 }, }, [45] = { { SRADIANT , 1.00, 1.0 }, },
    [50] = { { LRADIANT , 1.00, 1.0 }, }, [55] = { { SBRILLIANT , 1.00, 1.0 }, },
    [60] = { { LBRILLIANT , 0.99, 1.0 }, { NEXUS, 0.01, 1.0 }, },
    [65] = { { LBRILLIANT , 0.99, 1.0 }, { NEXUS, 0.01, 1.0 }, },
    [85] = { { SPRISMATIC , 0.99, 1.0 }, { NEXUS, 0.01, 1.0 }, },
    [99] = { { SPRISMATIC , 0.99, 1.0 }, { VOID , 0.01, 1.0 }, },
    [120] = { { LPRISMATIC , 0.99, 1.0 }, { VOID , 0.01, 1.0 }, },
    },
    [ARMOR] = {
    [20] = { { SGLIMMERING, 1.00, 1.0 }, }, [25] = { { SGLIMMERING, 1.00, 1.0 }, },
    [30] = { { LGLIMMERING, 1.00, 1.0 }, }, [35] = { { SGLOWING , 1.00, 1.0 }, },
    [40] = { { LGLOWING , 1.00, 1.0 }, }, [45] = { { SRADIANT , 1.00, 1.0 }, },
    [50] = { { LRADIANT , 1.00, 1.0 }, }, [55] = { { SBRILLIANT , 1.00, 1.0 }, },
    [60] = { { LBRILLIANT , 0.99, 1.0 }, { NEXUS, 0.01, 1.0 }, },
    [65] = { { LBRILLIANT , 0.99, 1.0 }, { NEXUS, 0.01, 1.0 }, },
    [85] = { { SPRISMATIC , 0.99, 1.0 }, { NEXUS, 0.01, 1.0 }, },
    [99] = { { SPRISMATIC , 0.99, 1.0 }, { VOID , 0.01, 1.0 }, },
    [120] = { { LPRISMATIC , 0.99, 1.0 }, { VOID , 0.01, 1.0 }, },
    },
    },
    [EPIC] = {
    [WEAPON] = {
    [45] = { { SRADIANT , 1.00, 3.5 }, }, [50] = { { LRADIANT , 1.00, 3.5 }, },
    [55] = { { SBRILLIANT, 1.00, 3.5 }, }, [60] = { { NEXUS , 1.00, 1.0 }, },
    [65] = { { NEXUS , 1.00, 1.0 }, }, [85] = { { NEXUS , 1.00, 1.0 }, },
    [99] = { { VOID , 1.00, 1.0 }, }, [120] = { { VOID , 1.00, 1.5 }, },
    },
    [ARMOR] = {
    [45] = { { SRADIANT , 1.00, 3.5 }, }, [50] = { { LRADIANT , 1.00, 3.5 }, },
    [55] = { { SBRILLIANT, 1.00, 3.5 }, }, [60] = { { NEXUS , 1.00, 1.0 }, },
    [65] = { { NEXUS , 1.00, 1.0 }, }, [85] = { { NEXUS , 1.00, 1.0 }, },
    [99] = { { VOID , 1.00, 1.0 }, }, [120] = { { VOID , 1.00, 1.5 }, },
    },
    },
    }

    ----------------------------------------

    local watchList = {
    -- 10-19 weapons
    [1935] = 1500000, -- Assassin's Blade
    [1482] = 1300000, -- Shadowfang
    [890] = 360000, -- Twisted Chanter's Staff
    [2567] = 350000, -- Evocator's Blade
    [1318] = 340000, -- Night Reaver
    [1484] = 300000, -- Witching Stave

    -- 10-19 armor
    [2059] = 510000, -- Sentry Cloak
    [8350] = 490000, -- The 1 Ring
    [1486] = 490000, -- Tree Bark Jacket
    [1121] = 400000, -- Feet of the Lynx
    [12977] = 300000, -- Magefist Gloves

    -- 20-29 weapons
    [776] = 920000, -- Vendetta
    [4454] = 490000, -- Talon of Vultros
    [8226] = 450000, -- The Butcher
    [4446] = 410000, -- Blackvenom Blade
    [13033] = 400000, -- Zealot Blade
    [3413] = 390000, -- Doomspike
    [7730] = 300000, -- Cobalt Crusher

    -- 20-29 armor
    [9491] = 630000, -- Hotshot Pilot's Gloves
    [2264] = 780000, -- Mantle of Thieves
    [1978] = 530000, -- Wolfclaw Gloves
    [2039] = 500000, -- Plains Ring
    [9510] = 410000, -- Caverndeep Trudgers
    [13108] = 400000, -- Tigerstrike Mantle
    [2278] = 390000, -- Forest Tracker Epaulets
    [2292] = 390000, -- Necrology Robes
    [9509] = 370000, -- Petrolspill Leggings
    [1491] = 360000, -- Ring of Precision
    [7728] = 320000, -- Beguiler Robes
    [12998] = 300000, -- Magician's Mantle

    -- 30-39 weapons
    [873] = 2300000, -- Staff of Jordan
    [2825] = 1200000, -- Bow of Searing Arrows
    [870] = 1200000, -- Fiery War Axe
    [9425] = 1100000, -- Pendulum of Doom
    [869] = 1000000, -- Dazzling Longsword
    [1982] = 1000000, -- Nightblade
    [9424] = 580000, -- Ginn-su Sword
    [868] = 550000, -- Ardent Custodian
    [9426] = 430000, -- Monolithic Bow
    [9718] = 410000, -- Reforged Blade of Heroes
    [8223] = 390000, -- Blade of the Basilisk
    [13034] = 380000, -- Speedsteel Rapier
    [9384] = 380000, -- Stonevault Shiv
    [9392] = 330000, -- Annealed Blade
    [10570] = 320000, -- Manslayer
    [6327] = 320000, -- The Pacifier
    [13064] = 300000, -- Jaina's Firestarter
    [5756] = 300000, -- Sliverblade

    -- 30-39 armor
    [10583] = 1500000, -- Quillward Harness
    [2955] = 1400000, -- First Mate Hat
    [867] = 1100000, -- Gloves of Holy Might
    [9429] = 1100000, -- Miner's Hat of the Deep
    [1981] = 930000, -- Icemail Jerkin
    [7755] = 740000, -- Flintrock Shoulders
    [10574] = 660000, -- Corpseshroud
    [5257] = 540000, -- Dark Hooded Cape
    [9420] = 510000, -- Adventurer's Pith Helmet
    [10328] = 500000, -- Scarlet Chestpiece
    [1204] = 490000, -- The Green Tower
    [9431] = 410000, -- Papal Fez
    [1980] = 400000, -- Underworld Band
    [9396] = 370000, -- Legguards of the Vault
    [10332] = 370000, -- Scarlet Boots
    [13110] = 360000, -- Wolffear Harness
    [1718] = 350000, -- Basilisk Hide Pants
    [2277] = 350000, -- Necromancer Leggings
    [2951] = 350000, -- Ring of the Underwood
    [9375] = 320000, -- Expert Goldminer's Helmet
    [10581] = 310000, -- Death's Head Vestment
    [13117] = 300000, -- Ogron's Sash
    [13084] = 300000, -- Kaleidoscope Chain
    }

    ----------------------------------------

    -- calculate value of a stack of reagents based on
    -- auctioneer data and price tables above
    local getReagentValue = function(itemID, itemCount)
    local upperLimit = priceUpperLimit[itemID]
    local adjust = priceAdjustment[itemID] or 1

    if not upperLimit then return nil end

    local median, snapshot, snapshotCount = nil, nil, nil
    local _, link = GetItemInfo(itemID)
    if link then
    local key = Auctioneer.ItemDB.CreateItemKeyFromLink(link)
    if key then
    median = Auctioneer.Statistic.GetItemHistoricalMedianBuyout(key)
    snapshot, snapshotCount = Auctioneer.Statistic.GetItemSnapshotMedianBuyout(key)
    end
    end

    median = median or upperLimit
    snapshot = snapshot or upperLimit
    snapshotCount = snapshotCount or 1

    median = math.min(median, upperLimit)
    snapshot = math.min(snapshot, upperLimit)

    local snapshotWeight = 0
    if snapshotCount >= 5 and snapshot < median then
    snapshotWeight = math.log10(snapshotCount) / math.log10(20)
    end
    snapshotWeight = math.min(math.max(snapshotWeight, 0), 1)
    local medianWeight = 1 - snapshotWeight

    local combined = median * medianWeight + snapshot * snapshotWeight
    return combined * adjust * itemCount
    end

    -- take an ilevel and round it up to the corresponding bracket
    local roundupLevel = function(level)
    for _, bracket in pairs(levelUpperBounds) do
    if bracket >= level then
    return bracket
    end
    end
    return nil
    end

    -- get entry from disenchant table (or nil if nothing found)
    local getDisenchants = function(quality, type, level)
    if disenchantTable[quality] and disenchantTable[quality][type] and disenchantTable[quality][type][level] then
    return disenchantTable[quality][type][level]
    end
    return nil
    end

    -- calculate disenchant value of item based on disenchant table and
    -- calculated reagent values
    local getDisenchantValue = function(itemID)
    local result = nil
    local _, _, quality, level, _, typeString, _, _, _, _ = GetItemInfo(itemID)
    if quality >= UNCOMMON and quality <= EPIC and not badItem[itemID] then
    local type = typeStringToType[typeString]
    if type then
    level = roundupLevel(level)
    if level then
    local disenchants = getDisenchants(quality, type, level)
    if disenchants then
    result = 0
    for _, stats in pairs(disenchants) do
    local reagent, chance, count = stats[1], stats[2], stats[3]
    result = result + getReagentValue(reagent, chance * count)
    end
    end
    end
    end
    end
    return result
    end

    --------------------------------------------------------------------------------
    -- now decide what to do with the auction

    -- min profit for bid
    local bidMinProfitRel = 0.25
    local bidMinProfitAbs = 5000

    -- min profit for buy
    local buyMinProfitRel = 0.25
    local buyMinProfitAbs = 5000

    -- if buyout is close enough to low enough bid, just buy it anyway
    local buyMaxBidNear = 0.01

    -- adjust low bids upwards, but no closer to maximum bid than this
    local bidLess = 0.20

    -- assume item is worthless until proven otherwise
    basePrice = 0

    -- calculate disenchant value or reagent value depending on the type of item
    local disenchantValue = getDisenchantValue(itemID)
    if disenchantValue then
    basePrice = disenchantValue
    reason = "Disenchant"
    depositCost = 0
    depositRate = 0
    else
    local reagentValue = getReagentValue(itemID, itemCount)
    if reagentValue then
    basePrice = reagentValue
    reason = "Reagent"
    depositCost = 0
    depositRate = 0
    end
    end

    -- account for AH cut
    local resaleValue = basePrice * 0.95

    -- decide whether or not to buy

    local buyMaxRel = resaleValue * (1 - buyMinProfitRel)
    local buyMaxAbs = resaleValue - buyMinProfitAbs
    local bidMaxRel = resaleValue * (1 - bidMinProfitRel)
    local bidMaxAbs = resaleValue - bidMinProfitAbs

    if watchList[itemID] then
    basePrice = watchList[itemID]
    local bidMax = basePrice * 0.85
    if buyPrice ~= 0 and buyPrice <= bidMax then
    action = "buy"
    reason = "Watch List"
    elseif bidPrice ~= 0 and bidPrice <= bidMax then
    action = "bid"
    reason = "Watch List"
    end
    else
    if buyPrice ~= 0 and buyPrice <= buyMaxRel and buyPrice <= buyMaxAbs then
    action = "buy"
    reason = reason .. " (buy)"
    elseif bidPrice ~= 0 and bidPrice <= bidMaxRel and bidPrice <= bidMaxAbs then
    if buyPrice ~= 0 and bidPrice >= buyPrice * (1 - buyMaxBidNear) then
    action = "buy"
    reason = reason .. " (buy near bid)"
    else
    action = "bid"
    reason = reason .. " (bid, orig = " .. bidPrice .. ")"
    local bidRelUp = (resaleValue * (1 - bidMinProfitRel)) * (1 - bidLess)
    local bidAbsUp = (resaleValue - bidMinProfitAbs) * (1 - bidLess)
    bidPrice = math.max(bidPrice, math.min(bidRelUp, bidAbsUp))
    end
    end
    end
    • CommentAuthorBishop
    • CommentTimeApr 28th 2007
     
    Posted By: gnarl
    I'm testing out Chardonay's baserule now...the only thing is that I want to change is that I just want to use the baseline prices from allakhazam all the time (not my auctioneer scan). Reason is that there are a lot a few people (probably using BTM on my server and they always post many stacks of 1 reagent wayyyy over an "allakhazam" median). Am I correct in thinking this is all I would need to modify in order to always use the allakhazam prices?

    I have the same exact problem -- no doubt there is intentional, methodic Auctioneer/BTM poisoning going on. To do the exact thing you ask for is as simple as:

    median = base
    snapshot = base

    However, when you do that, you're cutting off a bunch of logic that actually meant to help you make better buy decisions, especially in a depressed market where you cannot get anywhere near the Alla prices for your dust. As such, I'm looking at doing something like this:

    median = median or base
    snapshot = snapshot or base
    snapshotCount = snapshotCount or 1
    if median > base then median = base end
    if snapshot > base then snapshot = base end

    Which will simply use the baseline values only when our baserule would otherwise think the resource is worth more, but still protect against the baseline being too high compared to the actual market on your server. At least that's what I intend it to do, perhaps someone with better lua skills than mine can confirm? :)
    • CommentAuthorBishop
    • CommentTimeApr 28th 2007
     
    HAH! I just read the last version of Chardonnay's rule (above) and he's done exactly what I was suggesting (only using math.min). So, uh, disregard my idea.
    • CommentAuthorteedog
    • CommentTimeApr 30th 2007 edited
     
    Apologies in advance if this is a stupid question. I read http://norganna.org/wiki/BottomScanner/BaseRule but couldn't find the answer.

    Does the BaseRule ignore my /btm minprofit and pctprofit settings? After I pasted the above BaseRule in, BTM would suggest I buy items which would yield very small profits even though I have minprofit set to 3g and pctprofit set to 150%. Am I doing something wrong?
    EDIT: Blah I found the settings in the BaseRule.
    -- min profit for bid
    local bidMinProfitRel = 0.25
    local bidMinProfitAbs = 5000

    -- min profit for buy
    local buyMinProfitRel = 0.25
    local buyMinProfitAbs = 5000

    -- if buyout is close enough to low enough bid, just buy it anyway
    local buyMaxBidNear = 0.01

    -- adjust low bids upwards, but no closer to maximum bid than this
    local bidLess = 0.20


    Also, is there any way to make BTM not calculate an item's value based on my own auctions of that item? For example, I sometimes find the AH completely devoid of Greater Nether Essence. So I'd put up my batch of GNE for 150% or 200% the normal price and people will still buy them. Yay for monopoly. However, this bumps up Auctioneer's valuation of GNE and BTM will then suggest I buy out a lot of stuff for disenchanting due to this temporarily inflated price. Anyway to ignore my own auctions so BTM will suggest buying stuff for disenchanting based on the normal median rather than the temporary monopoly price that I induced?
    • CommentAuthorChardonnay
    • CommentTimeMay 1st 2007 edited
     
    For the first question, you could also remove the lines that set an action (action = "bid", action = "buy" etc.) and let Btm figure things out for itself from the adjusted basePrice.

    For the second, you could manually query the snapshot database to get a filtered list of auctions that are not yours, and calculate a median based on that and historical data. The historical data will include your prices, nothing much you can do about that, and snapshot queries take a while, so this is something you would want to do once at the start of the scan and save off somewhere, not for every item in the scan. If you want to get fancy, I think you could also hook Auctioneer events so that the queries are only performed following snapshot changes...
    • CommentAuthorMartijnf
    • CommentTimeMay 6th 2007
     
    Firstly Chardonnay, brilliant job on this, it's a very good baserule.

    I do have two questions which I should probably be able to code myself but I haven't done any programming for years and it'll prob only take you a few moments to figure it out.

    1. Like (I think) Bishop, my chanter is still lower lvl so I can only disenchant up to lvl 61. I would like to exclude any items 61+ from popping up. Now I'm guessing this should be an easy 'if' somewhere in the decisionmaking process, but maybe it would be a worthwhile thing to add since I'm sure there are more ppl out there with the same problem. Ideally it would work the way enchantrix does, where you can just enter your enchanting skill lvl and the script works out the relevant lvls for itself based on a simple table, but for now I'll settle for just 'don't buy anything over level xx'

    2. I find that even with the high deposits on weaps and armor, lots of ppl put everything in on 24h auctions. A lot start them at low bid prices to generate bids, which of course happens exactly because of progs like bottomscanner, but it also means that if I put in a bid early on, I'll be outbid by the end about 99% of the time. This ties up a lot of funds and it's also a hassle with going through 100 'outbid on item xx' mails. Is there a way in which you could tell BTM to only scan items of say, medium and short duration? Perhaps making it where you can say 'Very Long = 0' 'Long = 0' 'Medium = 1' 'Short = 1' so as to make it more easily customizable. You could then just change a 1 to a 0 or the other way around depending on what you want on that day.

    Again, very glad to have found this one, especially since it makes the whole baserule thing much more clear to me and now I can just tweak and customize it to make it even better suited for me, so thanks a bunch for sharing this! :)

    Hope you can assist me on these two points, cheers!
    • CommentAuthorMartijnf
    • CommentTimeMay 6th 2007
     
    BTW Bishop, thanks for your version of Chards baserule, I also like to use BTM as a general AH trading tool and your version allows for that as well as taking care of the annoying resale popups for greens which are always completely inaccurate.

    Also I realize now that I made a mistake with the item level, which stems from the difference between the 'use level' and actual itemlevel although that doesn't change the principle of what I asked.
    • CommentAuthorChardonnay
    • CommentTimeMay 7th 2007 edited
     
    1. Skill requirements for different item levels are listed in this table: http://norganna.org/discuss/discussion/3677/disenchant-level-required/#Item_4. To factor this in, you could add an extra check in getDisenchantValue
    if quality >= UNCOMMON and quality <= EPIC and not badItem[itemID] and level <= 99 then2. As far as I can tell, "time left" for an auction is not directly available inside a baserule. You might wanna add a trac ticket for this.
    • CommentAuthorMartijnf
    • CommentTimeMay 7th 2007 edited
     
    Talk about a quick response, thanks. I actually got as far as working out the way to do this last night, but was still looking for the specific item levels, guess I could've just looked on this site :bigsmile:

    I'll put this in straight away and look into point two and if I can't find anything either add a ticket as I do think it would be a worthwhile feature, not only for disenchants but generally for AH trading.

    Thanks!

    [edit] works like a charm, ty![/edit]
    • CommentAuthorBishop
    • CommentTimeMay 7th 2007
     
    While we're at that line, Chardonnay, I'm wondering... what, exactly, is the point of checking "and quality <= EPIC"?
  1.  
    Legendary items cannot be disenchanted. :D
    • CommentAuthorBishop
    • CommentTimeMay 7th 2007
     
    Haha, alright, that explains that. Not that I think it's even possible for one to show up on the AH... at least I am not aware of any that are BoE. ;)
    • CommentAuthorBishop
    • CommentTimeMay 7th 2007
     
    Oh, now that I'm asking questions anyway, could you elaborate on the idea behind the bidLess feature you've implemented? I believe I understand what it does, but I think I fail to see why it does it.

    Also, for completeness sake, and so I do not have to wrap my head around the math, would setting bidLess = 1 or bidLess = 0 disable the feature?
  2.  
    I added that to be able to bid above the default on auctions with ridiculously low bids - reduces the chances of being outbid. Setting it to zero will disable it, although it won't do anything anyway unless you've modified Btm itself to allow bidPrice to be overridden; its value is normally discarded on exit from the baserule.
    • CommentAuthorMartijnf
    • CommentTimeMay 8th 2007
     
    Ok I've been digging in to this a little bit more now, seeing as I use auctioneer so much. One problem I still had after using Bishops baserule to get rid of the green resale popups was blue resale popups. Lots of ppl just put stuff on AH at rediculous prices so medians for blue items are usually hugely inflated. So I decided I could put a weighing factor on that which would adjust the basePrice auctioneer uses for these specific items limiting the number of popups to items that are at least pretty likely to be profitable. Maybe not the most subtle or complete solution but barring a good conservative value it's something. Obviously you could do this with a /btm setting but then it would affect prices globally, which I don't want. So I modified Bishops rule like so:

    -- prevent equipable greens from showing up for resale and revaluate blue equipables with custom factor

    local blueAdjust = 0.5 -- change this to change valuation e.g. 0.5 = 50% lower basePrice than auctioneer would use

    local _,_, quality, _, _, class, _,_,_ = GetItemInfo(itemID)

    if (quality==2 and (class =="Weapon" or class == "Armor"))
    then
    basePrice = 0
    elseif (quality==3 and (class =="Weapon" or class == "Armor"))
    then
    basePrice = basePrice * blueAdjust
    end


    And this works exactly as intended (yay me :cool: ), auctioneers shows it as "Valuation (custom)" BUT.. it also changes the valuation on the watchlist items. It doesn't really matter since the baserule will still prompt to buy them (made another quick 30G on a watchlist item today, thx Chardonnay) but it does look silly when it says 'buyout item xx at 25G?' 'valuated at 15g'. So I tried two things, one was to simply put the whole expression into the watchlist bit, i.e. if watchlist[itemID] then etc,.. else see code above, but that didn't work, I think because there is already an if.. else in there.

    So then I tried this:


    local blueAdjust = 0.5
    local _,_, quality, _, _, class, _,_,_ = GetItemInfo(itemID)

    if (quality==2 and (class =="Weapon" or class == "Armor"))
    then
    basePrice = 0
    elseif (not watchList[itemID] and (quality==3 and (class =="Weapon" or class == "Armor")))
    then
    basePrice = basePrice * blueAdjust
    end



    which I thought was pretty clever but it doesn't work.. it compiles fine but if I change the blueAdjust it also changes the valuation of watchlistitems. Just now while typing I thought that maybe it was a mistake in the order of the expression so I changed it into


    elseif (not watchList[itemID]) and (quality==3 and (class =="Weapon" or class == "Armor"))


    but that equally does not work.

    Where am I going wrong in my thinking here? Again it's been a loooong time since I've programmed anything more than my vcr so it's all coming back a bit slowly atm.
  3.  
    I can't see anything wrong with it by quick inspection... and my main server is down for maintenance so I can't test easily. An alternative approach would be to move the watchlist stuff after everything else so that it overrides any previously set basePrice.

    As for profits, the other day someone posted [Assassin's Blade] for 10g. :D
    • CommentAuthorMartijnf
    • CommentTimeMay 9th 2007 edited
     
    Lol that's pretty awesome! How much did you sell it for? The one I grabbed and resold within a few hours yesterday was the Kaleidoscope Chain which funnily enough Auctioneer had never seen at auction at my server before, so I never would've bought it otherwise.

    I'll try your suggestion, I'm also a little stumped why it won't work since you basically use the same code for badItem[itemID] when determining whether or not something is disenchantable:

    if quality >= UNCOMMON and quality <= EPIC and not badItem[itemID] and level <= 99 then

    Another thing I've noticed is that the valuation for all disenchant items is screwy now. It shows the value as the bidamount, i.e. 'Buyout item xxx for 2g30s, valued at 2g30s ( 0 s profit)' even though that is obviously wrong. First I thought I had screwed up your code somehow so I recopied the whole thing, changing only the level check and adding the new bit below it, but that didn't fix it. I think this may be a related problem so it might also be solvable by moving this whole bit up higher. Since I don't know exactly how BTM creates the value outputs to the screen I can't figure out just yet why it's doing this.

    I'll mess around with it when the servers come back up and let you know.
    • CommentAuthorMartijnf
    • CommentTimeMay 9th 2007
     
    Ok so regarding the dischant value not showing up, that was due to Bishops change of
    -- assume item is worthless until proven otherwise
    basePrice = 0

    -- calculate disenchant value or reagent value depending on the type of item

    etc.


    And the subsequent occurrences of 'basePrice' in the disenchant value calculation to :

    -- assume item is worthless until proven otherwise
    myBasePrice = 0

    -- calculate disenchant value or reagent value depending on the type of item
    local disenchantValue = getDisenchantValue(itemID)
    if disenchantValue then
    myBasePrice = disenchantValue
    reason = "Disenchant"
    depositCost = 0
    depositRate = 0
    else
    local reagentValue = getReagentValue(itemID, itemCount)
    if reagentValue then
    myBasePrice = reagentValue
    reason = "Reagent"
    depositCost = 0
    depositRate = 0
    end
    end
    -- account for AH cut
    local resaleValue = myBasePrice * 0.95



    By setting the basePrice to 0 for all equippable green items with his own script addition and then not setting basePrice to the disenchant value (since he replaced basePrice by myBasePrice) the baseprice remained 0, to which I guess BTM then automatically adds the bidPrice or buyPrice when bidding/buying. This can be changed by adding
    basePrice = disenchantValue
    to the local disenchantValue and doing the same with the reagentvalue, but it's probably even easier to just delete the 'assume item is worthless until proven otherwise' bit altogether. Really I think it's only there because of your preference to only get returns on DE items and watchlist items, am I right Chardonnay? It's not really necessary in any other way as a safeguard against overvaluating as far as I can tell.

    Also moving the whole thing up seems to work, but it seems to work anyway now. I don't know why it didn't work yesterday as I was puzzling with it for a good long while and retyped it and worked with a few clean copy/pastes from the site just to be sure I didn't screw it up somehow, but it seems to work fine today, even though I just straight copy/pasted it to a new server and didn't change anything. (my own server is still down).

    There really is only one problem now and that is regarding my blue item valuation thingie. I think it's impossible to have both the reagent value show up, AND still get a proper valuation on a DE-able item. Since there is only one basePrice, you can only either set it to the DE value, as is being done by your baserule, or set it to the Auctioneer value (or anything derived from that). So I guess the easiest workaround for this is to use the 'decide whether or not to buy/bid' part of the script to make it so that if the baserule decides not to buy or bid, it will reset the basePrice for blue items to the Auctioneer value, in my case with the addition that it multiplies it with a valuation constant. That way BTM should still prompt for a bid or buy even if it's not interesting based on the DE value.

    Sorry if I type a lot but I find it helps to think out loud sometimes and also maybe I'm totally on the wrong track here and missing stuff in which case I'd be happy to be corrected. :smile:
    • CommentAuthorBishop
    • CommentTimeMay 9th 2007 edited
     
    It's been a long time since I posted my derived version, so here's my latest for your perusal:

    http://baserules.pastey.net/25141

    I implemented your blueAdjust idea last night just for giggles (as I've currently set it to 1 it has no effect, but you should be able to change that as you please).
    • CommentAuthorMartijnf
    • CommentTimeMay 9th 2007
     
    Yeah that's almost the same way I did it on mine, maybe actually a little better although you're calling GetItemInfo twice here which isn't technically necessary is it? Prob doesn't matter much but for the sake of keeping the load as light as possible and what not.

    Actually today I've been messing with BtmScan to get it to let me specify what auctionlength it should bid on and after much puzzling (three cheers for servers being down till 4.30pm) I've gotten it to work. I won't post it here since it's nothing to do with a baserule but I'll put up a ticket with the small change to btmMain.lua that I worked out which lets you use an additional baserule variable, auctTime, with a number of 1 through 4, 1 being short and 4 being very long. Quite useful imo to reduce clutter esp if you usually check AH more than once a day (in which case very long auctions will come by eventually depending on your settings) and should take about 5 mins for a dev to implement for a future version.

    Thanks for the help Bishop! BTW since you haven't implemented the ' and level <= 99' into your baserule can I assume you've levelled your chanter to lvl 35? :bigsmile:
    • CommentAuthorsnaggs
    • CommentTimeMay 9th 2007
     
    Can I ask a really dumb question? I have a level 41 priest with 289 enchanting skills which I use to just buy level 61+ items and de them and then sell the mats or use them to make other things (Imbued Netherweave Bag for example). I've been following this thread and the previous one, and have used Chardonnay's example (with everyone else's help) but I still get BTM offering me junk that I just don't want.

    I'm happy to get DE items from items level 40+ so that I still get my Dream Dust etc, but how do I switch the rest of it off?
    • CommentAuthorBishop
    • CommentTimeMay 9th 2007
     
    Posted By: MartijnfThanks for the help Bishop! BTW since you haven't implemented the ' and level <= 99' into your baserule can I assume you've levelled your chanter to lvl 35?


    You're welcome. And yes, I've had close to 375 enchanting for a while now...
    • CommentAuthorMartijnf
    • CommentTimeMay 9th 2007
     
    by junk you mean DE items that you don't want (i.e. lower level ones) or just random other popups like say Zhevra Leather or Silk Cloth and such?

    Because if you're using Chardonnay's baserule completely, without the additions Bishop made, the line

    -- assume item is worthless until proven otherwise
    basePrice = 0


    makes sure that you really only get items that are either for DE, or are on the watchlist, everything else is automatically valued at 0 and disregarded. If you're still getting random junk, check if you have this line. If that doesn't work for you, you could change the /btm variables so nothing seems interesting to buy to btm, with /btm pctprofit 10000 or something along those lines but that shouldn't be necessary

    If you only want higher lvl DE items you could do two things the way I see it. As you might've seen, Chardonnay created a custom rule for me to put in getDisenchantvalue since I can only disenchant up to lvl 99 items and you could use that rule in reverse to get only higher lvl items. Like say if you want to get items lvl 40+ you would make it

    if quality >= UNCOMMON and quality <= EPIC and not badItem[itemID] and level >= 40 then

    This will disregard any items for disenchant that are not at least itemlevel 40 (although I think you meant useable by level 40 which is not the same as itemlevel 40, if you want to disregard any items that don't at least give dream dust, you should use itemlevel 50 instead, you can see in the disenchant table in the baserule which lvl items give which disenchants )

    Alternatively, what I think you could do is use the price adjustment system Chardonnay devised that is at the top, where it says for instance:

    [LASTRAL] = 1,
    [LMAGIC] = 1,

    [ARCANE] = 1,
    [ILLUSION] = 1,


    and simply set all the reagents that you don't want to get to 0, that way the baserule should valuate items that give that type of reagent to 0 value and shouldn't prompt you for buyout. That way you don't have to change anything to the code.

    Hope that helps.
  4.  
    Posted By: Martijnfwhat I think you could do is use the price adjustment system Chardonnay devised that is at the top, where it says for instance:

    [LASTRAL] = 1,
    [LMAGIC] = 1,

    [ARCANE] = 1,
    [ILLUSION] = 1,


    and simply set all the reagents that you don't want to get to 0, that way the baserule should valuate items that give that type of reagent to 0 value and shouldn't prompt you for buyout. That way you don't have to change anything to the code.


    Yep, that's what it's there for. I use it for reagents that despite being fairly valuable *when they sell*, tend not to sell consistently. If I have a reagent piling up in my bags I drop its price adjustment to avoid accumulating even more...
    • CommentAuthorsnaggs
    • CommentTimeMay 10th 2007
     
    Thanks guys, I'll give it a go
    •  
      CommentAuthorDeckard
    • CommentTimeMay 10th 2007 edited
     
    Sometimes I like to start BottomScanner, then scan through the AH for just items on my watchlist, for outstanding profit and vendor only. I've been having some great buys using Chardonnay's "twink gear" watchlist from above (just the watchlist itself, not the other code), adding a few of my own items to it, and using the following settings:

    mindeprofit = 1000000 (set to 100g, so essentially nothing gets tagged for DE)
    minprofit = 500000 (set to 50g, so only items with potential profit of 50g or more are tagged, changed as needed depending on my goals)
    vendprofit = 3000 (set to 30 silver profit or more, easy money there)

    A properly configured BottomScanner has to be the greatest mod inventions yet for snagging great deals on the AH. After I've done my initial full AH scan, I just leave BottomScanner running. I can simply sit back, surf the web (I use WoW in a window, not full screen) and wait for the BottomScanner "doorbell" to find a good deal for me.

    Pure joy. :bigsmile:
    • CommentAuthorMartijnf
    • CommentTimeMay 10th 2007
     
    The watchlist is a godsend as well. Like you I'm slowly adding some items that I see sell well at my server, as well as modifying some of the prices.

    There's one crafter on my server who crafts Bracers of Havok and puts them on AH for 65G, I've bought a couple so far and turned them around in 1-2 days for 95G each time, haha.. gotta love that. Yesterday I breached 1000g (cash, not counting stock ) for the first time, today I'm at around 1200, with I reckon about 400-500g worth of stock and items. Not bad considering I started trading and DEing two weeks ago with a starting capital of 40G and no clue about disenchanting, bottomscanner or baserules :boogie: Started using BTM and Exchantrix since my enchanting lvl was pretty low then anyway, but it wasnt until I started using this baserule (last week or so) that the cash really started rolling in.

    Once again many thx to Chardonnay for his brilliant baserule, as well as to the devs of BTM and auctioneer of course.
    • CommentAuthorChardonnay
    • CommentTimeMay 10th 2007 edited
     
    No problem on the rule front. :)

    I actually think there's other people on my server starting to use my rule or something very like it based on the number of times I bid on a few dozen items and am outbid within a few minutes on most of them... not too bothered as thanks to Auctioneer I now have more gold than I could ever use. :P

    BTW the [Assassin's Blade] finally went for 250g.
    • CommentAuthorBishop
    • CommentTimeMay 11th 2007
     
    Hehe, I have a very similar problem, the market on my server is very heavily patrolled by more than one auctioneer user -- beyond myself. At least one other even posts on the forums here. And I'm sure someone's already done something similar to your watchlist long ago, because those kinds of deals are only possible on my server when watching the live auctions being posted.
    • CommentAuthorToraa
    • CommentTimeMay 18th 2007 edited
     
    My kludgy modification: http://baserules.pastey.net/33883
    Changes I found to be helpful to Chardonnay's original or Bishop's modified versions:

    -- I bid/buy, DE, list, all in one swell foop. Prices M-T on mats
    -- are lower on my server than they are F-S, hence the lazy way
    -- of toggling between the two.
    -- local myDefaultPrice = 1 -- The weekend price.
    local myDefaultPrice = 0.85 -- The weekday price.
    local priceAdjustment = {
    [VOID] = myDefaultPrice - 0.3,
    [NEXUS] = myDefaultPrice - 0.3,

    (and then changing the rest of the default "1" values to "myDefaultPrice", of course)

    I was still having issues with too many artificially inflated items popping up for resale. I miss a few resale bargains this way, but still get to see the "real" disenchant value.
    Appended to either version:
    if (action ~= "bid" and action ~= "buy") then
    basePrice = basePrice * 0.85
    end


    Suggestions? Any way to write that more efficiently?
    • CommentAuthorjoelpt
    • CommentTimeMay 19th 2007 edited
     
    I just noticed today that I have apparently been getting disenchant recommendations both from this custom baserule, and from BTM's own disenchant logic. At least that's how it appears: most recommendations appear with a reason of "disenchant", and infrequently with the reason of "Disenchant" (notice capitalization).

    Looking at the custom baserule code, it uses the capitalized version when it sets its reason text. Does this really mean that two separate disenchant rules are in effect here? If so, should I set one of BTM's disenchant-related options to disable the built-in rule?

    Also, will doing so dramatically reduce the number of "for disenchant" auctions showing up? -- because 95%+ of the DE purchase recommendations I get are of the "disenchant", not "Disenchant" variety.

    Thanks for help..
    joelpt
    • CommentAuthorToraa
    • CommentTimeMay 19th 2007
     
    joelpt,
    /btm mindeprofit FOO
    where FOO is some amount (I use 1g) will decrease the amount of "disenchant" popups you receive.

    I'm not certain if that will have any effect if you're already using a custom rule, though.

    If you are, tacking:
    if (action ~= "bid" and action ~= "buy") then
    basePrice = basePrice * 0.50
    end

    onto the end should eliminate those small-d popups (but will also decrease you seeing "resale" popups)
    • CommentAuthorjoelpt
    • CommentTimeMay 19th 2007
     
    Well, after some more investigation, it appears my assumption was correct. When you have "/btm enchant" set to a value greater than 0, BTM's built-in disenchant rule gets called before the custom baserule. When this happens, you get a bid/buy recommendation based on an expected profit that is generally much higher than Chardonnay's custom baserule. And it seems that only when the built-in rule does NOT trigger a recommendation does the custom baserule get executed for the item.

    Setting "/btm enchant 0" appears to have disabled the built-in disenchant rule for me entirely. As a result I am now receiving a much larger number of "Disenchant" (custom) recommendations, and with considerably lower expected profit figures, most probably because Enchantrix's DE mat predictions (used by the built-in rule) are much too generous.

    So, if you're using this custom baserule from this thread, I recommend setting "/btm enchant 0", and if you need to restrict DE purchases by item level (because of a low disenchanting skill) edit your baserule to include the "level <= ##" criteria noted in the above comments.


    Also thanks for your comment Toraa.

    joelpt
    • CommentAuthorjoelpt
    • CommentTimeMay 19th 2007
     
    On my server, the AH pricing for Lesser Essences are exceedingly marked up. For instance, Lesser Mystic Essences are priced at 1g40s median, while Greater Mystic Essences are going for 1g60s. Of course this makes little sense, since 3 lessers convert to 1 greater. Furthermore, the Lesser versions rarely sell for me, even when priced at 1/3 of the Greater equivalent price. Strangely though, there are still dozens of posted auctions for the Lessers. I suppose some buyers may want just a single Lesser of a given type, though I'm guessing sellers are probably hoping to find a sucker, or just don't know of the Lesser/Greater conversion.

    So to help with this problem, I have modified each of the baserule lines of the form:

    [15] = { { STRANGE , 0.20, 1.5 }, { LMAGIC , 0.80, 1.5 }, },

    to this:

    [15] = { { STRANGE , 0.20, 1.5 }, { GMAGIC , 0.80, 1.5 / 3 }, },

    In other words, when calculating DE profit, for any Lesser essences, I instead use the equivalent Greater essence price divided by 3. I do this for all LMAGIC, LASTRAL, LMYSTIC, LNETHER, LETERNAL, and LPLANAR elements in the disenchantTable array.

    This seems to produce more accurate profit measures for me, since the Greaters are the ones that sell reliably and are priced properly on my server. YMMV.

    joelpt
    • CommentAuthorccox
    • CommentTimeMay 20th 2007
     
    There are auctions posted for lessers becuse they are worth more. (I know I'm going to post an auction where I can make the most money.... Essence arbitrage is your friend!)

    So you're trying to find the minimum value for the disenchant materials?
    I'd be looking for "what is the maximum reasonable price I can sell these mats for right now", and in your case that would be the lesser essence price (or lesser=max(lesser,greater/3) to keep it general).
    • CommentAuthorjoelpt
    • CommentTimeMay 21st 2007
     
    Thanks for the comments ccox, your suggestion is a good one. I think the problem I have is that on my server, lesser essences basically never sell, so I'll probably stick with what I've got now. But for servers where you can reliably sell both lesser and greater, your modification is a great suggestion, especially seeing as how you can split greaters into lessers and sell either or both depending on AH demands.

    Cheers
    joelpt
    • CommentAuthorToraa
    • CommentTimeMay 21st 2007
     
    Modified Bishop's "Cheap Prism" rule.
    I've added a cut price variable to ease cross-faction scanning (I use one character to scan for buyouts for cross-faction auctions, then a second for bids and buyouts for home auctions).
    Also, I was missing too many Small Prismatic Shards which, on my server, go for more than the large. Extra logic to catch those. I smell redundancy. =( How can I better simplify this?

    --AH cut price
    local myAHcut = 0.95 -- home/other AH cut
    --local myAHcut = 0.85 -- neutral AH cut

    local _,_, quality, level, _, class, _,_,_ = GetItemInfo(itemID)
    local myCheapLPrism = myAHcut * 140000 --price I *know* I can sell L. and S. Prismatic Shards on
    local myCheapSPrism = myAHcut * 50000 --weekends despite what current pricing data reflects

    if (quality >= RARE and (class =="Weapon" or class == "Armor") and level > 84) then
    if (quality >= RARE and (class =="Weapon" or class == "Armor") and level < 100) then
    reason = "Cheap S.Prismatic"
    basePrice = priceUpperLimit[SPRISMATIC]
    myCheapPrism = myCheapSPrism
    end

    if (quality >= RARE and (class =="Weapon" or class == "Armor") and level > 99) then
    reason = "Cheap L.Prismatic"
    basePrice = priceUpperLimit[LPRISMATIC]
    myCheapPrism = myCheapLPrism
    end

    if buyPrice <= myCheapPrism then
    action = "buy"
    elseif bidPrice <= myCheapPrism then
    action = "bid"
    end
    end
    • CommentAuthortoggert
    • CommentTimeMay 25th 2007
     
    In chardonnay's base rule it is mentioned that Enchantrix could be used to get the DE value but the list isn't complete:

    -- the big disenchant table, indexed by [quality][type][level bracket]
    -- and yielding { { reagent type, drop probability, average drop quantity }, ... }
    -- I would use Enchantrix, but it lacks data for new items

    I want to setup my baserule to use Enchantrix. What commands would I need to do this?
    • CommentAuthorMartijnf
    • CommentTimeMay 30th 2007
     
    if you want to use enchantrix you don't really need to use a baserule I think, you can just use enchantrix + btmscanner with bidding on enchants set to 'on'.

    The problem with this is that enchantrix doens't have any post TBC information, so you'll only be getting 'old' items.

    This is how I started before I found this awesome baserule and it does work, just not as well as this does.
    • CommentAuthorChardonnay
    • CommentTimeMay 30th 2007
     
    Here's the code in Bottomscanner that queries Enchantrix - you could adapt this for use inside a baserule.

    local disenchantValue = 0
    if (Enchantrix and Enchantrix.Storage) then
    local disenchantTo = Enchantrix.Storage.GetItemDisenchants(Enchantrix.Util.GetSigFromLink(itemLink), itemName, true)
    if (disenchantTo and disenchantTo.totals and disenchantTo.totals.hspValue and iQual > 1 and iCount <= 1) then
    disenchantValue = disenchantTo.totals.hspValue * disenchantTo.totals.conf
    end
    end


    You will need to provide values for the variables in bold.
    • CommentAuthorAlphaunit1
    • CommentTimeMay 30th 2007
     
    I am using this ruleset, but I'm seeing one issue: If an item has both resale and disenchanting possibilties (or even vendor/disenchanting possibilities), the resale/vendor prompts come up first, even if the disenchant is by far the better (read: more profitable) choice. (I say "no" to a lot of the resale items, just because resale prices on some items are somewhat inflated on my server, and I've developed a "feel" for what sells quickly and what takes forever.) This isn't happening all that often, but at least once/twice per day I'm catching something that prompts a buyout for (example) 3.5g that has a resale value of 5g, yet has a disenchanting value of nearly 7.5g. If I say "no" to the prompt, I don't get prompted again for the disenchanting buyout.

    Is there a way to reverse this order a bit, or is this just an artifact of the way BottomScanner works?
    • CommentAuthorChardonnay
    • CommentTimeMay 30th 2007
     
    That's just the way it works right now. It doesn't try to find the "best" valuation for the item - it goes through each of its rules in a fixed order, potentially ending up with an action (bid, buy, ignore) and if the final action is bid or buy, the user is prompted (once). In particular, if you actioned "bid" in your baserule, the vendor, disenchant and snatch rules can subsequently override that to a "buy", and change the valuation and reason. The resale rule should not interfere.
    • CommentAuthorToraa
    • CommentTimeJun 1st 2007
     
    Anyone mind sharing their running results with this baserule? My weekly average net profit for the past two weeks is just over 1,200 gold. How do I compare? It *feels* like I should be making a good bit more. =(
  5.  
    1-5000 a week - varies a lot.
    •  
      CommentAuthorDeckard
    • CommentTimeJun 2nd 2007
     
    Is the vast majority of that from DE'ing stuff? I don't have an enchanter who can DE anything higher than level 63, so I've limited my AH activity for those purchases.

    My best week was over 2000g, followed by a week of 1300g, but most of that was from buying items in stacks and splitting, or buying cheap items and combining into even stacks for easier sales. Since those weeks I have not really kept track, as I've also made many gear and enchant upgrades for my main.

    I'm currently using a modified version of just the twink gear portion of your watchlist, with a few of mine thrown in.
  6.  
    Mostly enchanting reagents. Auctioneer max prices are never accurate in a competitive market, so you need to adjust prices manually, and lower margins or or run out.
    • CommentAuthorToraa
    • CommentTimeJun 2nd 2007
     
    Almost entirely enchanting reagents for me. I want to work on writing logic to determine what tradeskill items are worth, from a disenchanting perspective. Take netherweave cloth, for example. 18x[Netherweave Cloth] + 1x[Runethread] = [Netherweave Bracers] which matches this line in the table: [99] = { { ARCANE , 0.75, 2.5 }, { LPLANAR , 0.20, 2.5 }, { SPRISMATIC , 0.05, 1.0 }, }

    Right now I'm just setting snatch prices manually. Anyone already done something like this to their baserule already?
    • CommentAuthorWyko
    • CommentTimeJun 3rd 2007 edited
     
    here's mine =)

    local watchList = {
    --[item] = price (copper)

    --mine
    [22829] = 20000, --Super Healing Potion
    [22832] = 12000, -- Super Mana Potion

    -- 10-19 Weps
    [1935] = 1000000, -- Assassin's Blade
    [1482] = 900000, -- Shadowfang
    [890] = 250000, -- Twisted Chanter's Staff

    -- 10-19 armor
    [2059] = 510000, -- Sentry Cloak
    [8350] = 490000, -- The 1 Ring
    [1486] = 490000, -- Tree Bark Jacket
    [1121] = 400000, -- Feet of the Lynx
    [12977] = 300000, -- Magefist Gloves

    -- 20-29 weapons
    [776] = 920000, -- Vendetta
    [4454] = 490000, -- Talon of Vultros
    [8226] = 450000, -- The Butcher
    [4446] = 410000, -- Blackvenom Blade
    [13033] = 400000, -- Zealot Blade
    [3413] = 390000, -- Doomspike
    [7730] = 300000, -- Cobalt Crusher

    -- 20-29 armor
    [9491] = 630000, -- Hotshot Pilot's Gloves
    [2264] = 780000, -- Mantle of Thieves
    [1978] = 530000, -- Wolfclaw Gloves
    [2039] = 500000, -- Plains Ring
    [9510] = 410000, -- Caverndeep Trudgers
    [13108] = 400000, -- Tigerstrike Mantle
    [2278] = 390000, -- Forest Tracker Epaulets
    [2292] = 390000, -- Necrology Robes
    [9509] = 370000, -- Petrolspill Leggings
    [1491] = 360000, -- Ring of Precision
    [7728] = 320000, -- Beguiler Robes
    [12998] = 300000, -- Magician's Mantle

    -- 30-39 weapons
    [873] = 2300000, -- Staff of Jordan
    [2825] = 1200000, -- Bow of Searing Arrows
    [870] = 1200000, -- Fiery War Axe
    [9425] = 1100000, -- Pendulum of Doom
    [869] = 1000000, -- Dazzling Longsword
    [1982] = 1000000, -- Nightblade
    [9424] = 580000, -- Ginn-su Sword
    [868] = 550000, -- Ardent Custodian
    [9426] = 430000, -- Monolithic Bow
    [9718] = 410000, -- Reforged Blade of Heroes
    [8223] = 390000, -- Blade of the Basilisk
    [13034] = 380000, -- Speedsteel Rapier
    [9384] = 380000, -- Stonevault Shiv
    [9392] = 330000, -- Annealed Blade
    [10570] = 320000, -- Manslayer
    [6327] = 320000, -- The Pacifier
    [13064] = 300000, -- Jaina's Firestarter
    [5756] = 300000, -- Sliverblade

    -- 30-39 armor
    [10583] = 1500000, -- Quillward Harness
    [2955] = 1400000, -- First Mate Hat
    [867] = 1100000, -- Gloves of Holy Might
    [9429] = 1100000, -- Miner's Hat of the Deep
    [1981] = 930000, -- Icemail Jerkin
    [7755] = 740000, -- Flintrock Shoulders
    [10574] = 660000, -- Corpseshroud
    [5257] = 540000, -- Dark Hooded Cape
    [9420] = 510000, -- Adventurer's Pith Helmet
    [10328] = 500000, -- Scarlet Chestpiece
    [1204] = 490000, -- The Green Tower
    [9431] = 410000, -- Papal Fez
    [1980] = 400000, -- Underworld Band
    [9396] = 370000, -- Legguards of the Vault
    [10332] = 370000, -- Scarlet Boots
    [13110] = 360000, -- Wolffear Harness
    [1718] = 350000, -- Basilisk Hide Pants
    [2277] = 350000, -- Necromancer Leggings
    [2951] = 350000, -- Ring of the Underwood
    [9375] = 320000, -- Expert Goldminer's Helmet
    [10581] = 310000, -- Death's Head Vestment
    [13117] = 300000, -- Ogron's Sash
    [13084] = 300000, -- Kaleidoscope Chain
    }

    local minProfit = 20000 -- The minimum amount of profit. Multiply a number by 10,000 to get that number in gold.
    local safety = 2 --Safety margin. This number represents the number of times you may have to put it up for auction before it sells.
    local pctProfit = .2 -- The percentage (in decimal form) of the price of the item that must be profit

    if (watchList[itemID] and buyPrice ~= 0 and buyPrice <= watchList[itemID]) then
    action = "buy"
    reason = "W-A-T-C-H L-I-S-T"
    end

    local _,_, quality, level, _, class, _,_, equip = GetItemInfo(itemID)

    if ((quality<3 and auctSeen > 30) or (quality >= 3 and auctSeen > 5)) then

    safety = (safety*depositCost)

    basePrice=Auctioneer.Statistic.GetHSP(auctKey)
    basePrice=basePrice * itemCount

    if (((basePrice-buyPrice) > (minProfit+safety)) and (((basePrice-buyPrice)-safety) > (buyPrice*pctProfit))) then
    action = "buy"
    reason = "Buyout - " .. auctSeen .. " times seen."
    elseif ((basePrice-bidPrice) > (minProfit+1+safety) and (((basePrice-bidPrice)-safety) > (bidPrice*pctProfit))) then
    action ="bid"
    reason = "Bid- " .. auctSeen .. " times seen."
    else
    action = "ignore"
    reason = "Bad dealz"
    end

    else
    action = "ignore"
    reason = "Less than 20"
    end


    All this without any knowledge of LUA coding =)
    Yes, the first part is a direct rip from the awesome watch list posted above.
    Anyone see any problems with it or ways to improve?
    • CommentAuthorToran
    • CommentTimeJun 4th 2007
     
    Hi,is it possible to use the DE values for the "new" items ENX now offers in combination with BTM? If yes, does it do that automatically, using BTM functionality, or do I still have to write a new baserule for that?
    • CommentAuthorHolters
    • CommentTimeJun 4th 2007 edited
     
    -- min profit for bid
    local bidMinProfitRel = 0.25
    local bidMinProfitAbs = 5000

    -- min profit for buy
    local buyMinProfitRel = 0.25
    local buyMinProfitAbs = 5000

    Are these lines the same as "minprofit" and "pctprofit"? I.e. if i want minprofit to be 3,5g and pctprofit to be 100%, then i put in

    -- min profit for bid
    local bidMinProfitRel = 1.00
    local bidMinProfitAbs = 35000

    -- min profit for buy
    local buyMinProfitRel = 1.00
    local buyMinProfitAbs = 35000
    • CommentAuthorDesolator
    • CommentTimeJun 4th 2007 edited
     
    hi all, just discovered this amazing addon, but i dont know any about lua programing, so I have some questions, hope that arent stupid lol

    let say that im using the baserule at top of thread posted by Deckard

    will i need edit something to work at this way:

    - only popup me with DE deals based on prices edites on baserule,eg: [20725] = 75000, -- Nexus Crystal
    i dont want BTM to look for auctioneer reagent prices, want it to just check my baserule prices

    - can i edit this? : "[11134] = 999999999, -- Lesser Mystic Essence" to BTM forget about popup me with items that DE in poor reagents that i dont want

    - like somone sayd above, i dont want resale itens and ajusted my pctprofit for somelike 100000, my baserule still will look for that twink itens listed on baserule ? i want to resell just twink itens :P

    - i really need this ? since i dont care about how many reagens I have to sell or how market is going on:

    -- A price adjustment to favour/disfavour particular reagents
    -- depending on the market and how much of the reagent I have
    -- already. Set manually, but I am working on automating this
    local priceAdjustment = {
    [VOID] = 0.5,
    [NEXUS] = 0.5,

    [LPRISMATIC] = 1,
    [LBRILLIANT] = 1,
    [LRADIANT] = 1,
    ........



    I wonder if I need use all that baserule to just do what i want, that is look for DE deals based on my ownbaserule edited prices without auctionner ou enchantrix prices, and dont see popup for resell itens unless are that twink ones, I have ajusted my pctdeprofit to 70% and mindeprofit to 3g and is just fine to me like this
    if so, someone can "post" a light version of that baserule?
    ty for all and sorry for bad eng
  7.  
    Holters:

    Are these lines the same as "minprofit" and "pctprofit"?"


    Not quite. My "relative profit" is based on resale value, not the purchase price. I don't remember why I did it that way round but it's what I'm used to now. By that measure, if the purchase price is 75s, and the resale value is 1g, then relative profit is (100-75)/100 = 0.25. Btm itself would calculate (100-75)/75 = 0.333...

    Desolator:

    To use only your static prices, change the getReagentValue function to use only the upperLimit price, and ignore the median and snapshot.

    You can adjust the priceUpperLimit table as you like, but if you want the rule to ignore certain reagents, set their prices very low, not very high.

    The twink watchlist works fine with high btm settings, yep.

    priceAdjustment: if you don't need it, just set all the values to 1 or remove it (and all references to it).

    The baserule ignores the pctdeprofit and mindeprofit settings - it has its own: bidMinProfitRel etc.
    • CommentAuthorDesolator
    • CommentTimeJun 5th 2007
     
    ty chardonnay, u cleared my mind :P
    just need one more help
    i dunno what must edit to change de getReagentValue function to use only the upperLimit price ingnoring the median and snapshot.
    as i told im a totaly freak at lua code :P
    • CommentAuthorChardonnay
    • CommentTimeJun 5th 2007 edited
     
    local getReagentValue = function(itemID, itemCount)
    local upperLimit = priceUpperLimit[itemID]
    local adjust = priceAdjustment[itemID] or 1

    if not upperLimit then return nil end

    -- ignore the middle

    -- use upperLimit directly
    return upperLimit * adjust * itemCount
    end
    • CommentAuthorDesolator
    • CommentTimeJun 6th 2007 edited
     
    still isnt working, here all things i changed from the original

    1:
    local priceUpperLimit = {
    [22450] = 270000, -- Void Crystal
    [20725] = 25000, -- Nexus Crystal

    [22449] = 120000, -- Large Prismatic Shard
    [14344] = 95000, -- Large Brilliant Shard
    [11178] = 1, -- Large Radiant Shard
    [11139] = 1, -- Large Glowing Shard
    [11084] = 1, -- Large Glimmering Shard

    [22448] = 40000, -- Small Prismatic Shard
    [14343] = 1, -- Small Brilliant Shard
    [11177] = 45000, -- Small Radiant Shard
    [11138] = 1, -- Small Glowing Shard
    [10978] = 1, -- Small Glimmering Shard

    [22446] = 50000, -- Greater Planar Essence
    [16203] = 85000, -- Greater Eternal Essence
    [11175] = 1, -- Greater Nether Essence
    [11135] = 1, -- Greater Mystic Essence
    [11082] = 1, -- Greater Astral Essence
    [10939] = 1, -- Greater Magic Essence

    [22447] = 16000, -- Lesser Planar Essence
    [16202] = 27000, -- Lesser Eternal Essence
    [11174] = 1, -- Lesser Nether Essence
    [11134] = 1, -- Lesser Mystic Essence
    [10998] = 1, -- Lesser Astral Essence
    [10938] = 1, -- Lesser Magic Essence

    [22445] = 15000, -- Arcane Dust
    [16204] = 17000, -- Illusion Dust
    [11176] = 1, -- Dream Dust
    [11137] = 1, -- Vision Dust
    [11083] = 1, -- Soul Dust
    [10940] = 1, -- Strange Dust
    }

    2:
    local priceAdjustment = {
    [VOID] = 1,
    [NEXUS] = 1,

    3:
    return upperLimit * adjust * itemCount

    4:
    -- min profit for bid
    local bidMinProfitRel = 0.50
    local bidMinProfitAbs = 10000

    -- min profit for buy
    local buyMinProfitRel = 0.50
    local buyMinProfitAbs = 10000

    after saved the baserule i reloged and scaned AH, BTM popup me with this deal:
    http://img53.imageshack.us/img53/9462/wowscrnshot060607094354st0.jpg

    since i use 1 cooper value for Greater nether Essece dunno how he show me that, and is just 6% chance do SRS, im not sure if that 6% can count in the deal or BTM still is using acutoneer data ignoring my static prices
    • CommentAuthorChardonnay
    • CommentTimeJun 6th 2007 edited
     
    Posted By: Desolator
    after saved the baserule i reloged and scaned AH, BTM popup me with this deal:
    http://img53.imageshack.us/img53/9462/wowscrnshot060607094354st0.jpg


    That's from BtmScan's built-in disenchant logic, not from the baserule. Adjusting your mindeprofit and/or pctdeprofit settings should get rid of those.
    • CommentAuthorDesolator
    • CommentTimeJun 6th 2007
     
    so if baserule is ok i will start try configs :P ty for all replys and keep the nice work :clap:
    • CommentAuthorCorkyone
    • CommentTimeJun 10th 2007 edited
     
    will it scan for hsp bargains?
    • CommentAuthorChardonnay
    • CommentTimeJun 10th 2007
     
    No, it's very specific in what it looks for. If you want it to look for other things, it shouldn't be too hard to combine it with one of the more general purpose examples on the wiki.
    • CommentAuthorWyko
    • CommentTimeJun 13th 2007
     
    Updated again. It actually works now =)

    local watchList = {
    --[item] = price (copper)

    --mine
    [24275] = 50000, -- Silver Spellthread
    [22829] = 20000, --Super Healing Potion
    [22832] = 12000, -- Super Mana Potion
    [29425] = 10000, -- Mark of Kil'Hed???

    -- 10-19 Weps
    [1935] = 1000000, -- Assassin's Blade
    [1482] = 900000, -- Shadowfang
    [890] = 250000, -- Twisted Chanter's Staff
    [2567] = 350000, -- Evocator's Blade
    [1318] = 340000, -- Night Reaver
    [1484] = 300000, -- Witching Stave

    -- 10-19 armor
    [2059] = 510000, -- Sentry Cloak
    [8350] = 490000, -- The 1 Ring
    [1486] = 490000, -- Tree Bark Jacket
    [1121] = 400000, -- Feet of the Lynx
    [12977] = 300000, -- Magefist Gloves

    -- 20-29 weapons
    [776] = 920000, -- Vendetta
    [4454] = 490000, -- Talon of Vultros
    [8226] = 450000, -- The Butcher
    [4446] = 410000, -- Blackvenom Blade
    [13033] = 400000, -- Zealot Blade
    [3413] = 390000, -- Doomspike
    [7730] = 300000, -- Cobalt Crusher

    -- 20-29 armor
    [9491] = 630000, -- Hotshot Pilot's Gloves
    [2264] = 780000, -- Mantle of Thieves
    [1978] = 530000, -- Wolfclaw Gloves
    [2039] = 500000, -- Plains Ring
    [9510] = 410000, -- Caverndeep Trudgers
    [13108] = 400000, -- Tigerstrike Mantle
    [2278] = 390000, -- Forest Tracker Epaulets
    [2292] = 390000, -- Necrology Robes
    [9509] = 370000, -- Petrolspill Leggings
    [1491] = 360000, -- Ring of Precision
    [7728] = 320000, -- Beguiler Robes
    [12998] = 300000, -- Magician's Mantle

    -- 30-39 weapons
    [873] = 2300000, -- Staff of Jordan
    [2825] = 1200000, -- Bow of Searing Arrows
    [870] = 1200000, -- Fiery War Axe
    [9425] = 1100000, -- Pendulum of Doom
    [869] = 1000000, -- Dazzling Longsword
    [1982] = 1000000, -- Nightblade
    [9424] = 580000, -- Ginn-su Sword
    [868] = 550000, -- Ardent Custodian
    [9426] = 430000, -- Monolithic Bow
    [9718] = 410000, -- Reforged Blade of Heroes
    [8223] = 390000, -- Blade of the Basilisk
    [13034] = 380000, -- Speedsteel Rapier
    [9384] = 380000, -- Stonevault Shiv
    [9392] = 330000, -- Annealed Blade
    [10570] = 320000, -- Manslayer
    [6327] = 320000, -- The Pacifier
    [13064] = 300000, -- Jaina's Firestarter
    [5756] = 300000, -- Sliverblade

    -- 30-39 armor
    [10583] = 1500000, -- Quillward Harness
    [2955] = 1400000, -- First Mate Hat
    [867] = 1100000, -- Gloves of Holy Might
    [9429] = 1100000, -- Miner's Hat of the Deep
    [1981] = 930000, -- Icemail Jerkin
    [7755] = 740000, -- Flintrock Shoulders
    [10574] = 660000, -- Corpseshroud
    [5257] = 540000, -- Dark Hooded Cape
    [9420] = 510000, -- Adventurer's Pith Helmet
    [10328] = 500000, -- Scarlet Chestpiece
    [1204] = 490000, -- The Green Tower
    [9431] = 410000, -- Papal Fez
    [1980] = 400000, -- Underworld Band
    [9396] = 370000, -- Legguards of the Vault
    [10332] = 370000, -- Scarlet Boots
    [13110] = 360000, -- Wolffear Harness
    [1718] = 350000, -- Basilisk Hide Pants
    [2277] = 350000, -- Necromancer Leggings
    [2951] = 350000, -- Ring of the Underwood
    [9375] = 320000, -- Expert Goldminer's Helmet
    [10581] = 310000, -- Death's Head Vestment
    [13117] = 300000, -- Ogron's Sash
    [13084] = 300000, -- Kaleidoscope Chain
    }

    ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    -- Change these variables
    ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    local minProfit = 4.0 -- The minimum amount of profit in gold.
    local safety = 2 --Safety margin. This number represents the number of times you may have to put it up for auction before it sells.
    local pctProfit = 0.35 -- The percentage (in decimal form) of the price of the item that must be profit
    local rareMinSeen = 5 -- Number of times that a rare or higher item should have been seen before considering it
    local commonMinSeen = 30 -- Number of times that an uncommon or common item should have been seen before considering it
    local maxPrice = 150 -- Maximum amount of gold per purchase
    ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    -- Nothing else =D
    ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    local _,_, quality, level, _, class, _,_, equip = GetItemInfo(itemID)

    if ((quality<3 and auctSeen > commonMinSeen) or (quality >= 3 and auctSeen > rareMinSeen)) then
    minProfit = (minProfit*10000) -- Turn it into gold

    maxPrice = (maxPrice*10000) -- Turn it into gold

    safety = (safety*depositCost)

    -- BasePrice will be the total amount this purchase will cost to buy
    basePrice=Auctioneer.Statistic.GetHSP(auctKey)
    basePrice=basePrice * itemCount

    local bidProfit = (basePrice-bidPrice)

    local buyProfit = (basePrice-buyPrice)

    if (basePrice > maxPrice) then -- Cuts this if it would cost too much
    action = "ignore"
    reason = "Costs too much"
    elseif (bidProfit > (minProfit+1+safety) and ((bidProfit-safety) > (bidPrice*pctProfit))) then
    action ="bid"
    reason = "Bid- " .. auctSeen .. " times seen."

    --This checks to see whether it would be more advantageous to buyout rather than bid on an item. Checks if buyout would generate profit after safety.
    if ((buyProfit > (minProfit+safety)) and ((buyProfit-safety) > (buyPrice*pctProfit)) and ((bidProfit < buyProfit) or (buyProfit > (bidProfit*0.85)))) then
    action = "buy"
    reason = "Buyout - " .. auctSeen .. " times seen. CTB." -- Close To Bid
    end

    elseif ((buyProfit > (minProfit+safety)) and ((buyProfit-safety) > (buyPrice*pctProfit))) then
    action = "buy"
    reason = "Buyout - " .. auctSeen .. " times seen."
    else -- Only way it gets here is if the item doesn't match any of the conditions under which we would buy the item.
    action = "ignore"
    reason = "Bad dealz"
    end

    else
    action = "ignore"
    reason = "Not seen enough."
    end

    -- The Watchlist code. This ignores everything the goes on before it. If the thing is on the watchlist, it gets it.
    if watchList[itemID] then
    basePrice = watchList[itemID]
    local bidMax = basePrice * 0.85

    if buyPrice ~= 0 and (buyPrice / itemCount) <= bidMax then
    action = "buy"
    reason = "W-A-T-C-H L-I-S-T B-U-Y"
    elseif bidPrice ~= 0 and (bidPrice / itemCount) <= bidMax then
    action = "bid"
    reason = "W-A-T-C-H L-I-S-T B-I-D"
    end
    basePrice = (basePrice / itemCount) -- Just makes it look right on the report screen
    end


    Comments?
    • CommentAuthorkwslavens
    • CommentTimeJun 30th 2007
     
    Ok... I need some help... I'm confused and getting frustrated.

    On my second machine I can use the command /btm baserule and it works fine. On the first machine /btm always gives me /btmscan isn't loaded messages. If I use /btmscan baserule it works on machine 1. But if I end the same Baserule that compiles fine on Machine 2 into machine one's baserule window which was accessed with the /btmscan baserule command it always gives me Error compiling baserule. I've wipe the .lua file for save variables on machine 1 and I've complete duplicated the addon's folder, and even wiped the addons folder and re downloaded and reinstall the addons.

    is there some way to find out where the compiling error is occuring, what line of the Baserule code? I have swatter and I get nothing on it. Tell me there is some way to trouble shoot this short of doing it one line at a time.

    This is the baserule I am using, which is 99% what is posted here with only modification the item value.

    -- Enchanting reagents
    local VOID = 22450
    local NEXUS = 20725
    local LPRISMATIC = 22449
    local LBRILLIANT = 14344
    local LRADIANT = 11178
    local LGLOWING = 11139
    local LGLIMMERING = 11084
    local SPRISMATIC = 22448
    local SBRILLIANT = 14343
    local SRADIANT = 11177
    local SGLOWING = 11138
    local SGLIMMERING = 10978
    local GPLANAR = 22446
    local GETERNAL = 16203
    local GNETHER = 11175
    local GMYSTIC = 11135
    local GASTRAL = 11082
    local GMAGIC = 10939
    local LPLANAR = 22447
    local LETERNAL = 16202
    local LNETHER = 11174
    local LMYSTIC = 11134
    local LASTRAL = 10998
    local LMAGIC = 10938
    local ARCANE = 22445
    local ILLUSION = 16204
    local DREAM = 11176
    local VISION = 11137
    local SOUL = 11083
    local STRANGE = 10940

    local priceUpperLimit = {
    [22450] = 750000, -- Void Crystal
    [20725] = 75000, -- Nexus Crystal

    [22449] = 180000, -- Large Prismatic Shard
    [14344] = 85000, -- Large Brilliant Shard
    [11178] = 75000, -- Large Radiant Shard
    [11139] = 15000, -- Large Glowing Shard
    [11084] = 5000, -- Large Glimmering Shard

    [22448] = 50000, -- Small Prismatic Shard
    [14343] = 10000, -- Small Brilliant Shard
    [11177] = 50000, -- Small Radiant Shard
    [11138] = 3500, -- Small Glowing Shard
    [10978] = 2500, -- Small Glimmering Shard

    [22446] = 52500, -- Greater Planar Essence
    [16203] = 82500, -- Greater Eternal Essence
    [11175] = 45000, -- Greater Nether Essence
    [11135] = 6000, -- Greater Mystic Essence
    [11082] = 4500, -- Greater Astral Essence
    [10939] = 4500, -- Greater Magic Essence

    [22447] = 17500, -- Lesser Planar Essence
    [16202] = 27500, -- Lesser Eternal Essence
    [11174] = 15000, -- Lesser Nether Essence
    [11134] = 2000, -- Lesser Mystic Essence
    [10998] = 1500, -- Lesser Astral Essence
    [10938] = 1500, -- Lesser Magic Essence

    [22445] = 18500, -- Arcane Dust
    [16204] = 17500, -- Illusion Dust
    [11176] = 5000, -- Dream Dust
    [11137] = 1500, -- Vision Dust
    [11083] = 1500, -- Soul Dust
    [10940] = 750, -- Strange Dust
    }

    -- A price adjustment to favour/disfavour particular reagents
    -- depending on the market and how much of the reagent I have
    -- already. Set manually, but I am working on automating this
    local priceAdjustment = {
    [VOID] = 0.5,
    [NEXUS] = 0.5,

    [LPRISMATIC] = 0.8,
    [LBRILLIANT] = 0.8,
    [LRADIANT] = 0.8,
    [LGLOWING] = 0.7,
    [LGLIMMERING] = 0.7,

    [SPRISMATIC] = 0.8,
    [SBRILLIANT] = 0.8,
    [SRADIANT] = 0.8,
    [SGLOWING] = 0.7,
    [SGLIMMERING] = 0.7,

    [GPLANAR] = 0.8,
    [GETERNAL] = 0.8,
    [GNETHER] = 0.8,
    [GMYSTIC] = 0.8,
    [GASTRAL] = 0.8,
    [GMAGIC] = 0.8,

    [LPLANAR] = 0.8,
    [LETERNAL] = 0.8,
    [LNETHER] = 0.8,
    [LMYSTIC] = 0.8,
    [LASTRAL] = 0.8,
    [LMAGIC] = 0.8,

    [ARCANE] = 0.7,
    [ILLUSION] = 0.7,
    [DREAM] = 0.7,
    [VISION] = 0.7,
    [SOUL] = 0.7,
    [STRANGE] = 0.7,
    }

    -- item types
    local WEAPON = 0
    local ARMOR = 1

    -- item qualities
    local UNCOMMON = 2
    local RARE = 3
    local EPIC = 4

    -- convert an item type string to an integer type
    local typeStringToType = {
    ["Weapon"] = WEAPON,
    ["Armor"] = ARMOR,
    }

    -- disenchanting level bracket upper bounds, e.g. an ilevel 52 item
    -- goes into bracket 55
    local levelUpperBounds = { 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 85, 99, 120 }

    -- bad items that look like they should be disenchantable but aren't
    local badItem = {
    [11287] = {}, -- Lesser Magic Wand
    [11288] = {}, -- Greater Magic Wand
    [11289] = {}, -- Lesser Mystic Wand
    [11290] = {}, -- Greater Mystic Wand
    [20406] = {}, -- Twilight Cultist Mantle
    [20407] = {}, -- Twilight Cultist Robe
    [20408] = {}, -- Twilight Cultist Cowl
    }

    -- the big disenchant table, indexed by [quality][type][level bracket]
    -- and yielding { { reagent type, drop probability, average drop quantity }, ... }
    -- I would use Enchantrix, but it lacks data for new items
    local disenchantTable = {
    [UNCOMMON] = {
    [WEAPON] = {
    [15] = { { STRANGE , 0.20, 1.5 }, { LMAGIC , 0.80, 1.5 }, },
    [20] = { { STRANGE , 0.20, 2.5 }, { GMAGIC , 0.75, 1.5 }, { SGLIMMERING, 0.05, 1.0 }, },
    [25] = { { STRANGE , 0.15, 5.0 }, { GMAGIC , 0.75, 1.5 }, { SGLIMMERING, 0.10, 1.0 }, },
    [30] = { { SOUL , 0.20, 1.5 }, { GMAGIC , 0.75, 1.5 }, { LGLIMMERING, 0.05, 1.0 }, },
    [35] = { { SOUL , 0.20, 3.5 }, { LMYSTIC , 0.75, 1.5 }, { SGLOWING , 0.05, 1.0 }, },
    [40] = { { VISION , 0.20, 1.5 }, { GMYSTIC , 0.75, 1.5 }, { LGLOWING , 0.05, 1.0 }, },
    [45] = { { VISION , 0.15, 3.5 }, { LNETHER , 0.80, 1.5 }, { SRADIANT , 0.05, 1.0 }, },
    [50] = { { DREAM , 0.20, 1.5 }, { GNETHER , 0.75, 1.5 }, { LRADIANT , 0.05, 1.0 }, },
    [55] = { { DREAM , 0.20, 3.5 }, { LETERNAL, 0.75, 1.5 }, { SBRILLIANT , 0.05, 1.0 }, },
    [60] = { { ILLUSION, 0.20, 1.5 }, { GETERNAL, 0.75, 1.5 }, { LBRILLIANT , 0.05, 1.0 }, },
    [65] = { { ILLUSION, 0.20, 3.5 }, { GETERNAL, 0.75, 2.5 }, { LBRILLIANT , 0.05, 1.0 }, },
    [85] = { { ARCANE , 0.20, 2.5 }, { LPLANAR , 0.75, 2.5 }, { SPRISMATIC , 0.05, 1.0 }, },
    [99] = { { ARCANE , 0.20, 2.5 }, { LPLANAR , 0.75, 2.5 }, { SPRISMATIC , 0.05, 1.0 }, },
    [120] = { { ARCANE , 0.20, 3.5 }, { GPLANAR , 0.75, 1.5 }, { LPRISMATIC , 0.05, 1.0 }, },
    },
    [ARMOR] = {
    [15] = { { STRANGE , 0.80, 1.5 }, { LMAGIC , 0.20, 1.5 }, },
    [20] = { { STRANGE , 0.75, 2.5 }, { GMAGIC , 0.20, 1.5 }, { SGLIMMERING, 0.05, 1.0 }, },
    [25] = { { STRANGE , 0.75, 5.0 }, { LASTRAL , 0.15, 1.5 }, { SGLIMMERING, 0.10, 1.0 }, },
    [30] = { { SOUL , 0.75, 1.5 }, { GASTRAL , 0.20, 1.5 }, { LGLIMMERING, 0.05, 1.0 }, },
    [35] = { { SOUL , 0.75, 3.5 }, { LMYSTIC , 0.20, 1.5 }, { SGLOWING , 0.05, 1.0 }, },
    [40] = { { VISION , 0.75, 1.5 }, { GMYSTIC , 0.20, 1.5 }, { LGLOWING , 0.05, 1.0 }, },
    [45] = { { VISION , 0.80, 3.5 }, { LNETHER , 0.15, 1.5 }, { SRADIANT , 0.05, 1.0 }, },
    [50] = { { DREAM , 0.75, 1.5 }, { GNETHER , 0.20, 1.5 }, { LRADIANT , 0.05, 1.0 }, },
    [55] = { { DREAM , 0.75, 3.5 }, { LETERNAL, 0.20, 1.5 }, { SBRILLIANT , 0.05, 1.0 }, },
    [60] = { { ILLUSION, 0.75, 1.5 }, { GETERNAL, 0.20, 1.5 }, { LBRILLIANT , 0.05, 1.0 }, },
    [65] = { { ILLUSION, 0.75, 3.5 }, { GETERNAL, 0.20, 2.5 }, { LBRILLIANT , 0.05, 1.0 }, },
    [85] = { { ARCANE , 0.75, 2.5 }, { LPLANAR , 0.20, 2.5 }, { SPRISMATIC , 0.05, 1.0 }, },
    [99] = { { ARCANE , 0.75, 2.5 }, { LPLANAR , 0.20, 2.5 }, { SPRISMATIC , 0.05, 1.0 }, },
    [120] = { { ARCANE , 0.75, 3.5 }, { GPLANAR , 0.20, 1.5 }, { LPRISMATIC , 0.05, 1.0 }, },
    },
    },
    [RARE] = {
    [WEAPON] = {
    [20] = { { SGLIMMERING, 1.00, 1.0 }, }, [25] = { { SGLIMMERING, 1.00, 1.0 }, },
    [30] = { { LGLIMMERING, 1.00, 1.0 }, }, [35] = { { SGLOWING , 1.00, 1.0 }, },
    [40] = { { LGLOWING , 1.00, 1.0 }, }, [45] = { { SRADIANT , 1.00, 1.0 }, },
    [50] = { { LRADIANT , 1.00, 1.0 }, }, [55] = { { SBRILLIANT , 1.00, 1.0 }, },
    [60] = { { LBRILLIANT , 0.99, 1.0 }, { NEXUS, 0.01, 1.0 }, },
    [65] = { { LBRILLIANT , 0.99, 1.0 }, { NEXUS, 0.01, 1.0 }, },
    [85] = { { SPRISMATIC , 0.99, 1.0 }, { NEXUS, 0.01, 1.0 }, },
    [99] = { { SPRISMATIC , 0.99, 1.0 }, { VOID , 0.01, 1.0 }, },
    [120] = { { LPRISMATIC , 0.99, 1.0 }, { VOID , 0.01, 1.0 }, },
    },
    [ARMOR] = {
    [20] = { { SGLIMMERING, 1.00, 1.0 }, }, [25] = { { SGLIMMERING, 1.00, 1.0 }, },
    [30] = { { LGLIMMERING, 1.00, 1.0 }, }, [35] = { { SGLOWING , 1.00, 1.0 }, },
    [40] = { { LGLOWING , 1.00, 1.0 }, }, [45] = { { SRADIANT , 1.00, 1.0 }, },
    [50] = { { LRADIANT , 1.00, 1.0 }, }, [55] = { { SBRILLIANT , 1.00, 1.0 }, },
    [60] = { { LBRILLIANT , 0.99, 1.0 }, { NEXUS, 0.01, 1.0 }, },
    [65] = { { LBRILLIANT , 0.99, 1.0 }, { NEXUS, 0.01, 1.0 }, },
    [85] = { { SPRISMATIC , 0.99, 1.0 }, { NEXUS, 0.01, 1.0 }, },
    [99] = { { SPRISMATIC , 0.99, 1.0 }, { VOID , 0.01, 1.0 }, },
    [120] = { { LPRISMATIC , 0.99, 1.0 }, { VOID , 0.01, 1.0 }, },
    },
    },
    [EPIC] = {
    [WEAPON] = {
    [45] = { { SRADIANT , 1.00, 3.5 }, }, [50] = { { LRADIANT , 1.00, 3.5 }, },
    [55] = { { SBRILLIANT, 1.00, 3.5 }, }, [60] = { { NEXUS , 1.00, 1.0 }, },
    [65] = { { NEXUS , 1.00, 1.0 }, }, [85] = { { NEXUS , 1.00, 1.0 }, },
    [99] = { { VOID , 1.00, 1.0 }, }, [120] = { { VOID , 1.00, 1.5 }, },
    },
    [ARMOR] = {
    [45] = { { SRADIANT , 1.00, 3.5 }, }, [50] = { { LRADIANT , 1.00, 3.5 }, },
    [55] = { { SBRILLIANT, 1.00, 3.5 }, }, [60] = { { NEXUS , 1.00, 1.0 }, },
    [65] = { { NEXUS , 1.00, 1.0 }, }, [85] = { { NEXUS , 1.00, 1.0 }, },
    [99] = { { VOID , 1.00, 1.0 }, }, [120] = { { VOID , 1.00, 1.5 }, },
    },
    },
    }

    ----------------------------------------

    local watchList = {
    -- 10-19 weapons
    [1935] = 1500000, -- Assassin's Blade
    [1482] = 1300000, -- Shadowfang
    [890] = 360000, -- Twisted Chanter's Staff
    [2567] = 350000, -- Evocator's Blade
    [1318] = 340000, -- Night Reaver
    [1484] = 300000, -- Witching Stave

    -- 10-19 armor
    [2059] = 510000, -- Sentry Cloak
    [8350] = 490000, -- The 1 Ring
    [1486] = 490000, -- Tree Bark Jacket
    [1121] = 400000, -- Feet of the Lynx
    [12977] = 300000, -- Magefist Gloves

    -- 20-29 weapons
    [776] = 920000, -- Vendetta
    [4454] = 490000, -- Talon of Vultros
    [8226] = 450000, -- The Butcher
    [4446] = 410000, -- Blackvenom Blade
    [13033] = 400000, -- Zealot Blade
    [3413] = 390000, -- Doomspike
    [7730] = 300000, -- Cobalt Crusher

    -- 20-29 armor
    [9491] = 630000, -- Hotshot Pilot's Gloves
    [2264] = 780000, -- Mantle of Thieves
    [1978] = 530000, -- Wolfclaw Gloves
    [2039] = 500000, -- Plains Ring
    [9510] = 410000, -- Caverndeep Trudgers
    [13108] = 400000, -- Tigerstrike Mantle
    [2278] = 390000, -- Forest Tracker Epaulets
    [2292] = 390000, -- Necrology Robes
    [9509] = 370000, -- Petrolspill Leggings
    [1491] = 360000, -- Ring of Precision
    [7728] = 320000, -- Beguiler Robes
    [12998] = 300000, -- Magician's Mantle

    -- 30-39 weapons
    [873] = 2300000, -- Staff of Jordan
    [2825] = 1200000, -- Bow of Searing Arrows
    [870] = 1200000, -- Fiery War Axe
    [9425] = 1100000, -- Pendulum of Doom
    [869] = 1000000, -- Dazzling Longsword
    [1982] = 1000000, -- Nightblade
    [9424] = 580000, -- Ginn-su Sword
    [868] = 550000, -- Ardent Custodian
    [9426] = 430000, -- Monolithic Bow
    [9718] = 410000, -- Reforged Blade of Heroes
    [8223] = 390000, -- Blade of the Basilisk
    [13034] = 380000, -- Speedsteel Rapier
    [9384] = 380000, -- Stonevault Shiv
    [9392] = 330000, -- Annealed Blade
    [10570] = 320000, -- Manslayer
    [6327] = 320000, -- The Pacifier
    [13064] = 300000, -- Jaina's Firestarter
    [5756] = 300000, -- Sliverblade

    -- 30-39 armor
    [10583] = 1500000, -- Quillward Harness
    [2955] = 1400000, -- First Mate Hat
    [867] = 1100000, -- Gloves of Holy Might
    [9429] = 1100000, -- Miner's Hat of the Deep
    [1981] = 930000, -- Icemail Jerkin
    [7755] = 740000, -- Flintrock Shoulders
    [10574] = 660000, -- Corpseshroud
    [5257] = 540000, -- Dark Hooded Cape
    [9420] = 510000, -- Adventurer's Pith Helmet
    [10328] = 500000, -- Scarlet Chestpiece
    [1204] = 490000, -- The Green Tower
    [9431] = 410000, -- Papal Fez
    [1980] = 400000, -- Underworld Band
    [9396] = 370000, -- Legguards of the Vault
    [10332] = 370000, -- Scarlet Boots
    [13110] = 360000, -- Wolffear Harness
    [1718] = 350000, -- Basilisk Hide Pants
    [2277] = 350000, -- Necromancer Leggings
    [2951] = 350000, -- Ring of the Underwood
    [9375] = 320000, -- Expert Goldminer's Helmet
    [10581] = 310000, -- Death's Head Vestment
    [13117] = 300000, -- Ogron's Sash
    [13084] = 300000, -- Kaleidoscope Chain
    }

    ----------------------------------------

    -- calculate value of a stack of reagents based on
    -- auctioneer data and price tables above
    local getReagentValue = function(itemID, itemCount)
    local upperLimit = priceUpperLimit[itemID]
    local adjust = priceAdjustment[itemID] or 1

    if not upperLimit then return nil end

    local median, snapshot, snapshotCount = nil, nil, nil
    local _, link = GetItemInfo(itemID)
    if link then
    local key = Auctioneer.ItemDB.CreateItemKeyFromLink(link)
    if key then
    median = Auctioneer.Statistic.GetItemHistoricalMedianBuyout(key)
    snapshot, snapshotCount = Auctioneer.Statistic.GetItemSnapshotMedianBuyout(key)
    end
    end

    median = median or upperLimit
    snapshot = snapshot or upperLimit
    snapshotCount = snapshotCount or 1

    median = math.min(median, upperLimit)
    snapshot = math.min(snapshot, upperLimit)

    local snapshotWeight = 0
    if snapshotCount >= 5 and snapshot <median>= level then
    return bracket
    end
    end
    return nil
    end

    -- get entry from disenchant table (or nil if nothing found)
    local getDisenchants = function(quality, type, level)
    if disenchantTable[quality] and disenchantTable[quality][type] and disenchantTable[quality][type][level] then
    return disenchantTable[quality][type][level]
    end
    return nil
    end

    -- calculate disenchant value of item based on disenchant table and
    -- calculated reagent values
    local getDisenchantValue = function(itemID)
    local result = nil
    local _, _, quality, level, _, typeString, _, _, _, _ = GetItemInfo(itemID)
    if quality >= UNCOMMON and quality <= EPIC and not badItem[itemID] then
    local type = typeStringToType[typeString]
    if type then
    level = roundupLevel(level)
    if level then
    local disenchants = getDisenchants(quality, type, level)
    if disenchants then
    result = 0
    for _, stats in pairs(disenchants) do
    local reagent, chance, count = stats[1], stats[2], stats[3]
    result = result + getReagentValue(reagent, chance * count)
    end
    end
    end
    end
    end
    return result
    end

    --------------------------------------------------------------------------------
    -- now decide what to do with the auction

    -- min profit for bid
    local bidMinProfitRel = 0.25
    local bidMinProfitAbs = 5000

    -- min profit for buy
    local buyMinProfitRel = 0.25
    local buyMinProfitAbs = 5000

    -- if buyout is close enough to low enough bid, just buy it anyway
    local buyMaxBidNear = 0.01

    -- adjust low bids upwards, but no closer to maximum bid than this
    local bidLess = 0.20

    -- assume item is worthless until proven otherwise
    basePrice = 0

    -- calculate disenchant value or reagent value depending on the type of item
    local disenchantValue = getDisenchantValue(itemID)
    if disenchantValue then
    basePrice = disenchantValue
    reason = "Disenchant"
    depositCost = 0
    depositRate = 0
    else
    local reagentValue = getReagentValue(itemID, itemCount)
    if reagentValue then
    basePrice = reagentValue
    reason = "Reagent"
    depositCost = 0
    depositRate = 0
    end
    end

    -- account for AH cut
    local resaleValue = basePrice * 0.95

    -- decide whether or not to buy

    local buyMaxRel = resaleValue * (1 - buyMinProfitRel)
    local buyMaxAbs = resaleValue - buyMinProfitAbs
    local bidMaxRel = resaleValue * (1 - bidMinProfitRel)
    local bidMaxAbs = resaleValue - bidMinProfitAbs

    if watchList[itemID] then
    basePrice = watchList[itemID]
    local bidMax = basePrice * 0.85
    if buyPrice ~= 0 and buyPrice <= bidMax then
    action = "buy"
    reason = "Watch List"
    elseif bidPrice ~= 0 and bidPrice <= bidMax then
    action = "bid"
    reason = "Watch List"
    end
    else
    if buyPrice ~= 0 and buyPrice <= buyMaxRel and buyPrice <= buyMaxAbs then
    action = "buy"
    reason = reason .. " (buy)"
    elseif bidPrice ~= 0 and bidPrice <= bidMaxRel and bidPrice <bidMaxAbs>= buyPrice * (1 - buyMaxBidNear) then
    action = "buy"
    reason = reason .. " (buy near bid)"
    else
    action = "bid"
    reason = reason .. " (bid, orig = " .. bidPrice .. ")"
    local bidRelUp = (resaleValue * (1 - bidMinProfitRel)) * (1 - bidLess)
    local bidAbsUp = (resaleValue - bidMinProfitAbs) * (1 - bidLess)
    bidPrice = math.max(bidPrice, math.min(bidRelUp, bidAbsUp))
    end
    end
    end