1. #1

    Addon to Cast spell.

    Im pretty new at the whole Addon thing, and cant find a way for a mod to cast a a spell on a player when i click it, kind of like decursive. I tried to find it in decursive but it isn't going very well. Tried castSpell and castSpellByname and both are protected by blizz. Is there another way to do this, or do i have to have the addon make a few macros to call?

  2. #2
    Deleted
    You'll need to make a button inheriting SecureActionButtonTemplate.

  3. #3
    Once i make the button inherit SecureActionButtonTemplate, do i use the castSpellByName in the function for the button click? or do i need to do more.

  4. #4
    Code:
    a = CreateFrame("Button", "Nameit", UIParent, "SecureActionButtonTemplate")
    a:SetWidth() -- enter your desired value in between then ()
    a:SetHeight() -- same as above
    a:SetAttribute("spell", "Name of your Spell") -- This is where the spell atribute goes.
    You can find all the attributes listed on the link Treeston provided.


    Note you will be unable to have an AddOn to cast for you, but you can assign this an ID and set it with a KeyBind.
    Last edited by Calabera; 2011-01-13 at 03:16 AM.

  5. #5
    Once i set the attribute, i can call it during the Button_Onclick()?

  6. #6
    You should be able to, if not post the error.
    Last edited by Calabera; 2011-01-13 at 04:35 AM.

  7. #7
    Sorry for the stupidity, in the button_click, how do i call the attribute to cast, in this case, fan of knives?

  8. #8
    Deleted
    Do not set the OnClick handler, it is inherited from the template.
    If you want to do anything except the spell cast, use PreClick/PostClick.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •