WoW:API UnitBuff: Difference between revisions

17 bytes removed ,  15 October 2008
m
no edit summary
(3.0 note)
mNo edit summary
Line 42: Line 42:


=====Macro Options:=====
=====Macro Options:=====
1. Prints the names of all buffs on the current target.
1. Prints the names of all buffs on the current target:
<pre>/run for i=1,40 do local B=UnitBuff("target",i); if B then DEFAULT_CHAT_FRAME:AddMessage(i.."="..B) end end</pre>
<pre>/run for i=1,40 do local B=UnitBuff("target",i); if B then print(i.."="..B) end end</pre>
2. Prints the name, texture, and time left for all buffs on the player.
2. Prints the name, icon texture, and time left for all buffs on the player.
<pre>/run for i=1,40 do local n,_,tex,_,_,t=UnitBuff("player",i);if n then DEFAULT_CHAT_FRAME:AddMessage(i.."="..n..", "..tex..", "..format("%.2f",t/60).." minutes left.")end end</pre>
<pre>/run for i=1,40 do local n,_,icon,_,_,dur,x,_,_=UnitBuff("player",i);if n then print(i.."="..n..", "..icon..", "..format("%.2f",-1*(GetTime()-x)/60).." minutes left.")end end
</pre>


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