Skip to content

PluginPrototype

funkydude edited this page Sep 4, 2025 · 16 revisions

Plugin Prototype

Functions
IsEnabled () Module enabled check.
UnitName (unit[, trimServer]) Get the full name of a unit.
UnitGUID (unit) Get the Globally Unique Identifier of a unit.
IterateGroup ([noInstanceFilter]) Iterate over your group.
GetRaidList () Get raid group unit tokens.
GetPartyList () Get party unit tokens.
PlaySoundFile (sound[, channel]) Play a sound file.
SimpleTimer (func, delay) Trigger a function after a specific delay
UpdateGUI () Force the options panel to update.
GetColoredNameTable () Get a table that colors player names based on class.
Sync (msg[, extra[, noResend]]) Send an addon sync to other players.

Functions

IsEnabled ()

Module enabled check. A module is either enabled or disabled.

Returns:

  • true or nil

UnitName (unit[, trimServer])

Get the full name of a unit.

Parameters:

  • unit: [string] unit token or name
  • trimServer: [bool] append * instead of the server name (optional)

Returns:

  • unit name with the server appended if appropriate

UnitGUID (unit)

Get the Globally Unique Identifier of a unit.

Parameters:

  • unit: [string] unit token or name

Returns:

  • guid guid of the unit

IterateGroup ([noInstanceFilter])

Iterate over your group. Automatically uses "party" or "raid" tokens depending on your group type.

Parameters:

  • noInstanceFilter: [bool] If true then all group units are returned even if they are not in your instance (optional)

Returns:

  • iterator

GetRaidList ()

Get raid group unit tokens.

Returns:

  • indexed table of raid unit tokens

GetPartyList ()

Get party unit tokens.

Returns:

  • indexed table of party unit tokens

PlaySoundFile (sound[, channel])

Play a sound file.

Parameters:

  • sound: Either a FileID (number), or the path to a sound file (string)
  • channel: [string] the channel the sound should play on, defaults to "Master" (optional)

SimpleTimer (func, delay)

Trigger a function after a specific delay

Parameters:

  • func: callback function to trigger after the delay
  • delay: [number] how long to wait until triggering the function

UpdateGUI ()

Force the options panel to update.


GetColoredNameTable ()

Get a table that colors player names based on class.

Returns:

  • list of names colored by class with server names trimmed

Sync (msg[, extra[, noResend]])

Send an addon sync to other players.

Parameters:

  • msg: the sync message/prefix
  • extra: other optional value you want to send (optional)
  • noResend: [bool] if true, no re-send will be attempted if the message fails to send (optional)

Usage:

self:Sync("pluginName", data)