promotional bannermobile promotional banner

LibInspect

Libary for cleanly inspecting other players

The goal of this library is to provide a universal way to inspect players that doesn't compete with other addons. This library with achieve this by doing asynchronous requests.

In order to use the addon you will need to first load it as a library, then lib:AddHook('addonName', 'what', function(guid) YourFunction(guid, data); end); It will then only request the type of information for addons that have registered. For example what = items it will only run NotifyInspect() and get data.items , or what = {items,talents} then will return data.items and data.talents. 'what' will also include honor and arena information, and maybe more when I get in game and play around with it.

Then when you want to make a request lib:RequestData('what', target, force) or lib:RequestItems(target, force) where force will ignore cached data. It will return caninspect, cached, refreshing where CanInspect() is if fresh data is posable, cached is bool if there is cached information and refreshing is if a NotifyInspect() was sent out.

Speaking of cached data, the lib will store localy old inspect information. This will allow for faster retrevial. The max age that information will be stored is set by lib:MaxAge(seconds); where the lowest settng by any addon will win out.

The lib will try to not break the inspect window as well as try and fix a few issues in the default blizzard inspect.

Documentation

Supported Types

  • all - use sparingly
  • items - returns a table of items
  • honor - not yet
  • talents - not yet
  • achivements - not yet

Methods

success = LibInspect:AddHook('MyAddon', type, function(guid, data, age) YourFunction(guid, data, age); end);

maxAge = LibInspect:SetMaxAge(seconds); default 1800

itemQuantity = LibInspect:SetRescan(items); default 10

caninspect, unitfound, refreshing = LibInspect:RequestData(type, target, force); or LibInspect:Request_Type_(target, force) ex. LibInspect:RequestItems(...)

Callbacks/Hooks

When the data is ready you YourFunction(guid, data, age) will be called

guid = UnitGUID(); -- use this to tie it to the inspect request

data = false; -- Nothing was found/error
or
date =  {
    items = {
        1 = itemLink, -- the result of GetInventoryItemLink("unit", 1);
        2 = itemLink,
        ...
        19 = itemLink,
    },
    honor = ...,
    talents = ...,
    achivements = ...,
};

age = ##; -- how old in seconds the data is

The LibInspect Team

profile avatar
Owner
  • 1
    Followers
  • 8
    Projects
  • 1.1M
    Downloads

More from scotepiView all

  • Simple iLevel project image

    Simple iLevel

    • 1.0M
    • Addons

    Adds the Average iLevel (AiL) to the tooltip of other players

    • 1.0M
    • February 12, 2021
    • Addons
    • +4
  • Tooltip Spec project image

    Tooltip Spec

    • 18.1K
    • Addons

    Shows the spec of people around you in the tooltip.

    • 18.1K
    • November 19, 2020
    • Addons
    • +2
  • Character Info Durability project image

    Character Info Durability

    • 20.7K
    • Addons

    Shows the minimum durability of equipped items on the stats frame.

    • 20.7K
    • July 11, 2020
    • Addons
    • +2
  • GuildMemberInfo project image

    GuildMemberInfo

    • 28.3K
    • Addons

    Interface for addons to include extra information on the GuildMemberInfo frame.

    • 28.3K
    • June 28, 2015
    • Addons
    • +3
  • Simple iLevel project image

    Simple iLevel

    • 1.0M
    • Addons

    Adds the Average iLevel (AiL) to the tooltip of other players

    • 1.0M
    • February 12, 2021
    • Addons
    • +4
  • Tooltip Spec project image

    Tooltip Spec

    • 18.1K
    • Addons

    Shows the spec of people around you in the tooltip.

    • 18.1K
    • November 19, 2020
    • Addons
    • +2
  • Character Info Durability project image

    Character Info Durability

    • 20.7K
    • Addons

    Shows the minimum durability of equipped items on the stats frame.

    • 20.7K
    • July 11, 2020
    • Addons
    • +2
  • GuildMemberInfo project image

    GuildMemberInfo

    • 28.3K
    • Addons

    Interface for addons to include extra information on the GuildMemberInfo frame.

    • 28.3K
    • June 28, 2015
    • Addons
    • +3