Earlier Versions
Name | Size | Uploaded | Game Version | Downloads | |
9 release | 29.75 KB | Dec 20, 2018 | 8.1.0 | 66 | Download |
8 release | 29.72 KB | Dec 14, 2018 | 8.1.0 | 27 | Download |
7 release | 29.86 KB | Dec 1, 2018 | 8.0.1 | 34 | Download |
6 release | 29.88 KB | Nov 30, 2018 | 8.0.1 | 22 | Download |
5 release | 29.60 KB | Nov 28, 2018 | 8.0.1 | 20 | Download |
4 release | 29.31 KB | Nov 26, 2018 | 8.0.1 | 17 | Download |
3 release | 29.00 KB | Nov 18, 2018 | 8.0.1 | 23 | Download |
2 release | 29.02 KB | Nov 18, 2018 | 8.0.1 | 10 | Download |
1 release | 28.82 KB | Nov 13, 2018 | 8.0.1 | 19 | Download |
Description
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.
blizzardRole = lib:GetBlizzardRole(guid)
Arguments:
guid
– string: GUID
Returns:
blizzardRole
– string:"TANK"
,"HEALER"
,"DAMAGER"
,"NONE"
GetRole
Returns the role for the GUID as determined by class and specialization. This differentiates between melee and ranged DPS specializations.
role = lib:GetRole(guid)
Arguments:
guid
– string: GUID
Returns:
role
– string:"tank"
,"healer"
,"melee"
,"ranged"
,"none"
GetSpecialization
Returns the specialization for the GUID.
specialization, name = lib:GetSpecialization(guid)
Arguments:
guid
– string: GUID
Returns:
specialization
– number: specialization IDname
– string: the name of the specialization, e.g.,"blood
","protection"
,"arcane"
, etc.
GetSpecializationName
Returns the name of the specialization by ID.
name = lib:GetSpecializationName(specialization)
Arguments:
specialization
– number: specialization ID
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.
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.
lib:InspectRoster()
RegisterCallback
Registers a function to handle the specified callback.
lib.RegisterCallback(handler, callback, method, arg)
Arguments:
handler
– table/string: your addon object or another table containing a function athandler[method]
, or a string identifying your addoncallback
– string: the name of the callback to be registeredmethod
– string/function/nil: a key into thehandler
table, or a function to be called, ornil
ifhandler
is a table and a function exists athandler[callback]
arg
– a value to be passed as the first argument to the callback function specified bymethod
Notes:
- If
handler
is a table,method
is a string, andhandler[method]
is a function, then that function will be called withhandler
as its first argument, followed by the callback name and the callback-specific arguments. - If
handler
is a table,method
is nil, andhandler[callback]
is a function, then that function will be called withhandler
as its first argument, followed by the callback name and the callback-specific arguments. - If
handler
is a string andmethod
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. Ifhandler
is a table, thenarg
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.
lib.UnregisterCallback(handler, callback)
Arguments:
handler
– table/string: your addon object or a string identifying your addoncallback
– 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 changedunit
– string: unit ID, e.g.,"player"
,"target"
,"raid15"
, etc.oldRole
– string: the previous assigned role, see GetBlizzardRolenewRole
– string: the current assigned role, see GetBlizzardRole
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 changedunit
– string: unit ID, e.g.,"player"
,"target"
,"raid15"
, etc.oldRole
– string: the previous role, see GetRolenewRole
– 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 changedunit
– string: unit ID, e.g.,"player"
,"target"
,"raid15"
, etc.oldSpecialization
– number: the previous specialization IDnewSpecialization
– number: the current specialization ID
License
MooSpec-1.0 is released under the 2-clause BSD license.
Feedback
- Report a bug or suggest a feature.
Add a comment