Saturday 18 February 2006

Addon progress

I'm getting more used to lua, though I still find it a bit odd. It seems to be reasonably orthogonal, which is nice. This means you have ways to indicate default arguments that don't involve hacks to the language. For example, if I want to indicate to a function that its should default to inspecting the currently selected player, npc or mob I can tell it to default to "target" by writing:


function myFunc( unit )

 unit = unit or "target"
 -- more code goes here...

end

I've managed to get most of the information I want regarding beasts, and very interesting the trawl has been too. The only thing I don't seem to be able to get is the beast's dietary requirements. Now that must be available since the beast lore UI, the stable UI and the pet UI all display it; however it doesn't seem to be referenced anywhere. I've put a question in a forum, maybe I'll get a response from that.

No comments:

Post a Comment