WoW:API UnitBuff: Difference between revisions

m
no edit summary
mNo edit summary
Line 38: Line 38:
  DEFAULT_CHAT_FRAME:AddMessage(buffs);
  DEFAULT_CHAT_FRAME:AddMessage(buffs);


=====Macro Option:=====
=====Macro Options:=====
<pre>/script for i=1,40 do local B=UnitBuff("target",i); if B then DEFAULT_CHAT_FRAME:AddMessage(i.."="..B) end end</pre>
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>
 
2. Prints the name, texture, and time left for all buffs on the player.
=== Result ===
<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>
Print the names of all buffs you're currently buffed with.


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