Getting started with the API¶
Tutorial¶
If you are new here and would like a guided tour for getting started making your first plugin, see the tutorial page, or use this quick navigation:
Programming in Lua¶
Info
These documents are written expecting some familiarity with the Lua programming language.
Some useful resources for Lua programming in general:
The API uses Lua version 5.4.8, so be sure when reading any external guides that any advice given is compatible with this version.
Plugin submission¶
Before you start making plugins you should read through the guidelines for what plugins are allowed to do. You can also ask in the RuneScape Plugin Portal discord for clarity on your specific plugin idea.
Once you have made (and tested) your plugin, you can follow the submission process steps to upload your plugin to Mod.io. This will explain everything that you need for submission, as well as how you will be updated as your submission is moderated.
How to read these docs¶
Lua is dynamically typed, however, to provide a better idea of how to use this API, types for properties and functions are included in these documents.
Example
function Cat:Meow(volume: Float) represents a function that's called on an object of type Cat and takes a floating point value (eg. 0.8) as a parameter, used as follows:
function Cat.find(name: String?) -> Cat? represents a function that doesn't need to be called on an object, takes an optional string as a parameter, and can return a Cat object or nil, used as follows:
Additionally, { String -> Int } represents a regular dictionary table, mapping strings to integers, such as { A = 3, B = 100 }, while [String] instead represents an array of strings such as { "Hello", "World" }.
Info
In some cases you may also see numeric types with bit sizes attached to their name (eg. Uint8). These just serve as an indicator for the minimum and maximum range of values accepted or returned by a function, and are represented in Lua as regular numeric values.
Info
You may also see types like A | B indicating the type is either A or B.
Certain types also inherit methods and properties from other types, which can be seen in the overview section for documents under the UI section, where:
ui.Component -> ui.Button
Implies that ui.Button also contains all of the functionality from the base ui.Component type and can be used as an argument to functions expecting that base type. In some cases you may also see Type<T> types, which serves as a generic placeholder for any number of types based on Type, with the documentation clarifying what types it may represent