Page 2 of 2 FirstFirst
1
2
  1. #21
    Deleted
    Doesn't work, even tried the camera distance on its own, still didn't work.

  2. #22
    Deleted
    Awesome guide, really helped me out, ty
    Odd it isnt stickied

  3. #23
    Deleted
    Would clutter up the forum too much. We already have too many stickies.
    It's linked in the other sticky though.

  4. #24
    Deleted
    Hi Treeston,

    I read your guide on how to make your own macro into an AddOn and it worked perfectly on designing my UI!

    However, when I tried to make a second AddOn for my keybind macros I stumbled into a problem. I tried to PM you (can't since I'm new user) so hope it's alright I pop it into your thread instead...

    What I've done is binding macros and spells without having to place them in my actionbars with the SetBindingMacro or Spell command. Works fine when I /run SetBindingMacro("BUTTON10", "Moonfire") in-game - to take an example - but when I make them into an AddOn, I only have one working. I really don't understand how or why!

    Here's the 'LUA' code of my AddOn:

    Code:
    SetBindingMacro("BUTTON12", "Flee")
    SetBindingMacro("BUTTON11", "Mount")
    SetBindingMacro("BUTTON10", "Moonfire")
    SetBindingSpell("BUTTON6", "Hurricane")
    SetBindingSpell("SHIFT-R", "Soothe")
    SetBindingMacro("BUTTON14", "Hibernate")
    SetBindingMacro("SHIFT-F", "Heal")
    SetBindingMacro("G", "CC")
    SetBindingMacro("BUTTON8", "Faerie")
    SetBindingMacro("SHIFT-BUTTON5", "C2")
    SetBindingMacro("BUTTON5", "C1")
    
    SaveBindings(2)
    The only one working is the Mount one. Can you maybe see what's wrong?

    I hope you have a happy Easter and that the weather is real nice!

    Kind regards,
    Nia

    EDIT: Alright, I found out why the Mount one was the only one working. Because it was the only one I first had made a /run of and afterwards /run savebindings. I didn't do a savebindings to the rest, I just checked if they worked.
    Anyway, this just shows that I can't make an AddOn for this, all I have to do is run them all and then /run SaveBindings(2). It stays even after a relog. Hmmm?
    EDIT 2: It'll just be annoying if I have to /run all these (+ more to come) on every druid I level up. I have a lot! Surely there isn't a way to put it into an AddOn? : ))
    Last edited by mmoc057233bf06; 2014-04-22 at 12:14 PM.

  5. #25
    Deleted
    I'm only guessing at this point, but I'd assume that bindings information is not yet available when the UI is first loaded, so any SetBindingX calls will do nothing. Documentation appears to suggest that bindings information will first be available when UPDATE_BINDINGS fires, so I'd delay until then.

    Code:
    local f = CreateFrame("Frame")
    f:SetScript("OnEvent",function()
        SetBindingMacro("BUTTON12", "Flee")
        SetBindingMacro("BUTTON11", "Mount")
        SetBindingMacro("BUTTON10", "Moonfire")
        SetBindingSpell("BUTTON6", "Hurricane")
        SetBindingSpell("SHIFT-R", "Soothe")
        SetBindingMacro("BUTTON14", "Hibernate")
        SetBindingMacro("SHIFT-F", "Heal")
        SetBindingMacro("G", "CC")
        SetBindingMacro("BUTTON8", "Faerie")
        SetBindingMacro("SHIFT-BUTTON5", "C2")
        SetBindingMacro("BUTTON5", "C1")
    
        SaveBindings(2)
        f:UnregisterEvent("UPDATE_BINDINGS")
    end)
    f:RegisterEvent("UPDATE_BINDINGS")

  6. #26
    I found that I can use this macro to enable WoW's own combat text on target (not floating combat text):

    /run SetCVar("CombatDamage", 1)

    but I was wondering what I need to do to make it an addon that automatically does this. What do I type into the .lua file? I tried simply putting the above macro without /run but that didn't work, so what's missing?

    edit: I found some other example for setting CVars and edited it to just do what I need:

    Code:
    local CVars = {
     "CombatDamage",
    }
    
    local f = CreateFrame("Frame")
    f:RegisterEvent("PLAYER_LOGIN")
    f:SetScript("OnEvent", function(self, event, ...)
    		for i, cvar in ipairs(CVars) do
    			SetCVar(cvar, 1)
    		end
    end)
    Now I don't really have an array of CVars, so how to simplify the "for i, cvar in ipairs" part, or does it matter at all? And lets say I wanted to change that I would like to specify that the CVar "CombatHealing" was always 0, how would that work?
    Last edited by Ibis; 2014-07-14 at 12:45 PM.

  7. #27
    Quote Originally Posted by Ibis View Post
    Now I don't really have an array of CVars, so how to simplify the "for i, cvar in ipairs" part, or does it matter at all?
    Doesn't really matter, but you can do it like this:
    Code:
    local f = CreateFrame("Frame")
    f:RegisterEvent("PLAYER_LOGIN")
    f:SetScript("OnEvent", function()
    	SetCVar("CombatDamage", 1)
    end)
    Quote Originally Posted by Ibis View Post
    And lets say I wanted to change that I would like to specify that the CVar "CombatHealing" was always 0, how would that work?
    Just add the following
    Code:
    SetCVar("CombatHealing", 0)

    Also, you could just use the config.wtf file.

  8. #28
    Quote Originally Posted by Crudor View Post
    Doesn't really matter, but you can do it like this:
    Code:
    local f = CreateFrame("Frame")
    f:RegisterEvent("PLAYER_LOGIN")
    f:SetScript("OnEvent", function()
    	SetCVar("CombatDamage", 1)
    end)

    Just add the following
    Code:
    SetCVar("CombatHealing", 0)

    Also, you could just use the config.wtf file.
    Thanks! The problem was that I have a combat text addon that turns it off and I have characters that don't use the addon (or only use some part of it), so I had to always turn it on for those who should see it.

  9. #29
    Anyone able to help out with this:


    NoName.toc
    Code:
    ## Title: NoName
    ## Interface: 60000
    NoName.lua

    NoName.lua
    Code:
    local Frame = CreateFrame("Frame")
    Frame:RegisterEvent("PLAYER_LOGIN")
    
    Frame:SetScript("OnEvent", function(...)
    FriendsTabHeaderRecruitAFriendButton:Hide();
    end)
    Any reason this isnt working?

  10. #30
    Maybe something like this?
    Code:
    local b = FriendsTabHeaderRecruitAFriendButton
    b:UnregisterAllEvents()
    b.Show = function() end
    b:Hide()

  11. #31
    Quote Originally Posted by Ketho View Post
    Maybe something like this?
    Code:
    local b = FriendsTabHeaderRecruitAFriendButton
    b:UnregisterAllEvents()
    b.Show = function() end
    b:Hide()
    That works. Thanks.

  12. #32
    Deleted
    Code:
    COMBAT_TEXT_LOCATIONS = {startX  = 0,startY = 584 * COMBAT_TEXT_Y_SCALE,endX =0,endY = 809 * COMBAT_TEXT_Y_SCALE}

    I don't know how to turn it into addon. Anything I tried didn't work. Can someone help?
    Last edited by mmoca5484ed488; 2018-01-05 at 10:46 PM.

Posting Permissions

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