TSM4 Masterclass: Using if functions to make more sophisticated price strings

I struggled with the title for this post as the idea is not too easy to explain in a single sentence. Today I will show you how you can use a single auctioning and shopping operation to implement several different pricing rules based on the value of the item you are buying and selling. Essentially this will set different price levels relative to dbmarket for items worth 1000 gold than for items worth 10000 gold. This can be very useful for markets like battle pets and transmog.

Why?

So let’s talk about why. This actually goes all the way back to what I think the purpose of gold making is, which is to maximize your raw gold profits. Expensive items are generally rarer than cheap items. So the rarer something is the more you will be willing to pay for it relative to the market value. Because you can expect to sell it closer to or even above market value because it is rare and the competition is thus low.

A TCG pet at 80% region market value is a MUCH better deal than a random 1000 gold pet at 80% region market value.

This approach is already very famous as it is used in BilisOnyxia’s sniper string which is incredibly widespread.

How?

Doing this requires you to make a quite substantial custom price string. The easiest way is to use a large set of nested if statements. This will start at the top of the price range, and compare the value of the item you want to buy or post to a hard coded gold value. If the value is higher then the first price level is chosen, if it is not the evaluation will skip to the next if-statement and check if the value is higher than some new lower gold level.

A simple approach is shown below where we want to use 100%dbmarket for items with a dbmarket above 10 000 gold, 80%dbmarket for items worth between 10 000 and 5000 and 70%dbmarket for items worth less than that.

ifgt(dbmarket,10000g,100%dbmarket,ifgt(dbmarket, 5000g,80%dbmarket,70%dbmarket))

The ifgt(a,b,c,d) checks if a is greater than b, if it is then it returns c otherwise it returns d. For this example d is another ifgt() function that evaluates again. If you want a deeper understanding of this behaviour I suggest checking any programming tutorial on IF-statements.

Expanding on the concept and looking at use cases

These strings can be extended to make some very complex pricing curves. The setup makes sense in a lot of markets where you want to change the auctioning or shopping behaviour based on the value of an item.

I personally use this in my battle pet flipping setup where I use a large number of ifgt statements to change the behaviour based on the price point.

You can also use this in a material sniping operation to avoid items worth less than a certain threshold as you may not want to deal with the hassle of having them in your inventory.

A string for that would look like this:

ifgt(dbmarket,2g,70%dbmarket,1c)

Get creative

There are tons of variations you can use with the basic building block of the ifgt() function. So think about your markets and cases where you may want to have two or more different behaviours depending on some value. It is incredibly useful!

If you want to level up your gold making come join me on Patreon and get access to awesome rewards like Early Access to all my posts. 

2 thoughts on “TSM4 Masterclass: Using if functions to make more sophisticated price strings

    1. You use them in shopping operations, auctioning operations etc. This is meant for players who are already fairly comfortable with how TSM functions and who want to make pricing strings with more differentiated behaviour.

Have a question or a thought? Leave it here:

This site uses Akismet to reduce spam. Learn how your comment data is processed.