Wowpedia
Advertisement
Links

Registers a frame to receive all fired events; it is not advisable to use this for anything except debugging purposes, as the incurred performance penalty is quite large.

frame:RegisterAllEvents();

Example

-- Addon '\Interface\Addons\My Addon'
MySavedVariables_Table = {}
local frame = CreateFrame('Frame')
frame:RegisterAllEvents()
frame:SetScript('OnEvent', function(self, event, ...)
	-- Save only the last instance of the fired event.
	MySavedVariables_Table[event] = {...}
end)

Result

File '\WTF\Account\(...)\SavedVariables\My Addon.lua' will contain the MySavedVariables_Table variable, formatted something like this:

MySavedVariables_Table = {
	["ADDON_LOADED"] = {
		[1] = "Some other addon",
	},
	["ADDON_ACTION_FORBIDDEN"] = {
		[1] = "Some other addon",
		[2] = "CastSpellByName",
	},
}

Patch history

  • Battle for Azeroth Patch 8.0.1 (2018-07-17): Subsequently calling Frame:UnregisterEvent() no longer works. Unregister/register-all weren't intended to be used in conjunction with unregistering/registering-single.
  • WoW Icon update.png Patch 1.11.0 (2006-06-19): Added.
Advertisement