From ESOUI Wiki
Given an item link (for an alchemy reagent) and a trait index, this function returns two values representing the alchemy trait that exists in that index. The first value is a boolean indicating whether the trait is known to the player; the second value is a string containing the trait's name.
If the player doesn't know the trait, then the second return value will be nil. If the trait doesn't exist (i.e. the reagent only has four traits and you request information on the fifth trait), then both return values will be nil.
- A string containing an item link, which should identify an alchemy reagent.
- A number between 1 and GetMaxTraits(), inclusive.
- A boolean value indicating whether the player has discovered this trait on this reagent, or nil if you are requesting information on a trait that doesn't exist (i.e. an invalid traitIndex value).
- A string containing the name of the trait, or nil if the player has not discovered the trait.
-- -- If we have an itemLink for an alchemy reagent, how do we -- loop over all of its traits? -- for i = 1, GetMaxTraits() do local known, name = GetItemLinkReagentTraitInfo(itemLink, i) if known then d(zo_strformat("Trait <<1>> is known; it's <<2>>.", i, name)) end end