BottomScanner/BaseRule

Fra Norganna's AddOns

Skift til: Navigation, Søgning


Indholdsfortegnelse

BaseRule Basics

BottomScanner's BaseRule lets you customize BottomScanner to provide flexible, but at the same time precise, control over the items BottomScanner suggests as purchase opportunities.

What skills do I need to use a BaseRule?

In order to provide custom BaseRule functionality, you will have to provide BottomScanner with some snippets written in Lua. If you don't know how to program in Lua yourself, you have a few options available:

  • You might want to try some of the sample BaseRules which are provided here in this wiki entry - just copy and paste them as described below
  • Additional BaseRules might be posted in our forums for you to copy and paste
  • Or you can just leave the BaseRule blank, and BottomScanner will use the default BaseRule to decide on the value of each item (which simply takes the lower of the "sanity" price and the Auctioneer median price, and multiplies it by the number of items in the stack)

If you do know Lua (or are willing to learn), then you'll find some useful information for constructing your BaseRule in this wiki entry.

What is a BaseRule used for?

The BaseRule is primarily used by BottomScanner to help calculate profitability for "resale" opportunities (when you buy the item now and then resell it on the AH for a higher amount). BottomScanner basically asks the BaseRule to calculate each item's valuation, which answers the question: how much is this item worth after deducting the various AH fees I will be saddled with?

The BaseRule can also be used to instruct BottomScanner to just bid/buy the item, regardless of the various profitability calculations it wants to perform. For example, you might want to tell it: buy all level 30 or below green items which are selling for less than 1g.

What isn't a BaseRule used for?

When BottomScanner suggests purchasing items for "disenchant" and for "vendor", it is not using the BaseRule at all. There is nothing you can do in a BaseRule which will make the disenchant or vendor purchase suggestion any more or less likely. These things are only controllable using the BottomScanner commands mindeprofit, pctdeprofit, and vendprofit.


Creating a BaseRule

BaseRule Variables Available

When you write your rule, you will have the following variables at your disposal:

  • Auctioneer data
    • auctKey = A key that is passed to Auctioneer functions to identify this item
    • auctPrice = The median price that Auctioneer recommends for this item
    • auctSeen = The number of item sightings used by Auctioneer to calculate the median
  • Item data
    • itemID = The integer itemID that uniquely identifies this item
    • itemRand = The integer randomEnchantmentID that indicates this item's type
    • itemEnch = The integer enchantmentID that indicates the presence of user enchantments
    • itemCount = The number of items in this stack
    • bidPrice = The price that this item can be bid on for
    • buyPrice = The price that this item can be bought out for
  • Price and fee data
    • basePrice = The original basePrice that BottomScanner would use normally
    • depositCost = The cost of this item's deposit fee at a faction AH for 24 hours (multiply this by 5 for neutral AH)
    • depositRate = The current faction's deposit rate.
    • cutRate = The current faction's "cut" rate (how much of the sale price they take out)
  • Sanity price data - Note: This data has not been updated since TBC release, and (for old items it is available for) may be quite stale
    • consKey = A key that is passed to BottomScanner functions to identify the item.
    • consMean = The mean value that appears in the BottomScanner tooltips as IQR Mean
    • consPrice = The conservative value that appears in the BottomScanner tooltips
    • consSeen = The number of auctions that were used in the calculation of the built-in price

BaseRule "Outputs"

The variables that are used to return data back to the main BottomScanner control operation are listed below. Any useful BaseRule should set either the basePrice or the action (or both):

  • basePrice = The new basePrice that BottomScanner should use for the valuation. If you set this value, consider optionally setting the following as well:
    • auctionFee = The auction fee (aka AH "cut") that you want BottomScanner to show in it's tooltip. If you don't set this, BottomScanner will calculate it based on the returned basePrice, so if your BaseRule already incorporated the fee into the basePrice itself, you probably want to ensure you set this variable to that same value or your numbers will appear a little inconsistent
    • depositCost = The new depositCost of this item (you should probably leave this alone, even if your BaseRule deducts multiples of the deposit cost in its calculations)
  • action = Request that BottomScanner take a specific action. Can be one of: "bid", "buy", "ignore". If you set this value, consider also setting:
    • reason = The reason why the action was taken. This will be listed in the item history and is for your reference only.

Entering the BaseRule in game

You probably want to work on your BaseRule in a word processor or other text/Lua editor outside of the game. Once you have it ready, select the whole thing, and hit Ctrl-C to copy it to your clipboard. Then launch the game, and in the chat line type {{ #slashcmd: /btm baserule }}, which will bring up a popup dialog for you to paste the rule into. Alternately, if your BaseRule is simple enough to fit on one line, you can use: {{ #slashcmd: /btm baserule [rule] }}


BaseRule Examples

Here's some examples of BaseRules.

The first group contains examples that are compatible with the original BottomFeeder implementation, which basicly bought up items since you could resell them for a good profit (which base you gave as input).
The second group contains some examples that make use of the possibilities to buy things for other reasons than the "buy for profit" reason.

Just type {{ #slashcmd: /btm baserule }} by itself to pop up a dialog box, where you can copy and paste the below rules to test them out.

Standard BaseRule Examples

if auctPrice>consPrice*3 then
  basePrice=consPrice
else
  basePrice=auctPrice
end

This rule says to use auctioneer's pricing, unless it's more than 3 times the conservative price.

basePrice=(auctPrice*2+consPrice)/3

Combine 2/3rds auctioneer price and 1/3rds conservative price.

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

Make the basePrice what Auctioneer would post the item up for using it's default HSP algorithm.

local base

-- if auctioneer doesn't know the price or has seen it less than twice
if (auctPrice == 0 or auctSeen < 2) then
  -- make base = 3/4 conservative price
  base = consPrice * 0.75

-- else if auctioneer is more than 3 time the conservative
elseif (auctPrice > 3 * consPrice) then
  -- make base = 3:1 weighted average of prices in favor of conservative
  base = (3 * consPrice + auctPrice) / 4

-- else if auctioneer price is less than 1.2 times the conservative
elseif (auctPrice < consPrice * 1.2) then
  -- just use auctioneer's price
  base = auctPrice

-- otherwise, auctioneer's more than 1.2 and less than 3 times the conservative
else
  -- make base = 3:1 weighted average of prices in favor of auctioneer
  base = (consPrice + 3 * auctPrice) / 4
end

-- set the auctionFee, so that the tooltip knows it's been accounted for
auctionFee = cutRate * base

-- value the item at base - 3* deposit - the auction fee
basePrice = base - 3*depositCost - auctionFee

This one is based on the one that Norganna originally used. The only difference is that it takes into account that an item often needs at least 3 relistings (thus 3* the deposit costs) before it sells (suggested by ElGuapo). It's reasonably complex and does different things according to the proportions of the auctioneer median, and conservative pricing.

Some people have merged bits and pieces of the above rules together to form hybrid rules, or written completely different rules based off proprietary information that they may have access to.

Extended BaseRule examples

local _,_, quality, level, _, class, _,_, equip = GetItemInfo(itemID)
if (quality>=2 and level < 20 and class =="Weapon" and equip and buyPrice < 9000) then
  action="buy"
  reason="de"
end

This will recommend buying any equippable, green, below level 20 and 90 silver.

local watchList = {
  --[item] = price (copper)
  [6364]  = 100000, -- 32 Pound Catfish
  [13917] = 300000, -- 103 Pound Mightfish
  [6295]  = 30000,  -- 15 Pound Mud Snapper
  -- ... and so on ...
}

if watchList[itemID] and buyPrice ~= 0 and buyPrice <= watchList[itemID] then
  action = "buy"
  reason = "watchlist"
end

On the forum Chardonnay came with this example to show that you can use BottomScanner to keep track of your favourite items. Basically it suggest buying an item from the watchlist if the price is between 0 and the price in your watchlist. Although using {{ #slashcmd: /btm snatch <item> <copper> [<count>]}} (see the Commands section) would do the same (suggest to buy the items if they are cheaper than a certain price), it is a very nice example of what you can do with the new extended baserules.

BaseRule Scratch

The following page is meant for you to share your BaseRules: BaseRule Scratch

Closing Thoughts

The closer you can make your BaseRule match your personal beliefs about what makes a good auction, the happier you will be with the number and frequency with which it pops up purchasing opportunities.

Personlige værktøjer