Don't know wich browsers you use, but on Firefox and Chrome it doesn't look good.
Copied the code and edited it in browser just to make it more readable.
Edited it, so now it's with tabs instead of spaces.
There is one difference in the code however, added brackets in the two AND OR statements.
"a AND b OR c" to "a AND ( b OR c)"
Except, you changed the meaning of the statements.
"a AND b OR c" => Returns b if a is not nil and not false. Returns c if a is nil or false.
"a AND ( b OR c)" => Returns b if a is not nil and not false and b is not nil and not false. Returns c if a is not nil and not false and b is nil or false.
You're not going to get much reception with this method. You're better off just posting what you want in the forums. Whether it's private (I assume you mean that it'll just be for you) or not is irrelevant, and if you mean proprietary (which is moot), there are no secrets among addon developers and once your addon is made public everybody will be able to see the code anyway.
"Table index is nil" means there's nothing in the slot you're trying to access not that the table is nil or empty (necessarily), there's no line 296 in your paste code, so I can't be of much help in that department.
How would you make Guild_Roster_Update run when somebody joins your guild? I'd assume it would be
Guild_Roster_Update(Join)
but that doesn't work. Any and all help would be appreciated. Thanks in advance
If you're talking about the event, GUILD_ROSTER_UPDATE, you don't. It fires when something in the guild changes. If you're talking about a function that refreshes the guild roster, GuildRoster() is the one.
Side note: If you're going to assume a function's name, Blizzard's convention is <window>_<action> (e.g. GuildRoster_Update()).
:SetUserPlaced() was part of my pseudo code which does not include :SetMovable(). :SetPoint() doesn't call it.
At any rate, when a frame (the action buttons) with mouse enabled is on top of another frame (the action bar frame) with mouse enabled, the top frame receives the mouse.
And, yes, I have tried similar code when trying to make my TradesBar frame movable. You either have to make the buttons click through (:EnableMouse(false)) or use the buttons' OnDragStart/Stop to call their parent's *Move* functions.
Edit: Also, even if it's not parented to UIParent, :StartMoving() unparents it.
Like egingell mentioned, try with the "COMBAT_LOG_EVENT" event
local MyAddon = LibStub("AceAddon-3.0"):NewAddon("MyAddon", "AceConsole-3.0");
function MyAddon:OnEnable()
self:RegisterEvent("COMBAT_LOG_EVENT", "doCombatLogCheck")
end
function MyAddon:doCombatLogCheck(...)
local param1, param2, param3, param4, param5, param6, param7, param8, param9, param10, param11, param12, param13, param14, param15, param16 = ...
if param3 == "SPELL_AURA_APPLIED" and param6 == UnitName("player") then
self:Print("You placed "..param14.." On "..param10)
elseif param3 == "SPELL_AURA_REFRESH" and param6 == UnitName("player") then
self:Print("You refreshed "..param14.." On "..param10)
end
end
Just so you're aware, COMBAT_LOG_EVENT is an event like any other. When you register and call it in that fashion, you have to account for all of the proper arguments (param1 == "COMBAT_LOG_EVENT", param2 in the context above is param1 of the base parameters on WowPedia. Edit: Disclaimer: This reply is not directed to Priam_, he has the correct variables where they go. I'm just speaking in general.
So, to disambiguate it from the website, I would write it like this (or use words for the variable names):
local MyAddon = LibStub("AceAddon-3.0"):NewAddon("MyAddon", "AceConsole-3.0");
function MyAddon:OnEnable()
self:RegisterEvent("COMBAT_LOG_EVENT", "doCombatLogCheck")
end
function MyAddon:doCombatLogCheck(...)
local _, param1, param2, param3, param4, param5, param6, param7, param8, param9, param10, param11, param12, param13, param14, param15, param16 = ...
if param2 == "SPELL_AURA_APPLIED" and param5 == UnitName("player") then
self:Print("You placed "..param13.." On "..param9)
elseif param2 == "SPELL_AURA_REFRESH" and param5 == UnitName("player") then
self:Print("You refreshed "..param13.." On "..param9)
end
end
I am trying to trigger a soundfile to play when targetting a unit and they pop a certain aura(s). Here is basically what it will look like:
[PHP] if ("UNIT_AURA") then
if (UnitAura("target", "Hand of Protection")) then
PlaySoundFile(directory.."soundfile.mp3");
end
end[/PHP]
The problem is that it will spam during any aura changes I have or they have. Which makes sense, since the event handler hooks anytime Auras change and the requirements are met. I was wondering if I can limit it to only doing it on the initial change of the specified aura and for it not to trigger after.
For example, let's say I am healing someone and HoP them, soundfile initializes. Then someone comes in and gives them another buff, the soundfile will initialize again. I don't want it to.
Anyone have any ideas? Thanks!
/facepalm
if ([B]event == [/B]"UNIT_AURA") then
if (UnitAura("target", "Hand of Protection")) then
PlaySoundFile(directory.."soundfile.mp3");
end
end
Edit: Also, If you want to stop it from spamming, you need to use some sort of caching. E.g. Put target names into a table with timers per each one.
0
Except, you changed the meaning of the statements.
"a AND b OR c" => Returns b if a is not nil and not false. Returns c if a is nil or false.
"a AND ( b OR c)" => Returns b if a is not nil and not false and b is not nil and not false. Returns c if a is not nil and not false and b is nil or false.
0
They also must to be consecutive starting with 1. E.g:
#foo is still 3.
#bar is 0.
0
0
http://norganna.org/discuss/
There are also beta releases up on its download page.
http://auctioneeraddon.com/dl/
0
0
Just saying.
0
0
Your post is severely lacking. If you expect help, you need to provide more information than that. Error messages, the name of the addon, etc.
0
0
If you're talking about the event, GUILD_ROSTER_UPDATE, you don't. It fires when something in the guild changes. If you're talking about a function that refreshes the guild roster, GuildRoster() is the one.
Side note: If you're going to assume a function's name, Blizzard's convention is <window>_<action> (e.g. GuildRoster_Update()).
0
0
At any rate, when a frame (the action buttons) with mouse enabled is on top of another frame (the action bar frame) with mouse enabled, the top frame receives the mouse.
And, yes, I have tried similar code when trying to make my TradesBar frame movable. You either have to make the buttons click through (:EnableMouse(false)) or use the buttons' OnDragStart/Stop to call their parent's *Move* functions.
Edit: Also, even if it's not parented to UIParent, :StartMoving() unparents it.
0
Just so you're aware, COMBAT_LOG_EVENT is an event like any other. When you register and call it in that fashion, you have to account for all of the proper arguments (param1 == "COMBAT_LOG_EVENT", param2 in the context above is param1 of the base parameters on WowPedia. Edit: Disclaimer: This reply is not directed to Priam_, he has the correct variables where they go. I'm just speaking in general.
So, to disambiguate it from the website, I would write it like this (or use words for the variable names):
0
'Tis better to get an addon like MoveAnything or use :ClearAllPoints() + :SetPoint() + :SetUserPlaced(true).
0
Edit: Also, If you want to stop it from spamming, you need to use some sort of caching. E.g. Put target names into a table with timers per each one.
Edit: Or use COMBAT_LOG_EVENT instead.