Thread Tools Display Modes
07-11-05, 01:22 PM   #1
Simonechance
A Kobold Labourer
Join Date: Jul 2005
Posts: 1
Help determining if a spell/actiuon is currently on

I am trying to add some functinality to Zorlen Hunter Library. I have created an add on called Simonechances's Zorlen Add Ons to do some extra stuff. The problem I am having is this.

I want to check to see if Auto Shot is already active and if not cast it. I can do the latter very easy, but if I cast if with it on, it goes off, don't want that to happen.

Here's why, my Add-On acts like a big Shot Spam button, by pressing one button, you get the best available shot and fire it. If you are out of mana and can't fire, I want to activate Auto Shot, but only if it is not on.

I have tried the IsCurrentSpell() function, but that doesn't seem to work, so still looking.

Thanks for the assistance.
  Reply With Quote
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

WoWInterface » Developer Discussions » Lua/XML Help » Help determining if a spell/actiuon is currently on

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off