PDA

View Full Version : Executing an Action Bar Button


Voorshwa
12-02-2004, 05:46 PM
Hi!

Can anyone tell me of a way to execute and action bar button within an Addon? I am trying to have my code execute the active spell in my action bar when a certain event is fired.

Example, in the CombatCaller addon the interface yells out that you need healing when you get to a certain amount of HP. What I want, is to be able to have the code execute the spell in my action bar slot when I get to the same amount of HP. I haven't been able to reference those buttons in the action bar from the icon, no matter what I do.

Can someone in the community or one of the Cosmos Developers speak to how to do this? It would be a huge help. Thanks!

V

sarf
12-02-2004, 07:31 PM
Not possible, I think.

You can only press buttons / cast spells when your current code is executing as a result of a keypress.

If you want to try, it's ActionButtonDown(1);

Sarf
---
"It's not whether you win or lose, it's how you place the blame." - Oscar Wilde

Voorshwa
12-02-2004, 08:09 PM
Ok...I can understand that.

How about being able to use the "CastSpellByName(Spell(Rank))" method? Can I call that within the Addon to cast that spell when an event happens? I tried using it last night just using it that way and also by putting the syntax in the RunScript method. Didn't seem to work.

Any thoughts, Sarf? I appreciate all your help. Thank you.

V

sarf
12-06-2004, 08:09 PM
CastSpellByName and CastSpell requires the code to be executed from within a button press.

Sarf
---
CAPITAL, n. The seat of misgovernment. That which provides the fire, the pot, the dinner, the table and the knife and fork for the anarchist; the part of the repast that himself supplies is the disgrace before meat. _Capital Punishment_, a penalty regarding the justice and expediency of which many worthy persons -- including all the assassins -- entertain grave misgivings.