Register
Welcome to the Stormspire.net WoW Gold Forums!

Greetings, guest! Welcome to Stormspire.net, your #1 resource for WoW and Diablo 3 Gold, Professions, and everything in between!


Enjoy what the site offers? Consider Premium Membership if you wish to get the most out of the site. Premium Membership benefits include the acclaimed Goblineer's World of Warcraft Gold Guide, private forum access, a complimentary high-quality avatar, and much more!


If this is your first visit, make sure to check out the Stormspire.net Survival Guide for a quick site orientation. You may also register to unlock all standard forum features, and to get rid of these lovely ads!


We proudly host the Official forums for TradeSkillMaster, The Undermine Journal, and WoWuction.

Results 1 to 7 of 7
  1. #1
    Entrepreneur
    morfraen's Avatar
    Posts
    57
    Reputation
    1
    Tagged in
    23 Posts
    Add to this user's reputation

    TSM_Mailing attachment order

    I'm trying to figure out why TSM_Mailing seems to add attachments to the mail in an almost random order. From looking at the code, shouldn't it be adding things in order of itemid or the bag/slot index?

  2. #2
    US-Emerald Dream(Both)
    Your Favorite Goblin
    Kathroman's Avatar
    Posts
    5,022
    Reputation
    267
    Blog Entries
    15
    Tagged in
    1944 Posts
    Add to this user's reputation
    Quote Originally Posted by morfraen View Post
    I'm trying to figure out why TSM_Mailing seems to add attachments to the mail in an almost random order. From looking at the code, shouldn't it be adding things in order of itemid or the bag/slot index?
    From my experience, it does. You'll probably need to provide a bit more detail about what you feel is "random". Whenever I've used it, it's gone through each destination toon in order, suggesting that it was pulling on a sequential basis.
    Like what you see? Become an Ethereal Contributor to help support the site and gain access to additional perks.

        

    Guides: Thunder Bluff Vendor Supply Route | Entry Level JC Strategy | Alternative DMF Guide

    TSM 2.0: TSM 2.0 Groups & Operations GUIDE | TSM 2.0 Basic JC Shuffler | TSM 2.0 ADVANCED JC Shuffler

  3. #3
    Entrepreneur
    morfraen's Avatar
    Posts
    57
    Reputation
    1
    Tagged in
    23 Posts
    Add to this user's reputation
    Well right now I have this in my bags, printed in the order StartAutoMailing finds them, which is as expected the bags walked in order.

    name : itemID : bag,slot

    Greenweave Branch : 9769 : 0,1
    Mistscape Stave : 7611 : 0,6
    Elder's Cloak : 7356 : 0,9
    Simple Robe : 9748 : 0,11
    Bright Cloak : 6381 : 0,14
    Bright Cloak : 6381 : 1,20
    Elunarian Cloak : 14459 : 1,25
    Greenweave Vest : 9774 : 2,18
    Simple Britches : 9747 : 2,22
    Bright Boots : 3065 : 2,26
    Shadow Council Orb : 25093 : 3,6
    Seer's Belt : 4699 : 3,9
    Mystical Cape : 10174 : 3,10
    Imperial Red Scepter : 15930 : 4,20
    Royal Cape : 9908 : 4,22


    And then in the order that it tries to mail them, which is the same as the order of private.mailTargets["target player"].

    15930
    9769
    4699
    9908
    7356
    9747
    14459
    15946
    10174
    25093
    3065
    9774

    And that order changes if I move items around in my bags. I'm thinking that there needs to be a sort() somewhere so things are ordered by itemID (or eventually by item name for my purposes).

  4. #4
    US-Sentinels(A)
    TSM Developer
    Drethic's Avatar
    Posts
    170
    Reputation
    12
    Tagged in
    66 Posts
    Add to this user's reputation
    Quote Originally Posted by morfraen View Post
    Well right now I have this in my bags, printed in the order StartAutoMailing finds them, which is as expected the bags walked in order.

    name : itemID : bag,slot

    Greenweave Branch : 9769 : 0,1
    Mistscape Stave : 7611 : 0,6
    Elder's Cloak : 7356 : 0,9
    Simple Robe : 9748 : 0,11
    Bright Cloak : 6381 : 0,14
    Bright Cloak : 6381 : 1,20
    Elunarian Cloak : 14459 : 1,25
    Greenweave Vest : 9774 : 2,18
    Simple Britches : 9747 : 2,22
    Bright Boots : 3065 : 2,26
    Shadow Council Orb : 25093 : 3,6
    Seer's Belt : 4699 : 3,9
    Mystical Cape : 10174 : 3,10
    Imperial Red Scepter : 15930 : 4,20
    Royal Cape : 9908 : 4,22


    And then in the order that it tries to mail them, which is the same as the order of private.mailTargets["target player"].

    15930
    9769
    4699
    9908
    7356
    9747
    14459
    15946
    10174
    25093
    3065
    9774

    And that order changes if I move items around in my bags. I'm thinking that there needs to be a sort() somewhere so things are ordered by itemID (or eventually by item name for my purposes).
    What are you sending? Looks like disenchantable greens. For something like that it won't sort. @Bart39 may know if it sorts preset lists.
    TSM Web Master / Assistant Addon Developer
    For information: TSM Website, TSM Addon, TSM App.
    Also Follow TSM on Twitter, and Like TSM on Facebook!
    If you need help with any of the above hop on Chat. It's much faster than posting

  5. #5
    Entrepreneur
    morfraen's Avatar
    Posts
    57
    Reputation
    1
    Tagged in
    23 Posts
    Add to this user's reputation
    They're transmog greens. I added them to a list to avoid the DE code complicating things. This note from http://lua-users.org/wiki/TablesTutorial may explain things.



    "Note, there is no guarantee as to the order in which keys will be stored in a table when using dictionaries so the order of retrieval of keys using pairs() is not guaranteed"

  6. #6
    US-Sentinels(A)
    TSM Developer
    Drethic's Avatar
    Posts
    170
    Reputation
    12
    Tagged in
    66 Posts
    Add to this user's reputation
    Quote Originally Posted by morfraen View Post
    They're transmog greens. I added them to a list to avoid the DE code complicating things. This note from http://lua-users.org/wiki/TablesTutorial may explain things.



    "Note, there is no guarantee as to the order in which keys will be stored in a table when using dictionaries so the order of retrieval of keys using pairs() is not guaranteed"
    You are correct, any array/table structure is at the mercy of how it was added unless there is another step to create an ipair table that is sorted. @Bart39 has been reworking that code a lot and would know best if a sort feature is in there for any of the functions.
    TSM Web Master / Assistant Addon Developer
    For information: TSM Website, TSM Addon, TSM App.
    Also Follow TSM on Twitter, and Like TSM on Facebook!
    If you need help with any of the above hop on Chat. It's much faster than posting

  7. #7
    Entrepreneur
    morfraen's Avatar
    Posts
    57
    Reputation
    1
    Tagged in
    23 Posts
    Add to this user's reputation
    Definitely isn't any sort feature in the current code, think I've figured out how to make it do what I want though, which is sort a bag full of transmog greens. Though sorting by itemid is easy, sorting by name may take some more work.

    For general use, it'd be much improved if the default behavior would mail things in the order that they are in the bags rather than the arbitrary table order. For ex. if you open 8+ mails of stuff, it's often preferable that it be mailed out in the same order that it came in.

 

 

Similar Threads

  1. TSM_Mailing
    By Aerodynamic in forum Addons and Macros
    Replies: 4
    Last Post: February 7th, 2012, 12:53 PM
  2. TSM_Mailing
    By Lutheros in forum Official TradeSkillMaster Forum
    Replies: 3
    Last Post: January 18th, 2012, 09:29 AM
  3. Alternative to TSM_Mailing?
    By smrdlja in forum Addons and Macros
    Replies: 9
    Last Post: September 2nd, 2011, 04:21 PM
  4. Recent Issue with TSM_Mailing
    By Squishes in forum Official TradeSkillMaster Forum
    Replies: 2
    Last Post: July 26th, 2011, 07:38 PM
  5. TSM_Mailing Request
    By pahr in forum Official TradeSkillMaster Forum
    Replies: 3
    Last Post: July 2nd, 2011, 02:17 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •