WoW:API DoEmote: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
m (Formatting)
(Rewritten)
Line 1: Line 1:
{{wowapi}}
{{wowapi}}__NOTOC__


<!-- List return values and arguments as well as function name, follow Blizzard usage convention for args -->
DoEmote("token" [,"player"]);
 
DoEmote("token"[, "player"]);


<!-- Describe the purpose of the function, though exhausting detail can be saved for a later section -->
<!-- Describe the purpose of the function, though exhausting detail can be saved for a later section -->


Executes an emote.
== Parameters ==
=== Arguments===


----
:("token", "player")
;''Arguments''
<!-- List each argument, together with its type -->


:("token", "player")
:;token : String - the token that describes which emote is being used.  See [[API_TYPE_Emotes_Token|Emotes Tokens]]
:;token : String - the token that describes which emote is being used.  See [[API_TYPE_Emotes_Token|Emotes Tokens]]
:;target : Any - if a string or number is set for this argument, the emote will behave as if no target were selected.


----
:;player : Any - If this argument is not '''nil''', the emote will behave as if no target were selected (ie. performs it on the player).
;''Returns''
 
=== Returns ===
 
:;nil
 
== Usage ==
=== Example ===


<!-- List each return value, together with its type -->
DoEmote("cry");    -- Say you have 'Bob' selected.  You see:  You cry on Bob's shoulder.
:Nothing.
                    -- If you have no target, you see:          You cry.
DoEmote("cry",1);  -- Regardless of whether or not you have Bob selected, you will see:
                    --  You cry.


----
=== Notes ===
;''Details''


<!-- Details not appropriate for the main description can go here -->
* Executes one of the emotes based on the given token, including vocal emotes and animations.  The list of currently valid emotes is given in ChatFrame.lua, defined as one of the EMOTE''x''_TOKEN constants.  ''x'' starts at 1 and goes up to MAXEMOTEINDEX (which is 451 in WotLK 3.0.3).
: Executes one of the emotes based on the given token, including vocal emotes.  The list of currently valid emotes is given in ChatFrame.lua, defined as one of the EMOTE''x''_TOKEN constants.  ''x'' starts at 1 and currently goes up to 171 (as of 2.1.2). Certain emotes may also trigger character animations and sound effects.
* Emotes in TextEmoteSpeechList will trigger vocal effects. (defined in ChatFrame.lua)
: As of August 21, 2008 (2.4.3), if the function has only the first argument, it automatically produces a targeted emote if a target exists or a non-targeted emote if none exists.  Supplying a string or number to the "target" argument appears to force the function to behave as if no target were selected, regardless of an actual target.
* Emotes in EmoteList will trigger animation effects. (defined in ChatFrame.lua)
* It is unclear whether two these lists contain all valid animation or speech effects, however.
* You cannot use the second option to specify a target, only to specify the absence of a target.

Revision as of 10:51, 10 November 2008

WoW API < DoEmote

DoEmote("token" [,"player"]);


Parameters

Arguments

("token", "player")
token
String - the token that describes which emote is being used. See Emotes Tokens
player
Any - If this argument is not nil, the emote will behave as if no target were selected (ie. performs it on the player).

Returns

nil

Usage

Example

DoEmote("cry");    -- Say you have 'Bob' selected.  You see:   You cry on Bob's shoulder.
                   -- If you have no target, you see:          You cry.
DoEmote("cry",1);  -- Regardless of whether or not you have Bob selected, you will see:
                   --   You cry.

Notes

  • Executes one of the emotes based on the given token, including vocal emotes and animations. The list of currently valid emotes is given in ChatFrame.lua, defined as one of the EMOTEx_TOKEN constants. x starts at 1 and goes up to MAXEMOTEINDEX (which is 451 in WotLK 3.0.3).
  • Emotes in TextEmoteSpeechList will trigger vocal effects. (defined in ChatFrame.lua)
  • Emotes in EmoteList will trigger animation effects. (defined in ChatFrame.lua)
  • It is unclear whether two these lists contain all valid animation or speech effects, however.
  • You cannot use the second option to specify a target, only to specify the absence of a target.