Hi there,
I am playing around a bit with LUA, but for me it looks like I set up something wrong.
I've tried it with the easiest examples of all:
TestOne.txt:
Code:
## Title: TestOne
## APIVersion: 100003
TestOne.lua
Test One lua:
Code:
function TestOne.Initialize(eventCode, addOnName)
if (addOnName ~= "TestOne") then
return
end
d("TestOne Loaded...")
end
EVENT_MANAGER:RegisterForEvent("TestOne", EVENT_ADD_ON_LOADED, TestOne.Initialize);
That already throws an error:
user:/AddOns/TestOne/TestOne.lua:1: attempt to index a nil value
stack traceback:
user:/AddOns/TestOne/TestOne.lua:1: in function '(main chunk)'
|
If I change TestOne.Initialize to TestOneInitialize I don't get the error anymore... but I don't get a "TestOne Loaded" in the chat either. It just does nothing.
What am I doing wrong?