Custom price sources allow the user far more in-depth control over how prices are calculated. Below is a list of all the currently supported options for setting a custom price field.
Fixed Gold Amount
Of course, a simple gold amount is supported. NOTE: Only one gold amount may be present in a custom price source. However, any number of gold amounts can be specified by copper as a raw number as shown by the last example below.
100g50s10c 100g 50s 10c 10g 1c 50000
As is popular in v1.x of TSM_Auctioning, you can set the price based on some price source. In order to specify a particular price source, the key in the list printed by "/tsm sources" should be used. As with everything in a custom price source, the key is case insensitive. The below examples simply set the price to 100% of the price source value. See the examples under Basic Math Operators for more info on combining price sources with percentages and math operators.
avgBuy (Average Purchase Price) avgSell (Average Price sold at) Crafting (Crafting Cost) dbmarket (AuctionDB - Market Value) DBMinBuyout (AuctionDB - Minimum Buyout) Disenchant (Disenchant Value) matPrice (Crafting Materail Cost/Value) VendorBuy (Price to purchase from a vendor) VendorSell (Price to sell to a vendor)
Basic Math Operators
All four base math operations (+, -, *, /) as well as percent (%) are supported to mathematically combine multiple things together. Note that the percent operator works with all other fields and not just price sources. The percent symbol will simply be replaced with "/100 *", meaning "150% auctiondb" is equivalent to "150/100 * auctiondb" and either way is equally valid. Note that standard lua order of operations applies.
100% dbmarket + 100g 50% crafting + 10% dbmarket 1.5 * crafting + dbmarket 150% 100g + 2 * dbminbuyout
Any number of nested or non-nested parentheses are supported.
1.5 * (crafting + dbmarket) (crafting * (dbminbuyout / dbmarket) + 20g) * 1.5
min() and max()
Both the min() and max() functions are supported. The min/max calls should follow standard lua syntax, with each parameter being comma separated and all the parameters going inside of parenthesis.
1.5 * min(crafting, dbmarket) max(vendorbuy * 10, dbminbuyout) min(min(vendorbuy * 10, dbmarket), crafting)
This function is useful for having fallback price sources when some may be invalid. It will return the first valid price source parameter that is passed to it (in order from left to right).
first(dbminbuyout, dbmarket, 100g) first(crating, dbmarket)
This is a special function for dealing with item conversions. The syntax of convert() also follows standard lua syntax with a required price source parameter which determines the price source to be used in calculating the value of the items which convert to the target item. This parameter cannot be a custom price string.
conversions include milling, prospecting, transforming (e.g. greater essences to lesser essences and vice versa) and also vendor trades for inks.
the function will return the lowest cost of all possible conversions of the item.
convert(dbmarket) 100g + 2 * convert(dbminbuyout)
Any price source can be called on another item by providing an itemLink or itemString within parentheses after the price source. Essentially, you can use the price sources as functions with a single, itemLink or itemString, parameter. This also works with convert() as a second parameter. The itemString may be in either short (item:XXXXX) or long (item:XXXXX:0:0:0:0:0:X) form.
dbmarket([Silkweed]) + 20g dbmarket(item:72235) * 2 dbmarket + convert(dbminbuyout, item:79251)
This function returns the value of the given material, based on the Material Cost Method formula used in the Crafting > Materials tab of the main TSM window. This is useful for setting other materials, or basing your auctioning/crafting operations off of the cost/value of specific materials. This function can also be called within the convert function if necessary.
matprice([Spirit Dust]) matprice(item:74249) matprice([Ghost Iron Ore]) * 20
This function returns the cost to craft a given item. The value of this is the sum of all the matprice functions for the materials needed to craft the given item. As with all function you can pass this an item as explained above.
crafting crafting(item:93453) crafting([Crafted Dreadful Gladiator's Dreadplate Chestpiece]) **Crafting cost of a glyph** Crafting = matprice(a) + (matprice(b)*3)
This function returns the value of the materials you would acquire if you disenchanted a given item. This function can be useful when compared to the vendorsell function to determine which may be more profitable.
disenchant disenchant(item:93453) disenchant([Crafted Dreadful Gladiator's Dreadplate Chestpiece])