Talk:API GetPlayerBuff

Is it possible to get the name of a buff? --Ciryon 15:18, 30 Jan 2005 (EST) Found answer:

Just scan the tooltip for the buff. First line contains the name. --Ciryon 14:26, 1 Feb 2005 (EST)

buff type
is it possible to detect the type of the buff? e.g. magic, poison, curse, etc?

I'm creating a macro for casting Slice n Dice only if there is a set number of combo points, the mob's health is above a certain percentage, and the Slice N Dice Buff does not already exist (otherwise the macro will cast Sinister Strike). I think I've figured out the combo points and mob health part, and now I'm stuck on the buff part. Looking at this function "GetPlayerBuff" it seems that it looks for buffs based on the buff's current slot, which is not helpful to me. Can this function look for a buff by name, and if so, how would I configure the call (if that's the right term) to look for Slice n Dice?

Obsolete in 3.0
From the 3.0 patch notes:

Buff Information
 * The various GetPlayerBuff functions have been removed and integrated into the appropriate unit functions, adding a new UnitAura function and updating the others:

name, rank, texture, count, debuffType, duration, expiryTime, untilCanceled = UnitAura("unit", [index] or ["name", "rank"][, "filter"]); name, rank, texture, count, debuffType, duration, expiryTime, untilCanceled = UnitBuff("unit", [index] or ["name", "rank"][, "filter"]); name, rank, texture, count, debuffType, duration, expiryTime, untilCanceled = UnitDebuff("unit", [index] or ["name", "rank"][, "filter"]); CancelPlayerBuff([index] or ["name", "rank"][, "filter"]);

GameTooltip:SetUnitAura("unit", [index] or ["name", "rank"][, "filter"]); GameTooltip:SetUnitBuff("unit", [index] or ["name", "rank"][, "filter"]); GameTooltip:SetUnitDebuff("unit", [index] or ["name", "rank"][, "filter"]);


 * The "filter" parameter can be any of "HELPFUL", "HARMFUL", "RAID", "CANCELABLE", "NOT_CANCELABLE". You can also specify several filters separated by a | character to chain multiple filters together (e.g. "HELPFUL|RAID" == helpful buffs that you can cast on your raid). By default UnitAura has "HELPFUL" as an implicit filter - you cannot get back BOTH helpful and harmful at the same time. Neither "HELPFUL" or "HARMFUL" have meaning for UnitBuff/UnitDebuff, and will be ignored.
 * AddOns displaying remaining time should cache the expiry time and decrement their own counter, do not re-query the information every OnUpdate.
 * The untilCanceled return value is true if the buff doesn't have its own duration (e.g. stealth)