WoW:API TargetByName: Difference between revisions
Jump to navigation
Jump to search
m (Move page script moved page API TargetByName to API TargetByName without leaving a redirect) |
|||
(2 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{wowapi}} __NOTOC__ | {{wowapi}} __NOTOC__ | ||
{{removedapi|2.0.1|For alternatives, try [[API_SecureTemplates|Secure Templates]] or the /target}} | |||
Target a player by their name. | Target a player by their name. | ||
Line 19: | Line 20: | ||
== Details == | == Details == | ||
: If the user isn't nearby or doesn't exist, and '''exactMatch''' isn't set, TargetByName picks the closest match from characters nearby. | : If the user isn't nearby or doesn't exist, and '''exactMatch''' isn't set, TargetByName picks the closest match from characters nearby. | ||
Line 26: | Line 25: | ||
: If '''exactMatch''' is set, TargetByName can also target party members even if they are out of visible range. | : If '''exactMatch''' is set, TargetByName can also target party members even if they are out of visible range. | ||
: If there is no close match available then an error message is displayed (Error event?) and the target is left unchanged. There is no return value from this method so the only way to check for success is see what the target ended up as afterwards. | : If there is no close match available then an error message is displayed (Error event?) and the target is left unchanged. There is no return value from this method so the only way to check for success is see what the target ended up as afterwards. |
Latest revision as of 04:47, 15 August 2023
← WoW API < TargetByName
This is no longer a part of the World of Warcraft API.
|
Target a player by their name.
TargetByName("name", exactMatch);
Parameters[edit]
Arguments[edit]
- ("name", exactMatch)
- name
- String - The name of the player to target.
- exactMatch
- Boolean
Example[edit]
TargetByName("Norrin", true);
Details[edit]
- If the user isn't nearby or doesn't exist, and exactMatch isn't set, TargetByName picks the closest match from characters nearby.
- If exactMatch is set, TargetByName can also target party members even if they are out of visible range.
- If there is no close match available then an error message is displayed (Error event?) and the target is left unchanged. There is no return value from this method so the only way to check for success is see what the target ended up as afterwards.