Fandom

WoWWiki

API CheckInteractDistance

104,637pages on
this wiki
Add New Page
Talk3 Share

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.

WoW API < CheckInteractDistance

Checks whether you are in range to perform a specific interaction with a specified unit.

inRange = CheckInteractDistance("unit", distIndex);

ArgumentsEdit

unit 
String - Unit to compare distance to.
distIndex 
Number - A value from 1 to 4:
1 = Inspect, 28 yards
2 = Trade, 11.11 yards
3 = Duel, 9.9 yards
4 = Follow, 28 yards

ReturnsEdit

inRange 
Boolean flag - 1 if you are in range to perform the interaction, nil otherwise.

ExampleEdit

if ( CheckInteractDistance("target", 4) ) then
  FollowUnit("target");
else
  -- we're too far away to follow the target
end

NotesEdit

  • If "unit" is a hostile unit, the return values are the same. But you obviously won't be able to do things like Trade.

Also on Fandom

Random Wiki