• World of Warcraft Addons
  • World of Warcraft
  • Average Rating:

  • Your Rating

  • Share
  • Report Abuse

LibBagUtils-1.0

  Download the Curse Client

Project Updated:
Files Updated: Sat, Jan 10 2009
Supports Game Version: 3.0.3
Category: Libraries
Tags:

[Edit Tags]

Project Manager: Mikk
Additional Authors: No additional authors
Current Version: r3-release
License: Public Domain
Avg Daily DL (last 30 days): 2
Downloads Total: 639
Favorites: 1
Comments: 0
  • Contests
  • About LibBagUtils-1.0
  •  

Several useful bag related APIs that you wish were built into the WoW API:


 local LBU = LibStub("LibBagUtils-1.0")
 
 for bag,slot in LBU:Iterate("BANK", "Major Healing Potion") do
   LBU:PutItem("BAGS")
 end

:Iterate("which"[, "lookingfor"])

which
string: "BAGS", "BANK", "BAGSBANK"
lookingfor
OPTIONAL: itemLink, itemName, itemString or itemId(number). Will not match partial names.

Returns an iterator that can be used in a for loop, e.g.:

 for bag,slot,link in LBU:Iterate("BAGS") do   -- loop all slots
 for bag,slot,link in LBU:Iterate("BAGSBANK", 29434) do  -- find all badges of justice

:FindSmallestStack("where", "lookingfor"[, notLocked])

where
string: "BAGS", "BANK", "BAGSBANK"
lookingfor
itemLink, itemName, itemString or itemId(number)
notLocked
OPTIONAL: if true, will NOT return locked slots
Returns:
bag,slot,size or nil on failure

:PutItem("where"[, dontClearOnFail[, count]])

The easiest way to move items between bags and bank is of course to simply "click" them, but that doesn't work when you split stacks. That's when this function is handy.

PutItem is smart; it will try to use specialty bags before standard bags. (But it will not try to put e.g. herb bags in herb bags. Doh.)

where
string: "BAGS", "BANK", "BAGSBANK"
dontClearOnFail
OPTIONAL: boolean: If the put operation fails due to no room, do NOT clear the cursor. Default: false. (Note that some other wow client errors WILL clear the cursor)
count
OPTIONAL: number: if given, PutItem() will attempt to stack the item on top of another suitable stack. This is not possible without knowing the count, so if not given, it will simply be put in an empty slot.
Returns:
bag,slot or false for out-of-room.
If called without an item in the cursor, 0,0 will be returned (slot 0 does not exist)
fullLink
string: A full item link as given by WoW APIs
lookingfor
string: itemLink, itemName, itemString or itemId(number). Will not match partial names.

Returns true if "lookingfor" matches "fullLink". Ignores in-constant info (e.g. level) in links.

  • Downloads (1)
  •  
File Name Release Type Game Version Downloads Date
Addon Curse.com Beta 2.3.3 0 9/29/2008
  File Name Release Type Game Version Downloads Date  
  LibBagUtils-1.0 r3-release Release 3.0.3 639 1/10/2009
  • 1 page(s)
Advertisement
  • Comments
This author has elected not to allow comments for this project.
  • Similar Addons
  •  

Average downloads per day

  1. 1,245 LibRock-1.0 Libraries
  2. 891 Ace2 Libraries
  3. 778 Ace3 Libraries
  4. 551 LibBabble-Boss-3.0 Libraries
  5. 514 Addon Control Panel Libraries, Professions, and...