Skip to content

Total RP 3's API documentation

Ben edited this page Aug 19, 2022 · 6 revisions

API Documentation

The TRP3 API contains a few useful modules you can take advantage of to integrate your addon with TotalRP3.

It's recommended that you check that the TotalRP3 addon is loaded before making use of the API in your code.

-- Checks if the TotalRP3 addon is loaded
local TRP_Loaded = IsAddOnLoaded("TotalRP3")

-- Assigns a local accessor for easier access to the API
local TRP3 = TRP3_API

-- Make use of an API method
local profileCurrently = TRP3.profile.getData(path)

Breakdown of the above API usage

TRP3.profile.getData(path)

  • TRP3 - The TRP3 API global accessor assigned to the local variable TRP3, usable from any addon running alongside TotalRP3
  • .profile - This is the profile module containing profile-related methods[^1]
  • .getData(path) - This is the method used to get specific data from the currently active profile, for more information on this method, see getData.

API Modules

Examples

Clone this wiki locally