Wednesday, April 18, 2012

Help on new 2.4 combat log...

I use COMBAT_LOG_EVENT_UNFILTERED




Code:
  if (event == "COMBAT_LOG_EVENT_UNFILTERED")  then
local timestamp, eventtype, sourceGUID, sourceName, sourceFlags, destGUID, destName, destFlags, ... = COMBAT_LOG_EVENT_UNFILTERED;
local toPlayer, fromPlayer, toPet, fromPet, toTarget, myEnemy, npcStatus;
local OBJECT_TYPE_ENEMY_PLAYER = bit.bor(
COMBATLOG_OBJECT_AFFILIATION_OUTSIDER,
COMBATLOG_OBJECT_REACTION_HOSTILE,
COMBATLOG_OBJECT_TYPE_PLAYER,
COMBATLOG_OBJECT_CONTROL_PLAYER,
COMBATLOG_OBJECT_TARGET
);
local OBJECT_TYPE_ENEMY_PET = bit.bor(
COMBATLOG_OBJECT_AFFILIATION_OUTSIDER,
COMBATLOG_OBJECT_REACTION_HOSTILE,
COMBATLOG_OBJECT_TYPE_PET,
COMBATLOG_OBJECT_CONTROL_PLAYER,
COMBATLOG_OBJECT_TARGET
);

if (sourceName and not CombatLog_Object_IsA(sourceFlags, COMBATLOG_OBJECT_NONE) ) then
fromPlayer = CombatLog_Object_IsA(sourceFlags, COMBATLOG_FILTER_MINE);
fromPet = CombatLog_Object_IsA(sourceFlags, COMBATLOG_FILTER_MY_PET);
end

if (destName and not CombatLog_Object_IsA(destFlags, COMBATLOG_OBJECT_NONE) ) then
toPlayer = CombatLog_Object_IsA(destFlags, COMBATLOG_FILTER_MINE);
toPet = CombatLog_Object_IsA(destFlags, COMBATLOG_FILTER_MY_PET);
toTarget = CombatLog_Object_IsA(destFlags, COMBATLOG_OBJECT_TARGET);
myEnemy = CombatLog_Object_IsA(destFlags, OBJECT_TYPE_ENEMY_PLAYER );
end

if eventtype == "PARTY_KILL" or eventtype == "UNIT_DESTROYED" then
BGMSG_Print("******* Killing Blow ******* - PK");
local killtext = "You have slain "..destName..".";
local isNPC = 1;

if toTarget then
if fromPlayer or fromPet then
if myEnemy and not npcStatus then
-- KILLSHOT!
if destFlags == OBJECT_TYPE_ENEMY_PLAYER then
isNPC = 0;
end
BGMSG_Print("******* Killing Blow ******* "..killtext);
end
end
end
end

end

Should work.... but no... anyone can help me thanks...|||It should be like this.


Code:
function MyAddon_OnEvent(...)
if event == "COMBAT_LOG_EVENT_UNFILTERED" then
local timestamp, eventType, sourceGUID, sourceName, sourceFlags, destGUID, destName, destFlags = ...
do something here
end
end
|||Jumpy, are there any basic primers for the 2.4 combat log out there? Something more than the summary post by blue when 2.4 was released, with a concrete, complete little example script. A mini addon would be perfect. Most of what I've seen are incomplete code snippets and while I've been fiddling with it, I'm clearly missing something. If you have any suggestions I'd love to hear them:)|||Quote:








Jumpy, are there any basic primers for the 2.4 combat log out there? Something more than the summary post by blue when 2.4 was released, with a concrete, complete little example script. A mini addon would be perfect. Most of what I've seen are incomplete code snippets and while I've been fiddling with it, I'm clearly missing something. If you have any suggestions I'd love to hear them:)




No, the information on this page is all there is that I know about.

http://www.wowwiki.com/COMBAT_LOG_EVENT_Details|||Ok, I wasn't able to find complete yet simple examples so, I made one. I still don't fully understand the best ways to manipulate the new combat log, but I've learned some of the basics and put together a little event notification mod that may help other people figure out what's going on as well. I still don't get bit manipulation yet, though, so feel free to enlighten me. If you'd like to check out the mod, it's called ThatJustHappened and can be found here:

http://belleboom.googlepages.com/bellemaison

I may end up posting it at ui/curse but it's pretty basic and I'm hoping the makers of SCT or EavesDrop or CombatAnnounce will add custom event watch functionality to their mods instead.|||I've been working on my "spam event to channel" mod TJH, partly because I want it during play and partly because I'm trying to get a better understanding of the combat log. It's still needs a few things and I'd like to get a handle on bit functions, but it's functional if anyone wants to see how I made some of the basic stuff work. I've also moved it to UI for ease of access:

http://wowui.worldofwar.net/?p=mod&m=6420

No comments:

Post a Comment