WearMe
From WoWWiki
Contents |
Summary
- Library for equipping, bagging, and moving equipment using a dynamic cache.
- Note on the Bank: Functions that search the bank only work while at the bank, technically if you scan the whole bank while at it it will be cached and can be searched later, but this information is not saved accross sessions and is not garenteed to be complete unless you have the bank window open.
- Note on Bags: Most refrences to 'Containers' or 'Bags' here refer to the backpack + your 4 bags. Most refrences to 'Bank' include the bank + your 6 bank bags. If input is taken as bag and slot it will only return valid info for the bank bags when at the bank.
- Note on ItemIDs: In most cases ItemID refers to the first number in an ItemString. In most functions where 'ID' is accepted it will take either the ItemID or the ItemString.
Download
- Available at www.wowinterface.com.
Features
- Embeddable library
- Allows you to swap one item or a set of items
- Allows you to equip one item or an outfit of items
- Caches bank, bag, inventory and cursor items to avoid repetitive getting and reparsing of the item ids
- Search through bags from a starting position so you can pick up where you left off
- Find by itemName, itemString or itemID
- Cached bag types, so that it never tries to put an item in a bag it can't go in
- Optimized outfit equipping for one pass execution whenever possible
Examples
Outfit Equipping Example
WearMe.InitOutfit(); WearMe.RegisterToEquip(16, "item:18822:2646:0:0", "Obsidian Edged Blade"); -- Equip OEB w/ +25 agil (by itemString) or OEB (by name) WearMe.RegisterToEquip(11, 19325); -- Equip Ring 1 by id WearMe.RegisterToEquip(12, 19898); -- Equip Ring 2 by id WearMe.RegisterToEquip(19); -- Unequip Tabard WearMe.WearOutfit();
Set Moving Example
WearMe.InitSet();
WearMe.RegisterBagItemToMove("item:18822:2646:0:0", "Obsidian Edged Blade");
WearMe.MoveSetToBank();
or
WearMe.InitSet();
WearMe.RegisterBankItemToMove("item:18822:2646:0:0", "Obsidian Edged Blade");
WearMe.MoveSetToBags();
User Functions
- Conversion
- InventoryIDToContainerID - Inventory Bag Item ID to Container ID Conversion.
- Get Funcs
- GetCursorItemInfo - Get cached cursor item info.
- GetInventoryItemName - Get inventory item name.
- GetInventoryItemInfo - Get parsed inventory item info.
- GetContainerItemName - Get container item name.
- GetContainerItemInfo - Get parsed container item info.
- GetBagSubType - Get cached bag subType.
- GetItemIDFromItemString - Get ItemID from ItemString.
- Special Bags
- ItemCanGoInBag - Check if an item can go in the specified container.
- Find Item By Name (returns bag/slot)
- Find Item By ItemID or ItemString (returns bag/slot)
- Find Item by ID or Name (returns bag/slot)
- FindItem - Find an in your inventory, bags or bank.
- FindContainerItem - Find an in your bags.
- FindBankItem - Find an item in your bank.
- FindInventoryItem - Find an item in your inventory.
- Player Has Item by ID or Name (returns boolean)
- PlayerHasItem - Find an item in your inventory or bags.
- PlayerHasInventoryItem - Find an item in your inventory.
- PlayerHasContainerItem - Find an item in your bags.
- Bagging
- BagCursorItem - Put the cursor item in your bags.
- BankCursorItem - Put the cursor item in your bank.
- Re-Bagging
- ReBagContainerItem - Move a bag item to either the front or the back of your bags.
- ReBagContainerItemByName - Find a bag item by name and rebag it.
- ReBagContainerItemByID - Find a bag item by ID and rebag it.
- Queued Re-Bagging
- QueueItemForMoving - Queue item by ID to be moved to the front or back of the bags.
- CallMoveQueue - Move queued items, called automaticly on the UNIT_INVENTORY_CHANGED event.
- Equiping
- Equip - Equip item by ID.
- EquipByName - Equip item by name.
- EquipContainerItem - Equip item by bag/slot.
- EquipInventoryItem - Equip/move an inventory item by slot.
- Unequiping
- Unequip - Put an inventory item (by slot) into your bags.
- Bag/Slot Usage
- InventorySlotInUse - Check if an inventory slot has an item in it.
- ContainerSlotInUse - Check if a container slot has an item in it.
- GetNumEmptyContainerSlots - Get the number of empty bag slots you have.
- Item Quantity
- GetBagItemQuantity - Get the number of bag items you have by ID or Name.
- GetBankItemQuantity - Get the number of bank items you have by ID or Name.
- Outfit Swapping
- InitOutfit - Clear outfit.
- RegisterToEquip - Register an item by ID or name to go in an inventory slot.
- WearOutfit - Equip outfit items.
- Set Moving (Bags to Bank or Bank to Bags)
- InitSet - Clear set.
- RegisterBagItemToMove - Register a bag item by ID or name and quantity to add to the set.
- RegisterToMove - Register a bank item by ID or name and quantity to add to the set.
- MoveSetToBags - Move set items to the bank.
- MoveSetToBank - Move set items to your bags.
Embedding
To embed WearMe in your addon:
- 1) Drop the WearMe folder in your addon folder
- 2) Either add the following to your xml file:
<Include file="WearMe\WearMe.xml"/>
- Or add this line to your toc file:
WearMe\WearMe.xml
