This library provides filtering capabilities for items. Addons using this library can filter items by quality, item level, class and subclass, binding type, and a variety of other attributes.
This is an example of a simple addon which automatically rolls disenchant or greed on any uncommon (green) quality items looted while in a group.
local addon = LibStub( "AceAddon-3.0" ):NewAddon( "myLootAddon", "AceEvent-3.0" ) local IsItemGreen = LibStub:GetLibrary( "LibItemFilter-1.0" ):GetFilter( "quality-uncommon" ) function addon:OnEnable( ) self:RegisterEvent( "START_LOOT_ROLL" ) end function addon:START_LOOT_ROLL( event, lootId, duration ) local item = GetLootRollItemLink( lootId ) if IsItemGreen( item ) then local _, _, _, _, _, _, canGreed, canDisenchant = GetLootRollItemInfo( lootId ) if canDisenchant then RollOnLoot( lootId, 3 ) elseif canGreed then RollOnLoot( lootId, 2 ) end end end
This library could be used for a more comprehensive loot rolling addon, any bag or inventory addons which sort items for user convenience, or any addons which sell "junk" items to vendors, among other possibilities.
Note that the above code is just an example. The library API has yet to be finalized.