Many users have become somewhat aware of the check() function in TSM3 thanks to the popularity of BilisOnyxia’s TSM sniper string
. In my own personal experience, check() is definitely something that at times can be hard to wrap your brain around. I’m pretty sure I used TSM for over a year before I fully understood it!
To quickly explain check(), you can feed it 2 to 3 values in the format of check(a, b, c) where “c” can be optional. These 3 values can be any value TSM recognizes, from custom prices to flat gold values, to simple price source references like DBMarket. The check() function then takes a look at “a”, and looks to see if it is valid and greater than 0. If “a” is not valid, the custom price returns invalid. If “a” is greater than 0, the custom price will give you the value of “b” back, otherwise it gives the value for “c”. If you did not supply a value for “c” and “a” is not is not greater than 0, then the whole thing is treated as invalid.
In TSM4, one of our main goals was to expand on the logic-based functionality of the check() function and make it easier and more intuitive for our users to incorporate logic in their custom prices. With that in mind, TSM4 adds the following new functions:
ifgt() – “If Greater Than”
ifgte() – “If Greater Than or Equal To”
iflt() – “If Less Than”
iflte() – “If Less Than or Equal To”
ifeq()- “If Equal”
round() – “Standard Rounding”
roundup() – “Always Round Up – aka Ceiling”
rounddown() – “Always Round Down – aka Floor”