April 6th, 2006


[WoW] Addonway

I've been getting interested in writing addons for World of Warcraft lately.

Yesterday, to get my feet wet and test my understanding, I wrote a tiny little addon (~40 lines) that translated everything the user typed into Pig Latin.

I had one serious problem. Although '/piglatin on' worked fine, '/piglatin off' didn't work, because it was first translating that into '/iglatinpay offway'.

But that was okay; all I really wanted to do was to say 'oolCay, Iway otewray anway addonway!"

But now, I'm thinking, "You know, it wouldn't be too hard to modify that to apply a 'bork' filter..."


WoW addons are written in the scripting language Lua, which I hadn't previously encountered. Lua is pretty nifty. Major features:
- it has first-class functions, including anonymous functions and closures.
- It uses a general "table" structure to implement a variety of data structuring, including arrays, lists, records, associative arrays, global variable access, and introspection.

This makes it very flexible, but very simple.

The WoW-specific side of things is more icky, but I'm wrapping my head around it. A bit of distaste for "FauxScrollView" is still in order, though.


This exercise points out again how little recreational programming I do these days. Most programming tasks whose results I want to use require too much setup for me to whip them out. This little Pig Latin project wasn't an example I wanted to use, and it still required a couple days of reading (albeit half an hour of writing, and the reading is reusable). Writing something with a UI, even something simple, might require several evenings of understanding (and copying) code.


Addons I've thought of writing:

- an automated way of picking the better shaman weapon buff between Rockbiter and Windfury.
- an addon that would identify the most profitable items you could craft with a given skill.