WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Macro Help (https://www.wowinterface.com/forums/forumdisplay.php?f=140)
-   -   Difference between /target and /targetexact (https://www.wowinterface.com/forums/showthread.php?t=58047)

hasnogaems 06-12-20 07:14 AM

Difference between /target and /targetexact
 
So far look like they perform identical function?

Kanegasi 06-12-20 10:49 AM

/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)


All times are GMT -6. The time now is 05:40 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI