Code:
local function OnAddOnLoaded(eventCode, addonName)
if addonName == YourModNameAsAString then
EVENT_MANAGER:UnregisterForEvent(YourModNameAsAString, EVENT_ADD_ON_LOADED)
DoInitStuff()
end
end
EVENT_MANAGER:RegisterForEvent(YourModNameAsAString, EVENT_ADD_ON_LOADED, OnAddOnLoaded)
YourModNameAsAString has to match the manifest file or the text file and the folder name.
If that isn't what you need then I have no idea what you mean. Other then yes Lua, interpreter, and infinite loop I get that, but not sure what you mean.