Quantcast
Difference between /target and /targetexact - WoWInterface
Thread Tools Display Modes
06-12-20, 07:14 AM   #1
hasnogaems
A Cliff Giant
 
hasnogaems's Avatar
Join Date: Apr 2016
Posts: 75
Difference between /target and /targetexact

So far look like they perform identical function?
  Reply With Quote
06-12-20, 10:49 AM   #2
Kanegasi
A Molten Giant
 
Kanegasi's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2007
Posts: 505
/target will target the first thing that matches what you put after it, but /targetexact will only target exactly what you put after it.

For example, let's say you are surrounded by 10 neutral npcs named "Billy" and a boss named "Billiam". /target Bill will target any of these 11 npcs with no guarantee who, but /targetexact Bill will do nothing because there is no npc named Bill nearby.

If you are familiar with Lua, here's the two functions that these commands call:

Lua Code:
  1. SecureCmdList["TARGET"] = function(msg)
  2.     local action, target = SecureCmdOptionParse(msg);
  3.     if ( action ) then
  4.         if ( not target or target == "target" ) then
  5.             target = action;
  6.         end
  7.         TargetUnit(target);
  8.     end
  9. end
  10.  
  11. SecureCmdList["TARGET_EXACT"] = function(msg)
  12.     local action, target = SecureCmdOptionParse(msg);
  13.     if ( action ) then
  14.         if ( not target or target == "target" ) then
  15.             target = action;
  16.         end
  17.         TargetUnit(target, true);
  18.     end
  19. end

And the function they use: https://wow.gamepedia.com/API_TargetUnit
(TargetUnit is defined in the C portion of WoW, not reasonably available to the public)
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » Macro Help » Difference between /target and /targetexact

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off