Jump to content

Register Combat_Log with args


reapler

Recommended Posts

Hello, is it possible to register "COMBAT_LOG_EVENT_UNFILTERED" with its parameter like guid, spellname etc?

i already tried it with EventsLuaWithArgs.OnEventsLuaWithArgs but it doesn't contain the event nor its parameters and EventsLua.AttachEventLua isn't what im looking for.

Edited by reapler
typo
Link to comment
Share on other sites

It's COMBAT_LOG_EVENT_UNFILTERED. The args are varargs, because they vary depending on the event happening.

The first 6 or so are always the same (documentation on WoWWiki is pretty clear). It should work like any other event, I suspected capitalization is your problem.

Link to comment
Share on other sites

No, capitalization is not the problem (i'm sorry, i just forgot to capitalize it in my question) it simply don't get the event :

        EventsLuaWithArgs.OnEventsLuaWithArgs += (id, args) =>
        {
            Logging.WriteDebug("\nid contains: " + id);
            for (int i = 0; i < 20; i++)
            {
                Logging.WriteDebug("\nArg" + i + " contains: " + args[i]);
            }
        };

and with "EventsLua.AttachEventLua(LuaEventsId.COMBAT_LOG_EVENT_UNFILTERED, mymethod());" i can't return the parameters of it(so far as i know).

Link to comment
Share on other sites

                // Listen to events
                EventsLuaWithArgs.OnEventsLuaWithArgs += (LuaEventsId id, List<string> args) =>
                {
                    if (id == LuaEventsId.COMBAT_LOG_EVENT_UNFILTERED)
                    {
                        // Set
                        int timeStamp = int.Parse(args[0]);
                        string eventName = args[1];
                        bool hideCaster = bool.Parse(args[2]);
                        // and so on....
                    }
                }

Hope that helps.

Greez iMod

Link to comment
Share on other sites

Thank you all for your help, but it just doesn't get the event that i wanted. On other events it is working: parameter & id is printed.

I think i will report it to the bugtracker maybe it's just a bug in wrobot itself( tested it with 3.3.5a/4.3.4 clients).

Link to comment
Share on other sites

7 hours ago, Droidz said:

Hello, I confirm than "COMBAT_LOG_EVENT_UNFILTERED" seem skip in "OnEventsLuaWithArgs ". I'll fix it, I comeback here when is done, to wait you can try to use lua script

Would it be possible to add this function to Vanilla as well?

Link to comment
Share on other sites

It was added in patch 2.4.

Events in Vanilla are as follows:

     SpellTimer_EnemyMain:RegisterEvent("CHAT_MSG_SPELL_HOSTILEPLAYER_DAMAGE")
	 SpellTimer_EnemyMain:RegisterEvent("CHAT_MSG_SPELL_HOSTILEPLAYER_BUFF")	 
	 SpellTimer_EnemyMain:RegisterEvent("CHAT_MSG_SPELL_PERIODIC_HOSTILEPLAYER_BUFFS")	
	 SpellTimer_EnemyMain:RegisterEvent("CHAT_MSG_SPELL_PERIODIC_HOSTILEPLAYER_DAMAGE")	 	 
	 SpellTimer_EnemyMain:RegisterEvent("CHAT_MSG_SPELL_PERIODIC_CREATURE_DAMAGE")
	 SpellTimer_EnemyMain:RegisterEvent("CHAT_MSG_SPELL_PERIODIC_CREATURE_BUFFS")
	 SpellTimer_EnemyMain:RegisterEvent("CHAT_MSG_SPELL_CREATURE_VS_CREATURE_DAMAGE")
	 SpellTimer_EnemyMain:RegisterEvent("CHAT_MSG_SPELL_PERIODIC_CREATURE_DAMAGE")	
	 SpellTimer_EnemyMain:RegisterEvent("CHAT_MSG_COMBAT_HOSTILE_DEATH")
	 SpellTimer_EnemyMain:RegisterEvent("CHAT_MSG_SPELL_CREATURE_VS_CREATURE_BUFF")	 
	 SpellTimer_EnemyMain:RegisterEvent("CHAT_MSG_SPELL_PERIODIC_HOSTILEPLAYER_DAMAGE")	 				
	 SpellTimer_EnemyMain:RegisterEvent("CHAT_MSG_SPELL_BREAK_AURA")
	 SpellTimer_EnemyMain:RegisterEvent("CHAT_MSG_SPELL_AURA_GONE_OTHER")
	 SpellTimer_EnemyMain:RegisterEvent("CHAT_MSG_SPELL_PERIODIC_FRIENDLYPLAYER_DAMAGE")
     SpellTimer_EnemyMain:RegisterEvent("CHAT_MSG_SPELL_PERIODIC_FRIENDLYPLAYER_BUFFS")
     SpellTimer_EnemyMain:RegisterEvent("CHAT_MSG_SPELL_FRIENDLYPLAYER_DAMAGE")
     SpellTimer_EnemyMain:RegisterEvent("CHAT_MSG_SPELL_FRIENDLYPLAYER_BUFF")
     SpellTimer_EnemyMain:RegisterEvent("CHAT_MSG_SPELL_PARTY_DAMAGE")
     SpellTimer_EnemyMain:RegisterEvent("CHAT_MSG_SPELL_PERIODIC_PARTY_DAMAGE")
     SpellTimer_EnemyMain:UnregisterEvent("CHAT_MSG_SPELL_HOSTILEPLAYER_DAMAGE")
	 SpellTimer_EnemyMain:UnregisterEvent("CHAT_MSG_SPELL_HOSTILEPLAYER_BUFF")	 
	 SpellTimer_EnemyMain:UnregisterEvent("CHAT_MSG_SPELL_PERIODIC_HOSTILEPLAYER_BUFFS")	
	 SpellTimer_EnemyMain:UnregisterEvent("CHAT_MSG_SPELL_PERIODIC_HOSTILEPLAYER_DAMAGE")	 	 
	 SpellTimer_EnemyMain:UnregisterEvent("CHAT_MSG_SPELL_PERIODIC_CREATURE_DAMAGE")
	 SpellTimer_EnemyMain:UnregisterEvent("CHAT_MSG_SPELL_PERIODIC_CREATURE_BUFFS")
	 SpellTimer_EnemyMain:UnregisterEvent("CHAT_MSG_SPELL_CREATURE_VS_CREATURE_DAMAGE")
	 SpellTimer_EnemyMain:UnregisterEvent("CHAT_MSG_SPELL_PERIODIC_CREATURE_DAMAGE")	 
	 SpellTimer_EnemyMain:UnregisterEvent("CHAT_MSG_COMBAT_HOSTILE_DEATH")
	 SpellTimer_EnemyMain:UnregisterEvent("PLAYER_REGEN_ENABLED")
	 SpellTimer_EnemyMain:UnregisterEvent("CHAT_MSG_SPELL_CREATURE_VS_CREATURE_BUFF")
	 SpellTimer_EnemyMain:UnregisterEvent("CHAT_MSG_SPELL_FRIENDLYPLAYER_DAMAGE")
	 SpellTimer_EnemyMain:UnregisterEvent("CHAT_MSG_SPELL_FRIENDLYPLAYER_BUFF")
	 SpellTimer_EnemyMain:UnregisterEvent("CHAT_MSG_SPELL_PERIODIC_FRIENDLYPLAYER_BUFFS")
	 SpellTimer_EnemyMain:UnregisterEvent("CHAT_MSG_SPELL_PERIODIC_HOSTILEPLAYER_DAMAGE")
	 SpellTimer_EnemyMain:UnregisterEvent("CHAT_MSG_SPELL_PERIODIC_FRIENDLYPLAYER_DAMAGE")	 
	 SpellTimer_EnemyMain:UnregisterEvent("CHAT_MSG_SPELL_PARTY_DAMAGE")
	 SpellTimer_EnemyMain:UnregisterEvent("CHAT_MSG_SPELL_PERIODIC_PARTY_DAMAGE")				
	 SpellTimer_EnemyMain:UnregisterEvent("CHAT_MSG_SPELL_BREAK_AURA")
	 SpellTimer_EnemyMain:UnregisterEvent("CHAT_MSG_SPELL_AURA_GONE_OTHER")

 

Link to comment
Share on other sites

  • 1 month later...

Hello again, i made a workaround for that if someone is interested(a bit ugly):

    public void Initialize()
    {
        EventsLuaWithArgs.OnEventsLuaWithArgs += Events;
        Lua.LuaDoString
            (
                "wframe = CreateFrame('Frame') " +
                "local Frame = true " +
                "arg = {'1', '2', '3', '4','5', '6', '7', '8', '9', '10', '11', '12','13', '14'} " +
                "wframe:RegisterEvent('COMBAT_LOG_EVENT_UNFILTERED') " +
                "wframe:SetScript('OnEvent', function(self, event, ...) " +
                
                    "for i=1, 14 " +
                    "do " +
                        "if select(i, ...) == nil or select(i, ...) == '' then " +
                            "arg[i] = '' " +
                        "else " +
                            "arg[i] = select(i, ...) " +
                        "end " +
                    "end " +
                    
                "RunMacroText('/click '..arg[1]..'§'..arg[2]..'§'..arg[3]..'§'..arg[4]..'§'..arg[5]..'§'..arg[6]..'§'..arg[7]..'§'..arg[8]..'§'..arg[9]..'§'..arg[10]..'§'..arg[11]..'§'..arg[12]..'§'..arg[13]..'§'..arg[14]..'') " +
                "end) "
            );
	//...
    }




    public void Events(LuaEventsId id, List<string> args)
    {
        //Combatlog
        if (id == LuaEventsId.EXECUTE_CHAT_LINE)
        {
            string[] arg = args[0].Replace("/click", "").Split('§');
            Logging.Write(arg[3]);
            Logging.Write(arg[9]);
        }
    }

 

Link to comment
Share on other sites

  • 1 month later...
  • 1 month later...
4 hours ago, Droidz said:

If you can wait next update, I added OnEventsLuaWithArgs in vanilla and TBC, and I fixed problem with missing events.

:wub: you're the best!

Link to comment
Share on other sites

  • 3 weeks later...

Sorry for addig myself in but is that thing working all the time or once per minute or somethig? 

After something like that:

 

EventsLuaWithArgs.OnEventsLuaWithArgs += (id, args) =>
        {
            if (id == wManager.Wow.Enums.LuaEventsId.UNIT_SPELLCAST_START)
            {
            for (int i = 0; i < 20; i++)
            {
                print("Arg" + i + " contains: " + args[i]);
            }
            }
        };

The result is printed once per minute?. Just wonna check when last immolate was casted to prevent duble casting but the result is not reported all the time but with huuuuge delay. ( 5.4.8 tauri ) 

 

Link to comment
Share on other sites

2 hours ago, forerun said:

Sorry for addig myself in but is that thing working all the time or once per minute or somethig? 

After something like that:

 


EventsLuaWithArgs.OnEventsLuaWithArgs += (id, args) =>
        {
            if (id == wManager.Wow.Enums.LuaEventsId.UNIT_SPELLCAST_START)
            {
            for (int i = 0; i < 20; i++)
            {
                print("Arg" + i + " contains: " + args[i]);
            }
            }
        };

The result is printed once per minute?. Just wonna check when last immolate was casted to prevent duble casting but the result is not reported all the time but with huuuuge delay. ( 5.4.8 tauri ) 

 

Try code like 

EventsLuaWithArgs.OnEventsLuaWithArgs += (id, args) =>
{
    if (id == wManager.Wow.Enums.LuaEventsId.UNIT_SPELLCAST_START)
    {
        for (int i = 0; i < args.Count; i++)
        {
            Logging.Write("Arg" + (i + 1) + " contains: " + args[i]);
        }
    }
};

(your code probably crash a lot of time)

 

Link to comment
Share on other sites

It's not about that. I can deal with the wrong values etc. but there is a problem with something else. You can spam immolate again and again but the raport is showing up 1 time per 30 immolate casted .... ( inside loop without any thread.sleep ) 

Link to comment
Share on other sites

17 minutes ago, forerun said:

It's not about that. I can deal with the wrong values etc. but there is a problem with something else. You can spam immolate again and again but the raport is showing up 1 time per 30 immolate casted .... ( inside loop without any thread.sleep ) 

2017-07-26_20-32-37.mp4 He works (Wotlk),

If you want you can increment reactivity of eventlua, for that put lower valua at "wManager.wManagerSetting.CurrentSetting.EventsLuaWithArgsWaitTime"

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...