I'm new to writing mods, and in complex programming in general. If wow used KIXTart as it's mod's language i'd be right at home, but i'm bamboozled with LUA's dinosuar c/c++ like syntax and the whole multi-file setup. Anyway, i'm wondering if anyone could give me a few pointers on how the best way to approach a pretty simple mod that does the following would be;
>you click a button or type a slash command which brings up a window
>in the window you can paste a chunk of text
>there is a button or slash command (bind a macro to it) that each time it is pushed, it grabs the next line of text from the text entered into the box and says it in /say or /raid or /bg or whatever is specified by the user
>does this untill the end of the chunk of text is reached, after which if the button/macro is pushed, it starts from the top again.
>i have no intention of doing anything fancy, like localisations etc, as im just writing the mod for myself and a few mates, and more than anything to teach myself a more difficult programming language.
Any tips or sample code would be excellent, like if ace would help for this pretty simple mod, how i get box up on screen user(s) can dump text into, how to loop through each line and set it to a variable or element in an array etc would be awsome.
@Rabbit: If he's anything like me, he wants to write it himself (or herself, I appologize if this is the case).
You're best bet is to look at other people's addons. Some are hard to follow, some are not. Also, WoWWiki and Lua-PIL are really good resources. The former contains almost everything that WoW uses and is user-contributed. The latter is just straight Lua, nothing on WoW's implimentation.
Thanks for the responses. I looked at NRT to get some pointers but couldnt find a way to open a window with an editable reigon off the bat, i assume it only comes up after a boss kill or somthing?
I would like to write it myself but it's always good to look at someone else's work to at least get a feel for how it should look like - at least as far as syntax.
I also found a mod that has a window almost identical to how i want one - player notes or somthing like that, it's where u can add notes to people in your friends list, i might try and find the responsible code.
Is there some sort of LUA IDE getting around? or do you pretty much have to stick with notepad? Having some sort of Visual Studio'ish IDE that at least underlines sections which dont syntatically(that a word) make sense would be awsome.
I use Notepad++ personally for Lua. There's a Visual Studio plugin somewhere for Lua but I seem to remember not being that impressed with it. There's also http://www.wowwiki.com/Lua_editors which as a list of Lua editors.