Download
(1 Kb)
Download
Updated: 07/21/21 04:56 PM
Compatibility:
Waking Flame (7.1.5)
Blackwood (7.0.5)
Updated:07/21/21 04:56 PM
Created:07/19/19 09:30 AM
Monthly downloads:1,498
Total downloads:144,245
Favorites:19
MD5:
LibItemsFetcher  Popular! (More than 5000 hits)
Version: 1.0.2
by: zelenin [More]
A library for effective fetching of game items data.

Usage example:
Code:
-- let's get all recipes

local fetcher = LibItemsFetcher:New()

fetcher:RegisterCallback(EVENT_LIB_ITEMS_FETCHER_FETCH_BEGIN, function()
    d("[LibItemsFetcher] Start of recipe scan")
    myAddon.SavedVariables.recipes = {}
end)

-- data = {id = number, name = string, itemType = number ItemType, specializedItemType = number SpecializedItemType}
fetcher:RegisterCallback(EVENT_LIB_ITEMS_FETCHER_ITEM_FETCHED, function(id, isSuccessful, data)
    if id % 10000 == 0 then
        d(string.format("[LibItemsFetcher] Recipe scan - %s", id))
    end

    if isSuccessful == false or data.type ~= ITEMTYPE_RECIPE then
        return
    end

    if myAddon.SavedVariables.recipes[data.specializedItemType] == nil then
        myAddon.SavedVariables.recipes[data.specializedItemType] = {}
    end

    data.itemLink = string.format("|H1:item:%d:364:50:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:10000:0|h|h", data.id)
    data.isKnown = IsItemLinkRecipeKnown(data.itemLink)

    myAddon.SavedVariables.recipes[data.specializedItemType][data.id] = data
end)

fetcher:RegisterCallback(EVENT_LIB_ITEMS_FETCHER_FETCH_END, function(total)
    d("[LibItemsFetcher] End of recipe scan")
end)

fetcher:Fetch()
Version 1.0.2

- API version bump

Version 1.0.1
- API version bump

Version 1.0.0

- changed item name formatter to SI_TOOLTIP_ITEM_NAME (used by ZOS). Need refetch
- removed deprecated fields (type, specializedType)
- updated API to 100033

Version 0.0.7

- updated API to 100032

Version 0.0.6

- updated API to 100031

Version 0.0.5

- updated API to 100030

Version 0.0.3

- Added itemType and specializedItemType fields for consistency. type and specializedType will be removed in 1.0.0

Version 0.0.2

- Added AddOnVersion to addon manifest

Version 0.0.1

- Initial release
Archived Files (9)
File Name
Version
Size
Uploader
Date
1.0.1
1kB
zelenin
03/02/21 04:59 AM
1.0.0
1kB
zelenin
01/17/21 09:30 AM
0.0.7
1kB
zelenin
08/24/20 04:31 AM
0.0.6
1kB
zelenin
05/22/20 01:26 PM
0.0.5
1kB
zelenin
02/24/20 07:21 PM
0.0.4
1kB
zelenin
12/23/19 09:34 AM
0.0.3
1kB
zelenin
08/05/19 08:57 AM
0.0.2
1kB
zelenin
07/22/19 09:40 AM
0.0.1
1kB
07/19/19 09:30 AM


Post A Reply Comment Options
Unread 07/22/19, 09:40 AM  
zelenin
AddOn Author - Click to view AddOns

Forum posts: 7
File comments: 192
Uploads: 12
Originally Posted by Baertram
Your manifest txt file is missing the AddOnVersion: <signed integer> value.
You should add it so the game won't load odler versions of your library if the newer one was already loaded before.

Otherwise each loaded file of this library will overwrite the last loaded one and it will not care about the version of the library.
Thanks for report. Updated.
Report comment to moderator  
Reply With Quote
Unread 07/19/19, 09:55 AM  
Baertram
Super Moderator
 
Baertram's Avatar
ESOUI Super Moderator
AddOn Author - Click to view AddOns

Forum posts: 4912
File comments: 5990
Uploads: 78
Your manifest txt file is missing the AddOnVersion: <signed integer> value.
You should add it so the game won't load odler versions of your library if the newer one was already loaded before.

Otherwise each loaded file of this library will overwrite the last loaded one and it will not care about the version of the library.
Last edited by Baertram : 07/19/19 at 09:58 AM.
Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump: