WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   AddOn Help/Support (https://www.wowinterface.com/forums/forumdisplay.php?f=3)
-   -   Combat_Log_Event simple explanation please.. (https://www.wowinterface.com/forums/showthread.php?t=15457)

Inokis 03-25-08 03:33 PM

Combat_Log_Event simple explanation please..
 
I have no clue what the new combat log syntax is or anything. None of it makes sense.

Can someone please provide a working example of the new combat log format for this event so I can understand what the format is supposed to be:

if (event == "UNIT_AURA" and arg1 == "pet") then

Thaenin 03-26-08 10:30 AM

Quote:

Originally Posted by Inokis (Post 86060)
I have no clue what the new combat log syntax is or anything. None of it makes sense.

Can someone please provide a working example of the new combat log format for this event so I can understand what the format is supposed to be:

if (event == "UNIT_AURA" and arg1 == "pet") then

I second that! So far I resent the update, as I usually do. The new combat log is nothing special. All it did was over-complicate simple tasks as far as I can tell. I'm having a similar problem trying to identify killing blows with the new patch. Hopefully we'll both get what we need!...=)

Thaenin

Akryn 03-26-08 10:58 AM

I'm sure you've seen this:

http://www.wowwiki.com/COMBAT_LOG_EVENT_Details

Which is pretty un-user friendly, but has a lot of info. here are some quick tips:

1. The only event you care about or want to register is "COMBAT_LOG_EVENT_UNFILTERED"
2. The second argument of the above event is also called "event" but it is not an event, it's a string representing the sort of thing that happened to trigger "COMBAT_LOG_EVENT_UNFILTERED"
3. There are 8 base arguments from "COMBAT_LOG_EVENT_UNFILTERED", they are: timestamp, event, sourceGUID, sourceName, sourceFlags, destGUID, destName, destFlags
4. If you just want to get the same functionality as the 2.3 log, all you care about are "event", and the two "name"s
5. For the most part you can ignore "flags," if you aren't used to them. They're there to help filter things faster, but you can still use "name" to do that yourself.
6. GUIDs are useful if you need to seperate entities that have the same name, for example:
if destGUID == UnitGUID("target") then --the thing that got hit *is* my target, and I know this even if there are other things with the same name
7. Each possible value of "event" (arg2) has its own set of additional arguments that get passed *after* arg8 (destFlags)
7-a. Up to 3 of those are determined by the first word of "event", for example "COMBAT_LOG_EVENT_UNFILTERED" events which have an arg2 that starts with "SPELL_", have an arg9 "spellId"
7-b. Up to 8 more arguments *after* the 3 from the last point are determined by the remaining words of "event", for example if arg2 contains "_DAMAGE" then the event has an arg12 of "amount"


Hopefully that helps in decoding the wowwiki stuff somewhat better. :)

Inokis 04-03-08 06:31 PM

is this anywhere close to being right?

Code:

        if (event == "COMBAT_LOG_EVENT_UNFILTERED") then
                local mypetBuffDest == UnitName("pet");
                if ((arg2 == "COMBAT_LOG_EVENT_AURA_APPLIED") and (arg7 == mypetBuffDest)) then
                        if (arg1 == "BUFF") then

                        end
                elseif ((arg2 == "COMBAT_LOG_EVENT_AURA_REMOVED") and (arg7 == mypetBuffDest)) then
                        if (arg1 == "BUFF") then

                        end
                end
        end


Akryn 04-03-08 09:03 PM

should be like:

Quote:

Originally Posted by Inokis (Post 87618)
Code:

elseif ((arg2 == "SPELL_AURA_REMOVED") and (arg7 == mypetBuffDest)) then
                        if (arg12 == "BUFF") then


base params go up to 8, then the prefix params go up to (at most) 11, then the suffix params start, wherever the prefix params left off

Inokis 04-04-08 07:02 AM

Using the info you gave me:
Code:

        if (event == "COMBAT_LOG_EVENT_UNFILTERED") then
        local mypetBuffDest = UnitName("pet");
                if ((arg2 == "SPELL_PERIODIC_AURA_APPLIED") and (arg7 == mypetBuffDest)) then

                end
        end

I was able to return the following info for the Pet Feeding:
timestamp - arg1 == 1207312869.231
event - arg2 == SPELL_PERIODIC_ENERGIZE
srcGUID - arg3 == 0x00000000004B7A6C
srcName - arg4 == PlayerName
srcFlags - arg5 == 1297
destGUID - arg6 == 0xF54035EBC8000028
destName - arg7 == Pet Name
destFlags - arg8 == 4369
spellID - arg9 == 1539
spellName - arg10 == Feed Pet Effect
spellSchool - arg11 == 1 (Physical)
PowerAmount?? - arg12 == 0
powerType - arg 13 == 4 (Pet Happiness)
If Arg 12 does indeed indicate powertype then string finding is obsolete as you can just compare arg 12 with the value that corresponds to the original string. Lemme know if there's anything more you can add to this. I think my understanding is along the right track though.

Now I can understand, using wowwiki information how the filters and stuff works to get this info. What I don't quite understand yet is how to do a string compare. In the old event system we could just use arg1 as the string compare but with all of these values, where is the actual string stored:
Code:

string.find(argX, "(.+) gains ## Happiness()");

Layrajha 04-04-08 07:41 AM

In GlobalString.lua:

SPELLHAPPINESSDRAINOTHER = "%s's %s loses %d happiness.";
SPELLHAPPINESSDRAINSELF = "Your %s loses %d happiness.";
POWERGAINOTHEROTHER = "%s gains %d %s from %s's %s.";

Etc... :)

Akryn 04-04-08 07:45 AM

there isn't one, the default combat log creates its messages from the various parameters it gets now (using globalstring.lua), instead of just outputting a string that the server created for it.

Inokis 04-04-08 08:55 AM

Thank you for helping me understand the log enough to get this working. Once I was able to get the specific arguments, it made deciphering the event a lot simpler. Let me know if you'd do anything differently.

This is what I ended up with and it seems to be working fine:
Code:

        if (event == "COMBAT_LOG_EVENT_UNFILTERED") then
        local mypetBuffDest = UnitName("pet");
        local myBuffDest = UnitName("player");
                if ((arg2 == "SPELL_PERIODIC_ENERGIZE") and (arg4 == myBuffDest) and (arg7 == mypetBuffDest) and (arg10 == "Feed Pet Effect")) then
                        PetEXPInfoBar_Update();
                        PetEXPInfoBar_BuffCheck();
                        PetEXPInfoBar_FeedPet();
                        PetEXPInfoBar_State();
                elseif not ((arg2 == "SPELL_PERIODIC_ENERGIZE") and (arg4 == myBuffDest) and (arg7 == mypetBuffDest) and (arg10 == "Feed Pet Effect")) then
                        PetEXPBarFeedText:Hide();
                end
        end

function HappyFeed()
                if (arg12 == 35) then
                        PetEXPBarFeedText:SetText("35 H");
                        return true;
                elseif (arg12 == 34) then
                        PetEXPBarFeedText:SetText("34 H");
                        return true;
                elseif (arg12 == 33) then
                        PetEXPBarFeedText:SetText("33 H");
                        return true;
                elseif (arg12 == 32) then
                        PetEXPBarFeedText:SetText("32 H");
                        return true;
                elseif (arg12 == 31) then
                        PetEXPBarFeedText:SetText("31 H");
                        return true;       
                elseif (arg12 == 30) then
                        PetEXPBarFeedText:SetText("30 H");
                        return true;
                end

                etc .. etc.. etc..
end



All times are GMT -6. The time now is 09:29 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI