Thread Tools Display Modes
03-31-08, 11:50 PM   #1
Jayhawk
Premium Member
 
Jayhawk's Avatar
AddOn Author - Click to view addons
Join Date: May 2006
Posts: 105
CHAT_MSG_? gone?

I was wondering, as my addons seem to be broken, were Events such as CHAT_MSG_SPELL_AURA_GONE_SELF and CHAT_MSG_SPELL_PERIODIC_SELF_BUFFS removed or..?
  Reply With Quote
03-31-08, 11:58 PM   #2
Shirik
Blasphemer!
Premium Member
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2007
Posts: 818
You must have missed the biggest part of 2.4 Check out the UI changes thread in the news area.
__________________
たしかにひとつのじだいがおわるのお
ぼくはこのめでみたよ
だけどつぎがじぶんおばんだってことわ
しりたくなかったんだ
It's my turn next.

Shakespeare liked regexes too!
/(bb|[^b]{2})/
  Reply With Quote
04-01-08, 12:18 AM   #3
Jayhawk
Premium Member
 
Jayhawk's Avatar
AddOn Author - Click to view addons
Join Date: May 2006
Posts: 105
Well, I knew they were changing the combat log, what I didn't know was that they were going to remove the original functionality

Last edited by Jayhawk : 04-01-08 at 12:22 AM.
  Reply With Quote
04-01-08, 12:20 AM   #4
Shirik
Blasphemer!
Premium Member
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2007
Posts: 818
Anything you could do before you can do now (and more), you just have to use the new events outlined in Iriel's post on that page.
__________________
たしかにひとつのじだいがおわるのお
ぼくはこのめでみたよ
だけどつぎがじぶんおばんだってことわ
しりたくなかったんだ
It's my turn next.

Shakespeare liked regexes too!
/(bb|[^b]{2})/
  Reply With Quote
04-01-08, 12:23 AM   #5
Jayhawk
Premium Member
 
Jayhawk's Avatar
AddOn Author - Click to view addons
Join Date: May 2006
Posts: 105
Is there a simple tutorial explaining how to get the new one to behave in a way to parse this kind of information again?

Such as :


Code:
function PetInfoFu:CHAT_MSG_SPELL_AURA_GONE_SELF()
    -- catch the Feed Pet Effect fades
    if string.find(arg1, BS["Feed Pet Effect"]) ~= nil then 
        isFeedingPet = false
    end
    if string.find(arg1, BS["Improved Mend Pet"]) ~= nil  or 
        string.find(arg1, BS["Mend Pet"]) ~= nil then
        if self.petMendFrame ~= nil then 
            self.petMendFrame:Hide()
        end
    end
end
Iriels stuff looks... confusing
  Reply With Quote
04-01-08, 12:33 AM   #6
Shirik
Blasphemer!
Premium Member
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2007
Posts: 818
Have you tried taking a look at http://wowwiki.com/COMBAT_LOG_EVENT_Details yet? Unfortunately I haven't learned the new system yet myself, aside from absolute basics (no time), so I can't be of more assistance than that, unfortunately.
__________________
たしかにひとつのじだいがおわるのお
ぼくはこのめでみたよ
だけどつぎがじぶんおばんだってことわ
しりたくなかったんだ
It's my turn next.

Shakespeare liked regexes too!
/(bb|[^b]{2})/
  Reply With Quote
04-01-08, 12:35 AM   #7
Jayhawk
Premium Member
 
Jayhawk's Avatar
AddOn Author - Click to view addons
Join Date: May 2006
Posts: 105
Oh...help...
This is going to cost me half of forever to figure out.
Thanks for the help, though
  Reply With Quote
04-01-08, 09:33 AM   #8
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
Hope you get it figured out, Jayhawk.
__________________
"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
04-01-08, 10:58 AM   #9
archondan
A Deviate Faerie Dragon
 
archondan's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2005
Posts: 10
Originally Posted by Jayhawk View Post
Oh...help...
This is going to cost me half of forever to figure out.
Thanks for the help, though
Jayhawk,

The new combatlog / events are a tad confusing but seem be to be very powerful. I, my self, am still trying to figure out all the ins and outs of the new system but here is how I made sense of the new format.

1. Log into WoW and turn on CombatLog.txt ( console command /combatlog )
2. Cast/use the specific spell or ability you are looking for.
3. Logout of WoW and open Logs/CombatLog.txt.
4. Look for the event. In my case
--3/28 18:57:21.039 SPELL_ENERGIZE,0xF730004CD400ED3C,"Shadowfiend",0x1111,0x00000000005D7859,"Quella",0x511,34650,"Mana Leech",0x20,345,0
4. In the addon Register for the "COMBAT_LOG" event.
5. Create a filter with CombatLogAddFilter(EVENT,srcFlags,dstFlag)
In my case it was CombatLogAddFilter("SPELL_ENERGIZE",0x1111,0x511)

Now when ever an event matches the filer, as in the event above, the COMBAT_LOG event is fired. So now my addon only has to parse the exact event I am looking for instead of every combat related event.

I *think* I understand the basics

Hope this helps some.
  Reply With Quote
04-01-08, 12:30 PM   #10
Jayhawk
Premium Member
 
Jayhawk's Avatar
AddOn Author - Click to view addons
Join Date: May 2006
Posts: 105
Thanks Seerah, I think I did.

For PetInfoFu, I got the following:
Code:
self:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")

function PetInfoFu:COMBAT_LOG_EVENT_UNFILTERED(_, eventType, srcGUID, srcName, srcFlags, dstGUID, dstName, dstFlags, spellId, spellName, spellSchool, amount, ...)

    -- pet as destination
    if (dstName ~= nil) and 
       (dstName == UnitName("pet")) then
        if eventType == "SPELL_AURA_APPLIED" then
            if self.db.char.showMendPetFrame then
                if spellName == BS["Improved Mend Pet"] or 
                   spellName == BS["Mend Pet"] then
                   self:PetMendFrame()
                end
            end        
            if spellName == BS["Feed Pet Effect"] then -- feeding pet, start tracking 
                isFeedingPet = true
            end           
        elseif eventType == "SPELL_AURA_REMOVED" then
            if (spellName == BS["Improved Mend Pet"]) or 
               (spellName == BS["Mend Pet"]) then
                if self.petMendFrame ~= nil then 
                    self.petMendFrame:Hide()
                end
            end
            if spellName == BS["Feed Pet Effect"] then 
                isFeedingPet = false
            end           
        elseif eventType == "SPELL_CAST_SUCCESS" then
            -- if spellName == BS["Improved Revive Pet"] or 
            --    spellName == BS["Revive Pet"] then
            --     self:CalculateEstimatedHappiness(-350)
            -- end
        elseif eventType == "SPELL_PERIODIC_ENERGIZE" then
            if spellName == BS["Feed Pet Effect"] then 
                -- amount will contain the numer of happiness gained

            end           
        else
        end
    end
    
    -- pet as source
    if (srcName ~= nil) and 
       (srcName == UnitName("pet")) then
        if eventType == "UNIT_DIED" then
            DoSomething
        end
    end
    
    -- player as destination
    if (dstName ~= nil) and 
       (dstName == UnitName("player")) then
        if eventType == "SPELL_AURA_APPLIED" then
            -- strangely dismiss pet is applying an aura to the player
            DoSomething
        end
    end    
-- COMBATLOG:AddMessage('PetInfoFu: CLE '..crayon:Orange(srcName)..' '..crayon:Orange(dstName)..' '..crayon:Orange(eventType)..' '..crayon:Orange(spellName))  

end
It's not pretty as yet, but it works. Hardest part is figuring out which spell is what, for event type. I used the debugger at the end for that.
Archondan, that should work too, I think mine's more...lazy I haven't worked with the filters yet, may do so later.

I think... the current code works more cleanly, though. Further cleaning up, I guess, may be done by getting spellID's rather than comparing SpellNames.
  Reply With Quote
04-01-08, 06:28 PM   #11
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
SpellIDs don't need to be localized, whereas spell names do, iirc.
__________________
"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
04-01-08, 10:17 PM   #12
Jayhawk
Premium Member
 
Jayhawk's Avatar
AddOn Author - Click to view addons
Join Date: May 2006
Posts: 105
That's what I figured, sadly spellIDs are fairly "unreadable" and I haven't seen a list of constants as yet (I must admit I'm too lazy to make one myself at this stage). I'll be uploading this version so I have at leas an updated version, then, time permitting I'll get a list of spellIDs and get rid of Babble-Spell.

(Of course, I still need to get busy with SkillsPlusFu)
  Reply With Quote
04-02-08, 03:28 AM   #13
Layrajha
A Frostmaul Preserver
 
Layrajha's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 275
Originally Posted by Jayhawk View Post
That's what I figured, sadly spellIDs are fairly "unreadable" and I haven't seen a list of constants as yet (I must admit I'm too lazy to make one myself at this stage).
I don't think there's any list in Blizzard's UI at least, if that's what you mean. The localizations of the IDs are probably hidden in the mpq files. What makes me think that you can't reach the names from the IDs is simply that addons like DBM and Omen have a lua file to create these tables Of course, I'm trusting their authors on this one, but well, they've probably investigated?


(no, they haven't? well, sorry then :<)
  Reply With Quote
04-02-08, 02:28 PM   #14
Akryn
A Firelord
AddOn Author - Click to view addons
Join Date: Mar 2008
Posts: 479
just fyi, you normally don't want to use COMBAT_LOG_EVENT or change the filters unless your goal is to replace the combat log. changing the filters affects everything including the blizzard combat log.

for almost all addons, the event you want is COMBAT_LOG_EVENT_UNFILTERED
  Reply With Quote
04-03-08, 05:52 AM   #15
archondan
A Deviate Faerie Dragon
 
archondan's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2005
Posts: 10
Originally Posted by Akryn View Post
just fyi, you normally don't want to use COMBAT_LOG_EVENT or change the filters unless your goal is to replace the combat log. changing the filters affects everything including the blizzard combat log.

for almost all addons, the event you want is COMBAT_LOG_EVENT_UNFILTERED
Are you positive? I just ran a couple of simple tests with my addon. It sets up a filter for SPELL_ENERGIZE combat log event from the shadowfiend's mana leech. When i cast shadowfiend, I still see my smite damage and other events in the combat log.

So it *appears* that the combat filter I setup does not affect the combat log chat window.

Please correct me if i am wrong. I'm still trying to figure out the finer details of the new combat log
  Reply With Quote
04-03-08, 08:36 AM   #16
Akryn
A Firelord
AddOn Author - Click to view addons
Join Date: Mar 2008
Posts: 479
i honestly haven't played around enough with filtering enough to know for sure, but my understanding was that every time you add a filter, it gets added globally; so that if someone did not want to see those events, and you added a filter for them, they would start to show up anyway.

COMBAT_LOG_EVENT fires for every frame that is registered for it, but you can filter it so that it doesn't fire at all except under certain circumstances. you can't tell the game to only fire it for specific frames though.
  Reply With Quote
04-04-08, 04:49 AM   #17
Jayhawk
Premium Member
 
Jayhawk's Avatar
AddOn Author - Click to view addons
Join Date: May 2006
Posts: 105
That's an interesting conundrum, Akryn, thanks.
As for the SpellID's I'm sure there will be a library at some stage

I had a friendly person give me an alternative to the code I used. He uses an interesting approach to filtering:
Code:
function PetInfoFu:COMBAT_LOG_EVENT_UNFILTERED( timestamp, eventType, srcGUID, srcName, srcFlags, dstGUID, dstName, dstFlags, spellID, spellName, spellSchool, amount, ... )
   if dstFlags == bit.band( dstFlags, bit.bor( COMBATLOG_OBJECT_AFFILIATION_MINE,
                                               COMBATLOG_OBJECT_REACTION_FRIENDLY,
                                               COMBATLOG_OBJECT_CONTROL_PLAYER,
                                               COMBATLOG_OBJECT_TYPE_PET ) ) then
        DoSomething
    end
end

Also interesting is that where I'm using the eventType as base for my 'case' he used the spellID. I wonder which is more efficient, but it's probably dependent on what one tries to do.
  Reply With Quote
04-04-08, 06:04 AM   #18
Layrajha
A Frostmaul Preserver
 
Layrajha's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 275
Originally Posted by Jayhawk View Post
I had a friendly person give me an alternative to the code I used. He uses an interesting approach to filtering:
Code:
function PetInfoFu:COMBAT_LOG_EVENT_UNFILTERED( timestamp, eventType, srcGUID, srcName, srcFlags, dstGUID, dstName, dstFlags, spellID, spellName, spellSchool, amount, ... )
   if dstFlags == bit.band( dstFlags, bit.bor( COMBATLOG_OBJECT_AFFILIATION_MINE,
                                               COMBATLOG_OBJECT_REACTION_FRIENDLY,
                                               COMBATLOG_OBJECT_CONTROL_PLAYER,
                                               COMBATLOG_OBJECT_TYPE_PET ) ) then
        DoSomething
    end
end
Well, really, this is the kind of approach that was expected in the changes, I believe. Because, well, even if Lua isn't the best language to manipulate binary numbers, here we are given the data that the game uses, and there are obviously filters of this kind used all the time.

I would probably use
Code:
if band(event_s_dstFlags, bnot_of_my_filter's_dstFlags) ~= 0 then
  blabla
end
instead of
Code:
if band(event's_dstFlags, my_filter's_dstFlags) == event's_dstFlags then
  blabla
end
but I can't find any proper justification for that I just understand it better, and I usually prefer to compare things to fixed values and not to have the same variable on the two sides of my equalities. But both give the same result and are understandable, and I don't think that you'd feel any difference CPU-wise.
  Reply With Quote
04-08-08, 12:33 PM   #19
Jayhawk
Premium Member
 
Jayhawk's Avatar
AddOn Author - Click to view addons
Join Date: May 2006
Posts: 105
Hmmm-kay. Bit logic isn't quite my cup of tea, so I guess I'll stick with the way as was suggested to me earlier I hope to find some time this weekend to go fiddle with it.
  Reply With Quote
04-08-08, 06:56 PM   #20
Layrajha
A Frostmaul Preserver
 
Layrajha's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 275
Originally Posted by Jayhawk View Post
Hmmm-kay. Bit logic isn't quite my cup of tea, so I guess I'll stick with the way as was suggested to me earlier I hope to find some time this weekend to go fiddle with it.
Well, both expressions mean:
"All the bits that are 1s in the event's flags should be at 1 as well in my filter's flags."
It's a binary "⇒", basically.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » CHAT_MSG_? gone?


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