WoW:API UnitDebuff: Difference between revisions

m
no edit summary
m (catfix, Replaced: Interface Customization → Interface customization)
mNo edit summary
Line 21: Line 21:


== Example ==  
== Example ==  
name, rank, texture = UnitDebuff("pet", 1);
Retrieves the name, rank and icon texture of the first debuff on the player's pet:
<pre>name, rank, texture = UnitDebuff("pet", 1);</pre>


Retrieves the name, rank and icon texture of the first debuff on the player's pet.


== Macros ==
Macro to print a list of the target's debuffs:
<pre>/run for i=1,40 do local D= UnitDebuff("target",i); if D then print(i.."="..D) end end</pre>
<br>
Macro to retrieve focus's remaining debuff time for any of the three Mage Poly spells and announce it via "SAY":
<pre>/run for i=1,40 do local n,_,_,_,_,_,x,_,_=UnitDebuff("focus",i);if (n=="Polymorph")or (n=="Polymorph(Pig)")or (n=="Polymorph(Turtle)")then SendChatMessage(format("%.0f",-1*(GetTime()-x)).." secs left on "..UnitName("focus").."'s CC!","EMOTE");end end
</pre>


<pre>/run for i=1,40 do local n,_,_,_,_,_,t=UnitDebuff("target",i);if (n=="Polymorph") or (n=="Polymorph: Pig") or (n=="Polymorph: Turtle") then SendChatMessage(t.." seconds left on CC","SAY");end end </pre>
Macro to retrieve target's timeLeft for any of the three Mage Poly spells and announce it via "SAY".


== History ==
== History ==
Anonymous user