• 0

    posted a message on Help with bind the my own button

    Hello addon developers! Sorry if I'm writing in the wrong place. 


    I want to create a button that would track the buff on me. And when a button appears, I would press it and use a spell.

    For this, I decided to use the addon Weakauras 2.  This addon can track buffs, it remains only to write the code for the button.


    The button only responds to a mouse left click.
    Please tell me what needs to be added to the code so that my button responds to the "1" key.



    My code


    -- Creating button
    local captor = CreateFrame("Button", nil, aura_env.region, "SecureActionButtonTemplate")

    -- Setting position
    , relativeTo, relativePoint, xOfs, yOfs = aura_env.region:GetPoint()
    :SetPoint(point, relativeTo, relativePoint, xOfs, yOfs)

    :SetAttribute("type", "spell");
    :SetAttribute("spell", "Spellname");

    Posted in: Lua Code Discussion
  • To post a comment, please or register a new account.