View Single Post
07-18-05, 11:57 AM   #2
Drowsey
A Murloc Raider
AddOn Author - Click to view addons
Join Date: Jul 2005
Posts: 7
if that spell is a buff you can scan with UnitBuff() you can find out if its been cast or not that way.

The following code you could use by targeting someone and listing all the buffs they currently have on them.

-----------------------------
-- General Chat local Message
-----------------------------
function Message(msg)
if (DEFAULT_CHAT_FRAME) then
DEFAULT_CHAT_FRAME:AddMessage(msg, 1, 1, 0.5);
end
end


-----------------------------------------
-- List all Buffs on the target specified
-----------------------------------------
function ShowAllBuffs(unit)
local i = 1;

if (not unit or not UnitExists(unit)) then
unit = "player";
end

Message(UnitName(unit).." Buffs:");
while (UnitBuff(unit, i)) do
Message(" "..UnitBuff(unit, i));
i = i + 1;
end
end

Hope that helped.
  Reply With Quote