LotRO API Reference
From LoTROInterface Wiki
LotRO's Lua API consists of four packages, containing various classes, that add onto a basic implementation of Lua (5.1). The implementation of Lua consists of only the math and string libraries, almost entirely for security reasons (i.e. preventing access to a user's computer, running external libraries, etc.). Each of the API's packages has their own specific role, covering everything from managing the plugin itself, to delivering gameplay data and events.
The implementation of Lua in LotRO is not a very direct one. Unlike some other games that have the entire client-side UI developed in Lua, LotRO's is not. The result of this is, instead of the Lua API communicating directly with the game and server, it communicates only with the client - depending on the client to give it the information it requests. Since the API methods themselves must be created, along with the client-side method for getting the data and delivering it to the API, this gives Turbine an exceptional amount of control over what plugin authors can do.
Considering the LotRO API is still in beta, it's hardly surprising that there are numerous limitations involving what it can do. Chiefly among those is the inability to get information about monsters, NPCs and other players. Even considering that, there is quite a bit of local information unavailable to the API, at this time, as well. Examples of these include the vast majority of information relating to panels (including the character journal), map/location information, skills, and some of the more specific debuff/item information such as cooldowns, or descriptions.
The API Received its first non-beta update with the November update, released on November 29, 2010. Besides bug fixes, it introduced access to Class stances, Fervor, Focus, Attunement, Race and Class information. In addition to data, the update also introduced a Tree View UI element and the ability for Windows to respect stacking among panels.
Below is a brief description, as well as a link to the API Reference for each of the four packages in the LotRO Lua API.
API Reference: Turbine_(Package)
This package contains a collection of classes that handle main plugin functions such as loading, information about the plugin and loading and saving settings. It also contains time/locale information as well as the Object class, which is the foundation for all API-specific elements.
API Reference: Turbine.Gameplay
As the name might suggest, the classes and functions within return and manage game information such as player vitals, player inventory (bags), and Items. Although due to the above limitations, the classes within only work on the player, the structure already exists for a future addition that allows the same to be done for other players, monsters or NPCs.
API Reference: Turbine.UI
Another aptly named package. This package contains classes that consist of basic UI elements. Everything from containers such as Windows or Controls to labels, text boxes and scrollbars. These classes tend to have all the necessary functions and events, but rarely anything more. This package is designed for those who want to create their own designs.
API Reference: Turbine.UI.Lotro
This class is essentially what happens when you take the Turbine.UI package, and add LotRO themed graphics to the classes. Buttons, Windows, Scrollbars and CheckBoxes all look exactly like the real LotRO UI elements, and will even lend themselves to whatever UI skin the user has selected. On top of these elements, this is also the package where you'll find things like Quickslots and Fonts.