WoW:API IsItemInRange: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
(Added itemLink as parameter and removed the wrong "0 = false" statement)
m (Move page script moved page API IsItemInRange to API IsItemInRange without leaving a redirect)
 
(One intermediate revision by one other user not shown)
Line 5: Line 5:
== Parameters ==
== Parameters ==
=== Arguments ===
=== Arguments ===
:("itemName" or "[[itemLink]]", "[[unitId|unit]]")
:(itemId or "itemName" or "[[itemLink]]", "[[unitId|unit]]")


:;itemId : Integer - The numeric ID of the item. ie. 12345
:;itemName : String - The Name of the Item, e.g. "Heavy Silk Bandage"
:;itemName : String - The Name of the Item, e.g. "Heavy Silk Bandage"
:;[[itemLink]] : String - The [[itemLink]], when Shift-Clicking items.
:;[[itemLink]] : String - The [[itemLink]], when Shift-Clicking items.

Latest revision as of 04:46, 15 August 2023

WoW API < IsItemInRange

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

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

Parameters[edit]

Arguments[edit]

(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.

Returns[edit]

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

Example[edit]

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

Common Ranges[edit]

Bandages: 18 yards