Posted by dandaman on Wed, 19 Sep 2012 17:19:19
Ok, so, i did the first exaple in the book -.- already having problems. At first the .toc file wasnt working, but i went into DOS and renamed it through dos then i finally got it to show up in the add on page of wow. Once i got past that step, the LUA sctipt still isnt working in game -.- This is the code:
SLASH_HEYTHERE1 = "/hey" SLASH_HEYTHERE2 = "/heythere" SlashCmdList("HEYTHERE") = function(self, txt) if UnitExists("target") then SendChatMessage("Hello " .. UnitName("target"), "SAY") else SendChatMessage("Hey there everybody!") end end
So yea, please, help, just wanting to try to make my first add on! :)
Posted by nimiety on Thu, 20 Sep 2012 15:17:06
When you went into DOS and had to rename the toc file. What was the name it had originally? .toc.txt? If so, look into doing the same thing for the .lua file. Just a shot in the dark with this because it seems it should be working for you.
Meant to include, if that does end up being the issue. When you go to save the files in whatever text editor you're using, make sure to change the file type drop down to "any file ." Changing it to that, it'll save the file exactly how you have it typed out. rather than appending it's own extension to it.
Posted by jnwhiteh on Thu, 20 Sep 2012 17:26:06
You can download all of the example addons under the "Chapters" tab at the top of the page, just click on the chapter you're working on. You can then use it to compare to what you have.
Posted by jnwhiteh on Thu, 20 Sep 2012 17:27:00
That being said, the issue is your parenthesis on SlashCmdList. It should be square brackets, i.e. SlashCmdList["HEYTHERE"].
Posted by dandaman on Thu, 20 Sep 2012 18:27:20
Well, either it was me doing the drop down box to "All Files" or i did sqaure brackets instead, i did both before i tried it on wow, so i dont know which, but it works, thnx guys! :)