Jump to content
This site uses cookies! Learn More

This site uses cookies!

By continuing to use this site, you agree to allow us to store cookies on your computer. :)

Recommended Posts

Hi there!

Does anybody know Is there way to make fight class listen to Lua events? Especially COMBAT_LOG_EVENT_UNFILTERED.

Yeah I know there is EventsLuaWithArgs.OnEventsLuaStringWithArgs but it pretty often skips COMBAT_LOG_EVENT_UNFILTERED and even when it fires it doesn't return any args cuz I have to use CombatLogGetCurrentEventInfo() function to get a payload.

How can I subscribe COMBAT_LOG_EVENT_UNFILTERED with args using c#?

Thank you.

 

Share this post


Link to post
Share on other sites

Pro tip: There are no events being skipped.
If you look at my framework it works perfectly.

If you're running patch 6.x or higher, you need your own combatlog parser. Create a lua frame that subscribes to the event, get the payload, store it in a table and periodically empty the table and read the contents "line by line".

Share this post


Link to post
Share on other sites

Can I ask one more dumb question please.

Ok I did lua string that initialize lua frame and I'm able to store the payload in table each time event fired.

luaString = @"
			local function OnEvent(self, event)
				local args = { }
				eventInfo = {CombatLogGetCurrentEventInfo()}								
				for key, value in pairs(eventInfo) do
					table.insert(args, tostring(value))							
				end
			args = (table.concat(args, ','))
			print (args) --debug
			end

			local f = CreateFrame('Frame')
			f: SetAttribute(name, 'CLEU')
			f: RegisterEvent('COMBAT_LOG_EVENT_UNFILTERED')
			f: SetScript('OnEvent', OnEvent)";

Also I've got a C# function that which takes CLEU args as parameter. Is there way to call this function inside luaString? In other words I need to send args to a function every time event fired.

The only thing comes in mind is to create chat frame inside lua string, sent CLEU args to this frame and read this frame using EventsLuaWithArgs.OnEventsLuaStringWithArgs. But It looks awful 🙂

Share this post


Link to post
Share on other sites

Brilliant advice man! I'm very appreciating your help.

var luaString = @"
				function OnEvent(self, event)
					local args = { }
					eventInfo = {CombatLogGetCurrentEventInfo()}								
					for key, value in pairs(eventInfo) do
						table.insert(args, tostring(value))										
					end
					_G.args = (table.concat(args, ','))
				end

				print ('frame works')
				f = CreateFrame('Frame')
				f: SetAttribute(name, 'CLEU')
				f: RegisterEvent('COMBAT_LOG_EVENT_UNFILTERED')
				f: SetScript('OnEvent', OnEvent)";

Now I'm able to access _G.args from OnEventsLuaStringWithArgs 🤓. Thanks 👍

Share this post


Link to post
Share on other sites
argsForCombatLogEventPuller = { }

There you go, that would've been more than enough. You don't have to assign it to the global pseudo table. 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...