C H A P T E R  3

image

Using the WoW API to Create a “Hello, World” Mod

Let's get started. You have already seen some Lua examples in Chapter 2, so writing a “Hello, World!” mod will be no problem for you.

But this first example mod will do a bit more than just displaying “Hello, World.” It will provide two slash commands: /hwadd <id> <text> and /hwshow <id>. The former adds text to a table that will be saved, while the latter sends the text that was saved under id to a chat channel. Gold farmers might think that the only possible use of this addon is to spam the trade chat with advertisements, as it allows you to send a lot of text with one macro. ...

Get Beginning Lua with World of Warcraft Addons now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.