Skip to content
View in the app

A better way to browse. Learn more.

WRobot

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Forwarding lua events in C#

Featured Replies

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.

 

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".

  • Author

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 ?

  • Author

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 ?

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.