Your code has holes all over it. :P
Also d() doesn't work at startup because (I think) the chat isn't available at that point (d() prints at the chat window).
Are you sure you're putting the add-ons in the correct folder? I don't mean to be rude I'm just checking.
I'd suggest you start with something even smaller, like a slash command that prints a message and then go from there in small steps. When you get the hang of it you'll naturally increase the size of each step.
This, for instance:
Code:
local function OnAddOnLoaded()
SLASH_COMMANDS["/myaddon"] = function()
d("Hey oh!")
end
end
EVENT_MANAGER:RegisterForEvent("MyAddOn", EVENT_ADD_ON_LOADED, OnAddOnLoaded)
Put it in a file called MyAddOn.lua with another file called MyAddOn.txt with this content:
Code:
# APIVersion: 100013
# Title: MyAddOn
MyAddOn.lua
Both files go in a folder called MyAddOn, and that folder you put in MyDocuments\Elder Scrolls Online\live\AddOns\.
If you're in European server change "live" to "liveeu".
Log in the game and see what happens when you type /myaddon.