Thread Tools Display Modes
09-01-05, 02:29 PM   #1
E-Kay
A Defias Bandit
 
E-Kay's Avatar
Join Date: Sep 2005
Posts: 3
Hooking on the macro /cast event problem.

Hi.

I have written a add-on to automatically cast the higher rank available on a target that is no too high as to get a "Target is too low level" error. It works well. I have hooked the API UseAction() function in order to do it.

Now I would like to include the "/cast" used in macro. Unfortunately, when using a macro that uses /cast, it doesn't use the UseAction function. I've searched but cannot find the API function used by the /cast command. Can someone help me with this?

Thank you.
  Reply With Quote
09-01-05, 04:49 PM   #2
noraj
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Jul 2005
Posts: 102
couldnt you just hook CastSpellID(ID, Booktype)

and it would call any time a spell is cast regardless of how?
  Reply With Quote
09-01-05, 05:56 PM   #3
E-Kay
A Defias Bandit
 
E-Kay's Avatar
Join Date: Sep 2005
Posts: 3
Thank you.

That's an idea worth exploring even if I am not sure it is always called upon... I will certainly try it.

Yet, further reflection made me conclude that if that does not work I could just create a "slash command" to replace /cast in the macros... That would certainly work (although it will require people to rewrite their macros, which I wanted to avoid)

Thank you again, I will try your idea first...

-----------------------
Addition (30 minutes later)
Nah.. CastSpell(Id, ...) is only invoked when you click on a spell directly in the spell book.
Turned out it doesn't work...

Last edited by E-Kay : 09-01-05 at 06:15 PM.
  Reply With Quote
01-12-06, 02:07 PM   #4
LordRhys
A Murloc Raider
AddOn Author - Click to view addons
Join Date: Jan 2006
Posts: 5
Red face

the Paladin Assist AddOn does something like what your trying to do, I am also trying to figure out exactly what you have done. In PA they have their own macro's which are duplicates of the SpellBook icon with the modification that it calls /pa <spellname> where <spellname> is a function that does your UseAction function with the appropriate spell.
Is there any way you can post your function so that I can take a look at it? If so thanks.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Hooking on the macro /cast event problem.


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