View Feature Request
API Request
Feature #: 1777
File: Character Knowledge (Motif, Recipe and Furnishing Plan Tracker)
Date: 02/25/21 12:38 PM
By: MegwynW
Status: Under Review
Could you please consider adding some functions as an API for use with mods like RuleBasedInventory. Ideally they should all accept the itemLink to check and then a function to check for each character/account/server. Something along the lines of:

bool CK_IsKnown(itemLink) -- known anywhere
bool CK_IsKnownAccount(itemLink, accountName)
bool CK_IsKnownCharacter(itemLink, characterName)
bool CK_IsKnownServer(itemLink, serverName)

Thanks for considering this :)

RSS 2.0 Feed for Favorite CommentsNotes Sort Options
By: Baertram - 08/12/21 06:46 AM
Hint: characterNames are not unique and should not be used. Use the unique characterIds instead. Thouh they are only unique per server so the API functions must pass in the servername AND the accountName AND the charcaterId or characterName
By: code65536 - 08/12/21 09:55 AM
Hmm, why did I get a notification about this only now, when Baer commented, and not when it was initially created?

Anyway, I never got around to documenting the API for LCK, but everything that you ask for can already be done with the existing API.

For your "CK_IsKnownCharacter", use this:
Code:
LibCharacterKnowledge.GetItemKnowledgeForCharacter( item, server, charId )

item: can be an item link (string) or item ID (integer)
server: can be "NA", "EU", "PTS", or nil (will use the current server if nil)
charId: self-explanatory

Possible return values:
LibCharacterKnowledge.KNOWLEDGE_INVALID -- Not a recipe, plan, or motif
LibCharacterKnowledge.KNOWLEDGE_NODATA -- No data for this character
LibCharacterKnowledge.KNOWLEDGE_KNOWN
LibCharacterKnowledge.KNOWLEDGE_UNKNOWN

For everything else, just parse the results from this:
Code:
LibCharacterKnowledge.GetItemKnowledgeList( item, server )

item: can be an item link (string) or item ID (integer)
server: can be "NA", "EU", "PTS", or nil (will use the current server if nil)

Returns a list of all the characters for which the item is tracked... each item of the list is a table containing the following fields:
id: character ID
account: account name associated with the character
name: character name
knowledge: see the list of possible return values for GetItemKnowledgeForCharacter