-
Active Member
LUA Question with reading buff name 1.12.1
So on the vanilla wow api wiki
API UnitBuff | Vanilla WoW Wiki | Fandom powered by Wikia
It states that UnitBuff can be used such as
name, rank, icon, count, debuffType, duration, expirationTime, unitCaster, isStealable,
shouldConsolidate, spellId = UnitBuff("unit", index or ["name", "rank"][, "filter"])
However it looks like it is different in 1.12.1
When targeting a player with Devotion Aura for the first buff slot, and using the following code
Code:
a1, a2 = UnitBuff("target",1)
DEFAULT_CHAT_FRAME:AddMessage(a1);
DEFAULT_CHAT_FRAME:AddMessage(a2);
I get the following result
Also, I tried changing the index which is 1 in my code to the buff name to check for a buff that way. It looks like the 1.12.1 API only accepts indexes and not actual buff names.
Is there any way using the 1.12.1 LUA API to check if a player has a buff/debuff other than comparing the icon to guess what it is?
-
Contributor
Looking at your output (and having never tested it before myself) it would seem that the wiki is correct.
See History on your link:
Patch 2.0 added name and rank return values.
Originally Posted by pinny
It looks like the 1.12.1 API only accepts indexes and not actual buff names.
Unless you made a typo, that is probably true then.
See if you can print out spellId and fetch the name via GetSpellInfo(spellId)
-
Active Member
Originally Posted by
Glusk
Looking at your output (and having never tested it before myself) it would seem that the wiki is correct.
See
History on your link:
Unless you made a typo, that is probably true then.
See if you can print out
spellId and fetch the name via
GetSpellInfo(spellId)
GetSpellInfo is not part of the 1.12.1 Lua API. Thanks anyways though.
-
-
Post Thanks / Like - 1 Thanks
pinny (1 members gave Thanks to ev0 for this useful post)