WoW API: IsItemInRange

Revision as of 04:46, 15 August 2023 by Move page script (talk | contribs) (Move page script moved page API IsItemInRange to API IsItemInRange without leaving a redirect)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

WoW API < IsItemInRange

Returns if you are in range of the specified unit to use the specified item.

result = IsItemInRange("itemName" or "itemLink", "unit")

ParametersEdit

ArgumentsEdit

(itemId or "itemName" or "itemLink", "unit")
itemId
Integer - The numeric ID of the item. ie. 12345
itemName
String - The Name of the Item, e.g. "Heavy Silk Bandage"
itemLink
String - The itemLink, when Shift-Clicking items.
unit
String - The unitId for which the check is done.

ReturnsEdit

result
Integer - If in range to perform the action 1. Otherwise 0. nil if the action is invalid.

ExampleEdit

if ( IsItemInRange("Heavy Silk Bandage","target") ) then
  -- light up a part of the interface
else
  -- darken
end

Common RangesEdit

Bandages: 18 yards