Getting Event Info

Greetings,

In general, how is additional information to be obtained from events in order to respond appropriately? For example, for the COMBAT_LOG_EVENT_UNFILTERED I can call the CombatLogGetCurrentEventInfo() method and get loads of event specific information. Not so for other events.

For example, when my code gets a BAG_UPDATE event, I’d like to find out more information about that specific update - which bag, which slot in the bag, was it a deletion, insertion, etc.?

Does documentation exist (online or extracted) that will allow the programmer to get specific information from any arbitrary event?

Cheers,

For the majority of eventw, the extra information is passed with the event rather than needing the extra function call as required by COMBAT_LOG_EVENT_UNFILTERED

Event handlers have 3 parameters (self, event, …)
self being the frame that the event ids registered for, event being the event name (for frames with more than one event registered) and … being the payload of “extra parameters” depending on the event

BAG_UPDATE has a payload of bagID (one parameter of type number)

The event handler would:

Frame:SetScript("OnEvent", function(self, event, ...)
	if event == "BAG_UPDATE" then
		local bagId = ...
	elseif event == "COMBAT_LOG_EVENT_UNFILTERED" then
		local timestamp, eventType, hideCaster, sourceGUID, sourceName, sourceFlags, sourceRaidFlags, destGUID = CombatLogGetCurrentEventInfo()
	end
end)
Frame:RegisterEvent("BAG_UPDATE")
Frame:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")

Type
/api search BAG_UPDATE
in-game or search for the event(s) at
wow.gamepedia.com

1 Like

Thanks. I didn’t know about the /api command

https://www.curseforge.com/wow/addons/apiinterface

Makes it more useful and friendly

Downloaded and installed the AddOn, APIInterface. What a great and useful resource. I would strongly recommend that you write a short post enumerating a few resources including this one but also some links (if allowed).

Anyway, I’ll be using this extensively.

Thanks, so much.