Thread Tools Display Modes
04-16-08, 01:48 PM   #1
phaze112
A Deviate Faerie Dragon
Join Date: Mar 2007
Posts: 10
New Combat Log System Help

I am really trying to understand this new combat log system so that I can use SCT to work with custom events.

I am looking at the combat log while also referencing this site here:
http://www.wowwiki.com/API_COMBAT_LOG_EVENT


It just appears to be missing alot of information, I am wondering maybe if an author here might have a more compete version?

For example I am trying to get something where I am notified when a Tremor Totem gets dropped, but I see this in my combat log:
4/15 20:31:14.015 SPELL_CAST_SUCCESS,0x0000000001830A84,"Sramana-Silver Hand",0x514,0x0000000000000000,nil,0x80000000,8143,"Tremor Totem",0x8
4/15 20:31:14.015 SPELL_SUMMON,0x0000000001830A84,"Sramana-Silver Hand",0x514,0xF130001719000877,"Tremor Totem",0xa28,8143,"Tremor Totem",0x8


So i'm thinknig a search for Tremor Totem on the spell cast success but what does all the other stuff mean?

Also does anyone know what the range is on this combat log that we see here?

Thanks all sorry for writing so much

Travis
  Reply With Quote
04-16-08, 03:25 PM   #2
phaze112
A Deviate Faerie Dragon
Join Date: Mar 2007
Posts: 10
correction

My fault, I should of read that link more in depth. It actually explains it all down to a T!

So I understand the given lines, but my question is still out there.

How could I detect an area even like Tremor Totem if I am not targeting the person who drops it. For example in the SCT custom events there is BUFFTARGET type but that is only if the person is your target...

Thanks all!
  Reply With Quote
04-16-08, 09:24 PM   #3
ganders
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: May 2007
Posts: 131
Originally Posted by phaze112 View Post
4/15 20:31:14.015 SPELL_CAST_SUCCESS,0x0000000001830A84,"Sramana-Silver Hand",0x514,0x0000000000000000,nil,0x80000000,8143,"Tremor Totem",0x8
4/15 20:31:14.015 SPELL_SUMMON,0x0000000001830A84,"Sramana-Silver Hand",0x514,0xF130001719000877,"Tremor Totem",0xa28,8143,"Tremor Totem",0x8
4/15 20:31:14.015 Timestamp
SPELL_CAST_SUCCESS Event Type (In this case, the SPELL_SUMMON succeeded, resulting in a Totem)
0x0000000001830A84 Source GUID (The source in this case is Sramana, the person who summoned the totem)
Sramana-Silver Hand Source Name
0x514 Source Flags
0x0000000000000000 Target GUID (There is no target when you conjure a totem)
nil Target Name
0x80000000 Target Flags
8143 Spell ID
"Tremor Totem" Spell Name
0x8 Spell School

That's all from the first event: SPELL_CAST_SUCCESS. The next Event, SPELL_SUMMON, is the event fired when the totem actually pops into existence.

I'm not sure how you use SCT events, but this is how you would do it.
Code:
frame:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
frame:SetScript("OnEvent", function(self, event, ...)
    self[event](...)
end)
local spellID, spellName
frame.COMBAT_LOG_EVENT_UNFILTERED = function(...)
    if arg2 == "SPELL_SUMMON" then
        spellID = arg9
        spellName = GetSpellInfo(spellID)
        if spellName == "Tremor Totem" then
            do stuff
        end
    end
end
I hope that helps.

Last edited by ganders : 04-16-08 at 09:28 PM.
  Reply With Quote
04-17-08, 12:42 PM   #4
phaze112
A Deviate Faerie Dragon
Join Date: Mar 2007
Posts: 10
ok

ok Great. So I understand almost all of that with the help of wowwiki but here what I don't understand:

function(self, event, ...)
self[event](...)

and a few lines lower it says:
function(...)

I'm not understanding the purpose of that function.

If I just want to be able to view all events and just use if then cases to distinguish what I want to pay attention to and act on...

So telling it to look at all events... frame:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")

and setting temp variables so I can check and set my cases...
local spellID, spellName

and I understand when it says... frame:SetScript("OnEvent", ... it is saying run this script for each event but then the 2nd part of that I don't get what... function(self, event, ...)
self[event](...) ......... is used for?

I also get confused again when I see this function(...) and what it is referring to:
frame.COMBAT_LOG_EVENT_UNFILTERED = function(...)

as it seems unnecessary but maybe they are technicalities that just need to be there?

Thanks again for the help

Travis

Last edited by phaze112 : 04-17-08 at 12:45 PM.
  Reply With Quote
04-17-08, 03:36 PM   #5
ganders
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: May 2007
Posts: 131
Originally Posted by phaze112 View Post
ok Great. So I understand almost all of that with the help of wowwiki but here what I don't understand:

function(self, event, ...)
self[event](...)

and a few lines lower it says:
function(...)

I'm not understanding the purpose of that function.

If I just want to be able to view all events and just use if then cases to distinguish what I want to pay attention to and act on...

So telling it to look at all events... frame:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")

and setting temp variables so I can check and set my cases...
local spellID, spellName

and I understand when it says... frame:SetScript("OnEvent", ... it is saying run this script for each event but then the 2nd part of that I don't get what... function(self, event, ...)
self[event](...) ......... is used for?

I also get confused again when I see this function(...) and what it is referring to:
frame.COMBAT_LOG_EVENT_UNFILTERED = function(...)

as it seems unnecessary but maybe they are technicalities that just need to be there?

Thanks again for the help

Travis
Code:
frame:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
means that this frame will only listen for the event COMBAT_LOG_EVENT_UNFILTERED, and that's the event we want to know what's happening combat-wise.
Code:
frame:SetScript("OnEvent", function(self, event, ...)
    self[event](...)
end)
This tells your addon what to do when an event it is listening for (in this case, COMBAT_LOG_EVENT_UNFILTERED) occurs.

SetScript(type, function)
is the function you use to set a script for a frame. In this case, the type is "OnEvent" (when an event we're listening for occurs) and the function is function(self, event, ...) self[event](...) end. the self, event, ... arguements are:
self = this frame. Using self is a replacement to using frame. That's all really.
event = the event that happened. Since we only registered one event, that event will be the same every time (COMBAT_LOG_EVENT_UNFILTERED).
... = extra arguments. These are the arguments that are passed along WITH the event. COMBAT_LOG_EVENT_UNFILTERED passes a lot of arguements, 8 minimum. And we want to catch all of them. So using ... is just an easier way of doing arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12

frame.COMBAT_LOG_EVENT_UNFILTERED = function(...)
Look above to self[event](...). That's this function. self[event](...) translates to frame[COMBAT_LOG_EVENT_UNFILTERED](...), which then calls this function and passes all the arguments from the event to this function, where we use them to make it do whatever we want.
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » New Combat Log System Help


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