WowAddons

World of Warcraft Forever API · UnitRole.md, for your AI

UnitRole (global functions)

6 functions, 2 events, as Blizzard documents them for Forever 1.60.1 (70959).

Making an addon with an AI? Tell it: Read https://wowaddons.gg/agents.md, then make me a World of Warcraft Forever addon that …, try it with me in the game, and publish it. It checks every call against this API before you try it in the game, then publishes it here. How it works.

Functions

AreClassRolesSoftSuggestions

result = AreClassRolesSoftSuggestions()

If true, UnitGetAvailableRoles results should be treated as suggested role, not hard limits on what role the current player can display as.

Returns

resultbool

CanShowSetRoleButton

result = CanShowSetRoleButton()

Returns

resultbool

InitiateRolePoll

result = InitiateRolePoll()

Returns

resultbool

UnitGetAvailableRoles

tank, healer, dps = UnitGetAvailableRoles(unit)

May return nothing.

Its returns can be secret values (in some instances and fights): guard them before any arithmetic.

Arguments

unitUnitToken

Returns

tankbool
healerbool
dpsbool

UnitSetRole

result = UnitSetRole(unit, [roleStr])

Arguments

unitUnitToken
roleStrcstring may be nil

Returns

resultbool

UnitSetRoleEnum

result = UnitSetRoleEnum(unit, [role])

Arguments

unitUnitToken
roleLFGRole may be nil

Returns

resultbool

Events

ROLE_CHANGED_INFORM

changedNamecstring
fromNamecstring
oldRolecstring
newRolecstring

ROLE_POLL_BEGIN

fromNamecstring

It takes WowAddons

Free, for Windows, macOS and Linux: it puts the addon in your game in one click and keeps it up to date. Open it once, then press Install again.

WowAddons runs on your computer: open wowaddons.gg there.

Download for Windows