Download
(30Kb)
Download
Updated: 12-19-18 08:32 PM
Pictures
File Info
Compatibility:
Tides of Vengeance (8.1.0)
Battle for Azeroth (8.0.1)
Updated:12-19-18 08:32 PM
Created:11-12-18 11:28 PM
Downloads:812
Favorites:2
MD5:

MooSpec-1.0

Version: 9
by: jlam [More]

Overview

MooSpec-1.0 is a library that provides information about player specializations and roles.

MooSpec-1.0 will track the following changes to units within the group:

  • specialization
  • role as determined by class and specialization
  • role as assigned by the Dungeon Finder or as manually assigned in a raid group
MooSpec-1.0 can also inspect player units that are outside of the group as long as they have a valid unit ID.

API Methods

GetBlizzardRole

Returns the assigned role for the GUID in a group formed via the Dungeon Finder, or the role manually assigned in a raid group.

Code:
blizzardRole = lib:GetBlizzardRole(guid)
Arguments:
  • guid - string: GUID
Returns:
  • blizzardRole - string: "TANK", "HEALER", "DAMAGER", "NONE"
GetClass

Returns the class for the GUID.

Code:
class = lib:GetClass(guid)
Arguments:
  • guid - string: GUID
Returns:
  • class - string: a class token, one of:
    • "DEATHKNIGHT"
    • "DEMONHUNTER"
    • "DRUID"
    • "HUNTER"
    • "MAGE"
    • "MONK"
    • "PALADIN"
    • "PRIEST"
    • "ROGUE"
    • "SHAMAN"
    • "WARLOCK"
    • "WARRIOR"
GetRole

Returns the role for the GUID as determined by class and specialization. This differentiates between melee and ranged DPS specializations.

Code:
role = lib:GetRole(guid)
Arguments:
  • guid - string: GUID
Returns:
  • role - string: "tank", "healer", "melee", "ranged", "none"
GetSpecialization

Returns the specialization for the GUID.

Code:
specialization, name = lib:GetSpecialization(guid)
Arguments:
  • guid - string: GUID
Returns:
  • specialization - number: specialization ID
  • name - string: the name of the specialization, e.g., "blood", "protection", "arcane", etc.
GetSpecializationName

Returns the name of the specialization by ID.

Code:
name = lib:GetSpecializationName(specialization)
Arguments:
Returns:
  • name - string: the name of the specialization, e.g., "blood", "protection", "arcane", etc.
InspectUnit

Queue a unit for asynchronous update of its specialization and role.

Code:
lib:InspectUnit(unit)
Arguments:
  • unit - string: unit ID, e.g., "player", "target", "raid15", etc.
InspectRoster

Queue each member of the group for asynchronous update of their specialization and role.

Code:
lib:InspectRoster()
RegisterCallback

Registers a function to handle the specified callback.

Code:
lib.RegisterCallback(handler, callback, method, arg)
Arguments:
  • handler - table/string: your addon object or another table containing a function at handler[method], or a string identifying your addon
  • callback - string: the name of the callback to be registered
  • method - string/function/nil: a key into the handler table, or a function to be called, or nil if handler is a table and a function exists at handler[callback]
  • arg - a value to be passed as the first argument to the callback function specified by method
Notes:
  • If handler is a table, method is a string, and handler[method] is a function, then that function will be called with handler as its first argument, followed by the callback name and the callback-specific arguments.
  • If handler is a table, method is nil, and handler[callback] is a function, then that function will be called with handler as its first argument, followed by the callback name and the callback-specific arguments.
  • If handler is a string and method is a function, then that function will be called with the callback name as its first argument, followed by the callback-specific arguments.
  • If arg is non-nil, then it will be passed to the specified function. If handler is a table, then arg will be passed as the second argument, pushing the callback name to the third position. Otherwise, arg will be passed as the first argument.
UnregisterCallback

Unregisters a specified callback.

Code:
lib.UnregisterCallback(handler, callback)
Arguments:
  • handler - table/string: your addon object or a string identifying your addon
  • callback - string: the name of the callback to be unregistered
Callbacks

MooSpec-1.0 provides the following callbacks to notify interested addons.

MooSpec_UnitBlizzardRoleChanged

Fires when the assigned role in a group formed via the Dungeon Finder or the role manually assigned in a raid group is changed.

Arguments:
  • guid - string: GUID of the unit whose role has changed
  • unit - string: unit ID, e.g., "player", "target", "raid15", etc.
  • oldRole - string: the previous assigned role, see GetBlizzardRole
  • newRole - string: the current assigned role, see GetBlizzardRole
MooSpec_UnitClass

Fires when the class for a unit has been resolved.

Arguments:
  • guid - string: GUID of the unit whose role has changed
  • unit - string: unit ID, e.g., "player", "target", "raid15", etc.
  • class - string: a class token, see GetClass
MooSpec_UnitRoleChanged

Fires when the role of a unit as determined by its class and specialization has changed.

Arguments:
  • guid - string: GUID of the unit whose role has changed
  • unit - string: unit ID, e.g., "player", "target", "raid15", etc.
  • oldRole - string: the previous role, see GetRole
  • newRole - string: the current role, see GetRole
MooSpec_UnitSpecializationChanged

Fires when the specialization of a unit has changed.

Arguments:
  • guid - string: GUID of the unit whose specialization has changed
  • unit - string: unit ID, e.g., "player", "target", "raid15", etc.
  • oldSpecialization - number: the previous specialization ID
  • newSpecialization - number: the current specialization ID
License

MooSpec-1.0 is released under the 2-clause BSD license.

Feedback

MooSpec-1.0
9 (2018-12-17)
Full Changelog Previous releases
  • Bump minor version to 9 for release.
  • Set a default role when calling :GetRole() if role hasn't been set.
Optional Files (0)


There have been no comments posted to this file.
Be the first to add one.



Category Jump: