API C_TradeSkillUI.GetRecipeNumReagents

From Wowpedia
Jump to: navigation, search

Returns the number of distinct reagents needed for the specified recipe.

numReagents = C_TradeSkillUI.GetRecipeNumReagents(recipeID)

Arguments

recipeID 
Number - ID of the recipe to get the number of distinct reagents for.

Returns

numReagents 
Number - The number of distint reagents needed for the specified recipe.

Example

The following snippet counts the total number of reagents needed for a recipe:

local numReagents = C_TradeSkillUI.GetRecipeNumReagents(recipeID);
local totalReagents = 0;
for idx = 1, numReagents do
  local _, _, reagentCount, _ = C_TradeSkillUI.GetRecipeReagentInfo(recipeID, idx);
  totalReagents = totalReagents + reagentCount;
end;

Patch changes

See also