12-30-2004, 03:58 PM
MongoJerry,Dec 27 2004, 02:00 PM Wrote:Hmmm... there must be something around. I'm pretty sure Cosmos uses some kind of log parcer to figure out a person's dps on the fly.
[right][snapback]63662[/snapback][/right]
I just took a look at the code for DPSPLUS. It does very quick and dirty parsing for just the things it needs, such as:
Code:
-- Player Processing
if (DPSPLUS_Player_OnOff == 1) then
if ( (type == "COMBAT_SELF_HITS") or (type == "SPELL_SELF_DAMAGE") or (type == "COMBAT_PET_HITS") or (type == "SPELL_PET_DAMAGE") ) then
_, _, d = string.find(arg1, ".* for (%d+).*");
elseif ( (type == "SPELL_PERIODIC_HOSTILEPLAYER_DAMAGE") or (type == "SPELL_PERIODIC_CREATURE_DAMAGE") ) then
_, _, d = string.find(arg1, ".* (%d+) .* from your .*");
end
-- Matched, Record this Entry
if ( d ~= nil ) then
dpsplus_addentry("Your", d);
return DPSPLUS_Player_Eat;
end
end
I'm just barely starting to learn about how this fits together, so I am not sure where the caller is, but it looks like chat watching (log watching) has some stuff that is common among several Cosmos add-ons:
Code:
Cosmos_RegisterChatWatch(
"DPSPLUS_WATCHES",
{"COMBAT_SELF_HITS", "SPELL_SELF_DAMAGE",
"COMBAT_PET_HITS", "SPELL_PET_DAMAGE",
"SPELL_PERIODIC_HOSTILEPLAYER_DAMAGE", "SPELL_PERIODIC_CREATURE_DAMAGE",
"COMBAT_PARTY_HITS", "SPELL_PARTY_DAMAGE"},
DPSPLUS_Watch
);
Have to look up that code later...