Download
(3 Kb)
Download
Updated: 07/21/24 10:43 AM
Compatibility:
Gold Road (10.0.0)
Updated:07/21/24 10:43 AM
Created:07/14/24 12:34 PM
Monthly downloads:608
Total downloads:750
Favorites:1
MD5:
10.0.0
LibRecipe  New this week!
Version: 1.01
by: Sharlikran [More]
Library using MM code to obtain the Recipe information of a crafted item. Provides information on Furniture, Glyphs, and Potions.

Requirements

LibAlchemy
LibCharacterKnowledge

API

LibRecipe:GetRecipeItemLink(itemLink)

- Returns nil or the Recipe for the Furniture ItemLink
- Exception: For Crafted Glyphs and Potions returns the original Item Link for use in other places in the library

LibRecipe:GetNumIngredients(itemLink)

- Returns 0 or the Number of Ingredients

LibRecipe:GetIngredientInfoByIndex(itemLink, index)
* Note *: Can not be greater than the number of ingredients

- Returns nil, nil, nil, nil or ingredientItemLink, ingredientName, displayQuality, amountRequired
Optional Files (0)


Archived Files (1)
File Name
Version
Size
Uploader
Date
1.00
12kB
Sharlikran
07/14/24 12:34 PM


Post A Reply Comment Options
Unread 07/15/24, 08:51 AM  
code65536
AddOn Author - Click to view AddOns

Forum posts: 21
File comments: 417
Uploads: 41
A reverse lookup from crafted item back to its source recipe or plan is something that I hadn't considered before, but I think it is pretty useful, so I added GetSourceItemIdFromResultItem to LibCharacterKnowledge 2.0.4, and there's a new feature in Character Knowledge that makes use of this.

However, I took a different approach, because hard-coding thousands of IDs is not only cumbersome, but it also requires a human to update it every patch. LCK already has the means to automatically detect all the recipe IDs in the game without any human intervention, and so it was trivially easy for me to add a reverse-lookup feature that doesn't rely on any hard-coded data.

So I would suggest using LCK instead, to reduce the number of libraries and for easier maintenance. LCK doesn't do anything with ingredients, but GetItemLinkRecipeNumIngredients exists as a base-game API, so there's not that much to do there in the first place.
Last edited by code65536 : 07/15/24 at 09:03 AM.
Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump: