ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   Bug Reports (https://www.esoui.com/forums/forumdisplay.php?f=187)
-   -   [open] DoesItemLinkFulfillJournalQuestCondition() returns wrong result (https://www.esoui.com/forums/showthread.php?t=9419)

IsJustaGhost 10/14/20 04:57 AM

[open] DoesItemLinkFulfillJournalQuestCondition() returns wrong result
 
When a writ calls for "Lemon Flower Mazte", DoesItemLinkFulfillJournalQuestCondition() returns true for "Mazte" in the following code.

Lua Code:
  1. for recipeListIndex = 1, GetNumRecipeLists() do
  2.         local recipeListName, numRecipes, upIcon, downIcon, overIcon, _, recipeListCreateSound = GetRecipeListInfo(recipeListIndex)
  3.  
  4.         for recipeIndex = 1, numRecipes do
  5.             local known, recipeName, numIngredients, _, specialIngredientType = GetRecipeInfo(recipeListIndex,recipeIndex)
  6.  
  7.             local itemLink = GetRecipeResultItemLink(recipeListIndex, recipeIndex)
  8.             if DoesItemLinkFulfillJournalQuestCondition(itemLink, qIndex, 1, lineId) then

ZOS_DanBatson 10/14/20 07:24 AM

I'm not sure I understand what you're saying here. DoesItemLinkFulfillJournalQuestCondition returns a bool, not a string.

Sharlikran 10/14/20 08:36 AM

Is there an api that can return the recipe of any given item link? Meaning it returns strings and quantities of what is required to make the item? Is there an api that will take a string, such as the name of an item and return what is required to make it?

ZOS_DanBatson 10/14/20 09:17 AM

You can do

local craftingStationType, recipeListIndex, recipeIndex =GetRecipeInfoFromItemId(itemId)

and then use recipe APIs to look through the ingredients of the recipe. That might get what you want?

Sharlikran 10/14/20 03:52 PM

I'm going to wait and see how the original poster responds. That may be what he needs.

IsJustaGhost 10/14/20 04:36 PM

I apologize for the confusion. I should have said "(returns true for "Mazte")".
When using the method posted above to parse provisioning recipes the function returns true for Mazte tho the writ requires Lemon Flower Mazte. Mazte should not return a match for the quest condition.

Users of my addon have been reporting the issue with that specific DC writ. I had been only using one character that is AD, so I never ran into the issue or even new that there were different provisioning writs for the alliances. After finding that out, I made a DC character and waited for when I got the writ with Lemon Flower Mazte and I ran into the same problem.

After testing, I ended up having to dump the function and create one that checks between a trimmed down condition name and the recipe name. Also having to trim out spaces and hyphens do to the recipe name not matching the condition without "Craft" and ":0/1"

Condition, "Craft Lemon Flower Mazte:0/1"
Recipe name, "Lemon-Flower Mazte"

Both gsub'd to "LemonFlowerMazte"

if DoesItemLinkFulfillJournalQuestCondition is using string.match, I have noticed that string.match dose not match parameter 2 to the whole of parameter 1, but matching the whole of parameter 2 to anywhere in paramater 1.
string.match(parameter1, paramter2)


All times are GMT -6. The time now is 05:11 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI