Register
Results 1 to 6 of 6
  1. #1
    Sapu94's Avatar
    Posts
    7,114
    Reputation
    345
    Blog Entries
    25
    Tagged in
    1928 Posts
    Add to this user's reputation

    Introducing TradeSkillMaster v2.7: Bringing Logic to Custom Prices

    This new feature is from one of the most highly voted suggestions! Adding logic to custom prices has been something that has seen much discussion, even outside the suggestions site. The primary challenge was coming up with a simple way of implementing it, without adding a bunch of new variables to custom prices which were not actual prices and could confuse users and lead to them easily messing up their prices.

    Logic is new available in custom prices via the new check(...) function. This function takes either 2 or 3 parameters. It will check if the first parameter is greater than zero. If this is the case, it will return the second parameter as the result. If the first parameter is not greater than zero (aka less than or equal to zero), then it will return the third parameter as the result. Below are some examples:

    • check(1, 5, 2) => 5
    • check(-1, 5, 2) => 2
    • check(0, 5, 2) => 2
    • check(50g-100g, 1g, 2g) => 2g
    • check(dbminbuyout-vendorbuy, dbmarket, avgbuy) => (assuming vendorbuy < dbminbuyout) => dbmarket
    • first(check(1, 4), 2) => 4
    • first(check(-1, 4), 2) => 2


    Enjoy!


    EDIT: Forgot to mention that you may leave off the third parameter, in which case the function will result in an invalid price (which can be dealt with via first() if you'd like) if the first parameter is not greater than zero. Added some examples of this above.
    Last edited by Sapu94; May 17th, 2014 at 10:54 PM.


    Follow me and TSM on Twitter for important updates, news, and giveaways!
    TSM Website | /r/woweconomy & TSM Discord | Go Premium | TSM FAQ

    "A good programmer is someone who always looks both ways before crossing a one-way street."

  2. #2
    Sapu94's Avatar
    Posts
    7,114
    Reputation
    345
    Blog Entries
    25
    Tagged in
    1928 Posts
    Add to this user's reputation
    v2.7 is now live. See the changelog for some of the other changes that went into this release.


    Follow me and TSM on Twitter for important updates, news, and giveaways!
    TSM Website | /r/woweconomy & TSM Discord | Go Premium | TSM FAQ

    "A good programmer is someone who always looks both ways before crossing a one-way street."

  3. #3
    Cheers!

    ...and keep up the good work!

  4. #4
    Ord's Avatar
    Posts
    623
    Reputation
    91
    Tagged in
    269 Posts
    Add to this user's reputation
    This is an amazing addition, thank you so much, @Sapu94 (and everyone who voted and gave feedback on the suggestions site)

    I will definitely play around with this and try to come up with some practical uses for this~!

  5. #5
    Is this what I should use if I want material cost method to be dbminbuyout ONLY IF it's lower than wowuctionmarket, otherwise ignore and don't craft?
    By using:
    check(wowuctionMarket-dbminbuyout, dbminbuyout)
    Last edited by Simon; July 12th, 2014 at 07:09 PM.

  6. #6
    I'm looking to add in checks to my crafting source for if it is a cool-down craft and point it at my custom prices for those mats rather then go through all of the cd items in the crafting item menu. Is this possible?

 

 

Similar Threads

  1. Introducing TradeSkillMaster Assistant: In-Game TSM Guide!
    By Sapu94 in forum General TradeSkillMaster Discussion
    Replies: 4
    Last Post: May 21st, 2014, 03:49 AM
  2. Custom prices - max sold ?
    By Cael in forum General TradeSkillMaster Discussion
    Replies: 4
    Last Post: October 19th, 2013, 07:02 PM
  3. question about the TSM2 custom prices
    By thou9ht in forum General TradeSkillMaster Discussion
    Replies: 9
    Last Post: August 17th, 2013, 01:16 PM
  4. Crafting Prices (calculated & custom)
    By slant in forum General TradeSkillMaster Discussion
    Replies: 2
    Last Post: August 13th, 2013, 10:22 AM
  5. Replies: 7
    Last Post: April 1st, 2013, 02:11 PM