This mod automatically stores items in bags by applying user requested rules.
BagMan
BagMan is a tool ment to automatically store items in bags by applying user requested rules.
At this early beta state it has no UI interface and 'only' operates on existing content in the bags and sorts the items as it is told to do.
It can:
- Work on bank slots (while bank is open)
- Compress the stacks by stacking up all items to their maximum stacksize and thus reduce the number of stacks ( /bam compress)
- Collapse all items so that they occupie all slots beginning from the backpack, or from th elast bag. All free slots will so be together in the other end of the bag slots. Note that at this time, while collapsing, the order of the items will not be changed. later an option will be added to allow only to fill up the holes which is faster but changes the order( /bam collapse and /bam collapse=u, where the 'u' denotes 'up' to mean the items start to place in the last bag ) The option 'h' indicates that only holes are to be filled up instead of moving all items. Thus using the 'h' option does not keep the sorting order.
- Move items to correct bags, means to any special bags like herbs, shards, etc.. ( /bam correct-bag) At this time for the mod to know which items belong to which special bag the user needs to place an item once in such a bag and the mods learns is.
In this context I would be glad to get Bagman.lua files from the WTF\Account\...\SavedVariables directory independent of the client language, which contains the learned items so I could make items known at the beginning.
- clear a bag of all items, for example for a bag to be replaced by another. '/bam clear=<n>' where <n> is the bag to be cleared (1=Bagback..5=last slot). The clear command will only work if there are enough slots available in th e other bags to accomodate the items to be taken out. If there are not enough slots you may use the 'f' option to force BagMan to move as many items as possible (/bam clear=<n>f).
- Undo the clear command is also possible. However the undo will only work if there has been no other BagMan command in between the clear and the undo. Also no items should have been moved between both commands. The ides is that after the bag has been swapped, tzhe items move again where they belong (/bam clear=r). If BagMan encounters on eof the following situations it will not do the undo until the force option is given:
* The destination slot is occupied ('force' will try to move to another slot)
* The souce slot (where the item was moved during the clear) is empty ('force' will iugnore this move)
* The new bag is to small to fit a given destination slot ('force' will try to move to another slot)
- sort items according to their quality, type or name ( /bam sort=<k> where <k> is q for quality, t for type or n for name, l for minimum level, s for stack size.
Sorting requires one slot free per bag type and operates on each bag type. So sorting will not take any item out of (a) special bag(s).
Note that (sort=s) will sort according to the maximum number of items on a stack for a given item. If there are several item stacks with the same name it will sort them additionally by the actual number of items on the stack.
Natural slot order
This section is specially for compatibility with addons that display all bags in one single window like all-in-one-inventory.
While sorting BagMan works 'graphically', that means that it will place th efirst item in the lower left slot of the backback, working up and then going to th elower left slot of the 2nd bag slot. This impleas that it starts at the last slot of each bag working up to the first slot avoiding anny 'holes'.
Al-in-one like addons however tend to display the bagback at th etop of the window and th elast bag at the bottom. In this case this will result in 'holes' in th einventory or unexpected sort order to be displayed.
With all-in-one-inventory one can avoid this by placing the backback in th ebottom of the window (/aioi swapbagorder)
However BagMan also includes a feature to help such tools. One can tell Bagman to use 'natural' slot order insted of the graphical order. This can be done by using the '!' option with any command or by enabling it by '/bam natural' or '/bam natural-slot-order' (will toggle)
Multiple commands
You may specify multiple commands on one single line like '/bam compress sort=q'
Future enhancements:
- Sorting on multiple keys
- Allowing multiple commands in one line like /bam compress correct-bag sort=q
- Command syntax may change
- UI
- Very far: Autobag functionality
Of course suggestions are wellcome :)
Compatibility
- When using with all-in-one inventory it is recommended to have the backpack starting in the bottom. This is achieved with the command /aioi swapbagorder. (see also 'natural slot order' above)