Thread Tools Display Modes
08-20-08, 05:36 PM   #1
Kallieen
Lady of Shadows
 
Kallieen's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2006
Posts: 54
Help with COMBAT_LOG_EVENT

I'm going nuts here trying to track down what's causing this code to not work

Code:
local AnnoyingSelfBuffReminder = CreateFrame("Button", "AnnoyingSelfBuffReminder", UIParent)

AnnoyingSelfBuffReminder:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")

AnnoyingSelfBuffReminder:SetScript("OnEvent", function(frame,event,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)
    if a3 == UnitGUID("player") then
        DEFAULT_CHAT_FRAME:AddMessage("YAY!");
            if a2 == "SPELL_AURA_REMOVED" then
                DEFAULT_CHAT_FRAME:AddMessage("YAY! :D");
                    if a10 == "Lifebloom" then
                        DEFAULT_CHAT_FRAME:AddMessage("LB FTW!");
                    end    
            end    
    end
end)
As is, if I cast Lifebloom on myself, the first chat message, 'YAY!' fires on application and removal of the spell, as well as on each tick, but neither of the other two messages show up. 'YAY!' shows up anytime I cast anything at all, so that part seems to be working.

If I comment out the first 'if' statement, and cast Lifebloom, I get the second and third chat messages when it fades.

If I comment out the second 'if' statement, and un-comment the first, and cast Lifebloom, I get the first and third chat messages.

Indepentantly, they work. Put together, they don't. I'm really stumped as to why, any thoughts?
__________________
[SIGPIC][/SIGPIC]
  Reply With Quote
08-20-08, 06:06 PM   #2
Taffu
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Jan 2006
Posts: 149
When lifebloom fades (ie. SPELL_AURA_REMOVED) it's not going to create (or show) a sourceID value (arg3 & arg4). Therefore, your first "if" statement is voiding the fire of that event because there's no sourceID to compare.

Lifebloom (and other stackables) are tricky, and require using the destID (target GUID) to compare active aura's. In short, Lifebloom (or stackables) are not the best "buff" to test your code with. However if you want to use Lifebloom as a spell caught by your AddOn, you're going to have to take a different approach.
  Reply With Quote
08-20-08, 06:20 PM   #3
Kallieen
Lady of Shadows
 
Kallieen's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2006
Posts: 54
No, I was just using Lifebloom because it's a six second 'buff'. I'll try testing with Thorns, see if I can figure it out from there. Thanks for the help.

(And I'm sure I'll be back if I can't figure it out! )
__________________
[SIGPIC][/SIGPIC]
  Reply With Quote
08-20-08, 06:34 PM   #4
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
I suggest downloading DevTools - this will tell you the results of each arg. Or at least turn on combat logging (/combatlog) cast the spells you want to cast, let things wear off, etc. All the things you want to test for. Then log out and check the log in your Logs folder.
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
08-21-08, 05:57 AM   #5
Taffu
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Jan 2006
Posts: 149
Yes Lifebloom (and any other HoT) create a buff. But again, with the way you're sequencing your statements, you aren't going to trigger the second statement with the first active, because the event for the second doesn't trigger the first due to there being no SourceID (arg3) with the event SPELL_AURA_REMOVED.

Like Seerah suggested, use DevTools to get argument feedback from the COMBAT_LOG_EVENT event. It will surprise you how many silly little quirks there are in there. Or, simply have debug output print the arguments as they happen so you can see what each argument represents and which ones are consistent through different events. The problem you're having is probably fixed as easily as comparing the DestID to your player GUID instead of the SourceID. Good luck!
  Reply With Quote
08-21-08, 10:18 AM   #6
Kallieen
Lady of Shadows
 
Kallieen's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2006
Posts: 54
Yeah, I see what you mean. Thanks for the help!

And yes, switching to checking the dstGUID seems to have fixed the issue I was having, thanks again.
__________________
[SIGPIC][/SIGPIC]
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Help with COMBAT_LOG_EVENT


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off