Player
This type represents the player. It inherits all API functionality from Object, WorldObject, and Unit.
Members
The following are members of Player. All members are read-only. For example:
print("Last message: " .. some_bot.last_message)
| Name | Description | Return Type | Tested? | 
|---|---|---|---|
| is_bot | whether or not the player is a bot | bool | Yes | 
| last_message | the last whisper or party/raid message (only player messages) | string | Yes | 
| class | the player's class id- classes | number | No | 
| inventory | all the items in the player's backpack(s) | array<Item> | No | 
| trinket_1 | the player's first trinket | Item | Yes | 
| trinket_2 | the player's second trinket | Item | Yes | 
| destination | the player's destination (if given a chase command) | Position | No | 
| has_reached_destination | whether or not the player has reached its chase destination | bool | No | 
| spec | The player's deepest tree specialization- see specs | number | No | 
| party | the player's party number (i.e. the number in the raid panel) | number | No | 
| movement_policy | the player's [movement policy] (api/types/movement_policy.md) if any | MovementPolicy | No | 
Functions
The following are callable on a Player. Most of these functions perform an action. It is recommended to only choose one action to perform per tick. Responsible use is left to the developer. Example usage:
some_bot:whisper(wow.master, "I'm alive!")
| Function | Description | Parameters | Return Type | Tested? | 
|---|---|---|---|---|
| stand | have the bot stand up | none | none | No | 
| sit | have the bot sit down | none | none | No | 
| dance | have the bot dance | none | none | No | 
| kneel | have the bot kneel | none | none | No | 
| interrupt | stop casting/channeling | none | none | Yes | 
| move | move to a position - sets a move movement policy | (x, y)orUnit | none | No | 
| chase | chase a unit- - sets a chase movement policy | Unittarget,numberdistance,numberangle | none | No | 
| follow | follow a unit - sets a follow movement policy | Unittarget,numberdistance,numberangle | none | Yes | 
| teleport_to | teleport to a unit | Unittarget | none | Yes | 
| stop | stops the player from moving | none | none | No | 
| reset_movement | stops the player from moving and clears all movement tasks (i.e. follow, chase) | none | none | No | 
| add_item | execute the additem command as the given bot (will not work in combat) | stringtext | boolsuccess | No | 
| revive | execute the revive chat command as the given bot (will not work in combat) | none | boolsuccess | No | 
| whisper | whisper a player | Playertarget,stringtext | none | Yes | 
| tell_party | send a message to party chat | stringtext | none | Yes | 
| tell_raid | send a message to raid chat | stringtext | none | Yes | 
| say | send a message to local area | stringtext | none | Yes | 
| yell | yell a message to local area | stringtext | none | Yes | 
| set_target | set the bot's target | Unittarget | none | Yes | 
| clear_target | clear the bot's target | none | none | Yes | 
| clear_stealth | clears stealth state | none | none | Yes | 
| face | faces the given target or orientation | Unittarget ornumberorientation | none | Yes | 
| has_power_to_cast | checks to see if bot has enough power (mana, energy, etc.) to cast a given spell | numberspell_id | bool | Yes | 
| can_cast | returns of if the bot can cast a spell (checks cooldown, silenced, etc.) | numberspell_id | bool | Yes | 
| get_cast_time | Get the cast time of the provided spell id | numberspell_id | number(ms) | No | 
| get_item_in_equip_slot | gets the item in the passed equip_slot | numberslot | Item(nullable) | No | 
| get_item | locates the first item matching the name (case sensitive) or id in inventory | stringname ornumber | Item(nullable) | No | 
| cast | attempts to cast a spell on target or self- result is spell_result | Unittarget (optional),numberspell_id | number | Yes | 
| simple_cast | same as cast, but only returns whether or not cast succeeded | Unittarget (optional),numberspell_id | bool | Yes | 
| force_cast | same as cast, will interrupt current cast before casting | Unittarget (optional),numberspell_id | number | Yes | 
| simple_force_cast | same as force cast, but only returns whether or not cast succeeded | Unittarget (optional),numberspell_id | bool | Yes | 
| in_same_party_as | will return whether or not the player is in the same party as the given player | Playertarget | bool | Yes | 
| get_nearby_group_members | get an array of all group members within given radius of world object (excludes original player) | numberradius | array<Player> | No | 
| get_nearby_party_members | get an array of all party members within given radius of world object (excludes original player) | numberradius | array<Player> | No | 
| cancel_aura | remove a beneficial aura from the player | Auraaura ornumberspell_id | none | No |