Doesn't work, even tried the camera distance on its own, still didn't work.
Doesn't work, even tried the camera distance on its own, still didn't work.
Awesome guide, really helped me out, ty
Odd it isnt stickied
Would clutter up the forum too much. We already have too many stickies.
It's linked in the other sticky though.
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:
The only one working is the Mount one. Can you maybe see what's wrong?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)
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.
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")
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:
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?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)
Last edited by Ibis; 2014-07-14 at 12:45 PM.
Doesn't really matter, but you can do it like this:
Just add the followingCode:local f = CreateFrame("Frame") f:RegisterEvent("PLAYER_LOGIN") f:SetScript("OnEvent", function() SetCVar("CombatDamage", 1) end)
Code:SetCVar("CombatHealing", 0)
Also, you could just use the config.wtf file.
Anyone able to help out with this:
NoName.toc
Code:## Title: NoName ## Interface: 60000 NoName.lua
NoName.lua
Any reason this isnt working?Code:local Frame = CreateFrame("Frame") Frame:RegisterEvent("PLAYER_LOGIN") Frame:SetScript("OnEvent", function(...) FriendsTabHeaderRecruitAFriendButton:Hide(); end)
Maybe something like this?
Code:local b = FriendsTabHeaderRecruitAFriendButton b:UnregisterAllEvents() b.Show = function() end b:Hide()
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.