Introduction

This tutorial was made by ziandra, originally found here.

Tutorial 3

Base files :

Finished files :

By now you have learned how to create a framework, how to add commands, how to write things to the combat frame (where they can be logged by the way) and how to get your module initialized.
Next we will handle in game events. There are a whole heap and bunch of events in the game, not all of which do anything. I picked one that some might find interesting..

First, we modify gorp.xml to instruct it to call Gorp_OnEvent when events occur.

[snip] replaced by the external file Interface\FrameXML\gorp.xml.

Then we add the event handler to gorp.lua and request we be notified when the ON_SIT event occurs by adding the register event call in our onload handler. gorp.lua now becomes

[snip] replaced by the external file Interface\FrameXML\gorp.lua.

Restarting the game or reloading the ui now has the message

No sitting down on the job!

sent to the combat window every time we sit, either by typing /sit, pressing the x key or by going idle for long enough to sit.

I hope this gives you enough of a basic to get started on your own mods.

Contacting me

To contact me, mail me at k!!!@fukt!!!.bth.se (remove the exclamation marks).