-- options ExampleAddonHelloWorld_Options_Default = { enabled = true; }; ExampleAddonHelloWorld_Options = {}; -- variables -- loads settings function ExampleAddonHelloWorld_OnEvent() if ( event == "VARIABLES_LOADED" ) then for k, v in ExampleAddonHelloWorld_Options_Default do if ( ExampleAddonHelloWorld_Options[k] == nil ) then ExampleAddonHelloWorld_Options[k] = v; end end ExampleAddonHelloWorld_Error("ERROR: Hello, world not modified. Fix me! I don't want to error all the time!"); end end function ExampleAddonHelloWorld_Print(msg) if ( DEFAULT_CHAT_FRAME ) then DEFAULT_CHAT_FRAME:AddMessage(msg, 0.8, 0.8, 0.2); end end function ExampleAddonHelloWorld_Error(msg) if ( DEFAULT_CHAT_FRAME ) then DEFAULT_CHAT_FRAME:AddMessage(msg, 0.8, 0.1, 0.1); end end -- hooks functions, register variables function ExampleAddonHelloWorld_OnLoad() local f = ExampleAddonHelloWorldFrame; f:RegisterEvent("VARIABLES_LOADED"); ExampleAddonHelloWorld_Print("Hello, world!"); end