so somewhere in your addon's lua file, like the first line you should have something like the following (outside of all functions)
lua Code:
local AddonName, AddonTable = ...
this will give you the name that your addon is going to load as and a table that is global to all files loaded in your addon
then you just do something like the following.
lua Code:
Frame:RegisterEvent("ADDON_LOADED")
Frame:SetScript("OnEvent",function(self, event, ...) local arg = ... -- used since arg will be indexable if a table and for more events
if event == "ADDON_LOADED" and arg == AddonName then
--loading code here
end
-- other event code goes here
end)