Bag Sort

wwarwolf911

Member
Joined
Sep 5, 2008
Messages
901
Reaction score
13
Points
18
Is there a Plugin or Macro that will sort your bags...

Trade skill
Vendor
No drop items

etc?
 
Chat wrote a bank sort macro.

BankSorter

It's about all I know of.
I'm getting a 404 error when trying to access this macro, is that because I don't have an active sub, or is the link broken? (Former Lifetime Subscriber)
 
  • Wow
Reactions: EQDAB
Sorting inventory is a pretty rough topic because of all the edge cases you need to consider.

Do you have to worry about non generic bags? ie. collection bags, TS bags, giant items into small bags, etc?

How do you exclude items/bags you don't want sorted?

I have a sort routine specific for TS mules that sorts all the mats in the 32 slot TS bags. It skips everything else.
 
  • Like
Reactions: EQDAB
Code:
Sub SortTSBags
    /echo Doing a brute force sort of all TS materials that are in your TS bags

    /declare PN int local 
    /declare SN int local 

    /declare U[500] int local
    /declare V[500] int local
    
    /declare M int local
    /declare N int local
    /declare O int local

    /declare BestSlot int local 
    /declare BestIcon int local
    /declare BestName string local

    /declare Name string local 
    /declare Icon int local
    /declare Better int local
    
    |-- Loop over all inventory slots and items to find all TS item slots 
    
    /varset M 0
    
    /for PN 1 to 10 
        /if (${Me.Inventory[pack${PN}].Name.Equal[Extraplanar Trade Satchel]}) {
            |/varset Max ${Me.Inventory[pack${PN}].Container}
            /for SN 1 to 32    |-- Will always be 32 slots
                /varcalc M ${M} + 1
                /varset U[${M}] ${PN}
                /varset V[${M}] ${SN}
            /next SN
        }
    /next PN

    |-- At this point we have a mapping of all the slots we're going to sort. 
    
    /for O 1 to ${M}
        /echo Sort Pass ${O} of ${M}
        /varset BestIcon 0
        /varset BestName 0
        /varset BestSlot 0
    
        /for N ${O} to ${M}
            /varset Icon ${Me.Inventory[pack${U[${N}]}].Item[${V[${N}]}].Icon}
            /varset Name ${Me.Inventory[pack${U[${N}]}].Item[${V[${N}]}].Name}            
            /if (${Icon}) {
                /varset Better 0
                /if (!${BestIcon}) /varset Better 1
                |/if (${Icon}<${BestIcon}) /varset Better 1
                |/if (${Icon}==${BestIcon} && ${Name.Compare[${BestName}]}<0) /varset Better 1
                /if (${Name.Compare[${BestName}]}<0) /varset Better 1
                /if (${Better}) {
                    /varset BestIcon ${Icon}
                    /varset BestName ${Name}
                    /varset BestSlot ${N}
                }
            }
        /next N
        
        /if (${BestIcon} && ${BestSlot}!=${O}) {
            /nomodkey /shift /itemnotify in Pack${U[${BestSlot}]} ${V[${BestSlot}]} leftmouseup
            /delay 1
            /nomodkey /shift /itemnotify in Pack${U[${O}]} ${V[${O}]} leftmouseup
            /delay 1
            /autoinv
            /delay 1
        }
    /next O
/return
 
  • Like
Reactions: EQDAB
I had a request for the code I referenced to sort your TS mats.

I have 9+ TS mules. They keep the majority of the TS mats in their inventory in 'Extraplanar Trade Satchels'

This is the code I use to sort those bags.

1. Loops over all top level inventory slots looking for 'Extraplanar Trade Satchel' - make a list of all the slots we can use for TS items.

2. Loops over all items in your mats in those slots and sort them.

This uses a simple bubble sort on up to 320 item slots and it can take 2-5 minutes to run. The main source of delay is in picking up and moving each item.

If there is enough interest I could modify this to do other things but you'd need to give me exact details on what you want to happen.
 
  • Like
Reactions: EQDAB