WoW:API IsItemInRange: Difference between revisions
Jump to navigation
Jump to search
(initial sketchy version) |
(Added itemLink as parameter and removed the wrong "0 = false" statement) |
||
Line 1: | Line 1: | ||
{{wowapi}} | {{wowapi}}__NOTOC__ | ||
Returns if you are in range of the specified unit to use the specified item. | |||
result = IsItemInRange("itemName" or "itemLink", "unit") | |||
== Parameters == | |||
=== Arguments === | |||
:("itemName" or "[[itemLink]]", "[[unitId|unit]]") | |||
--- | :;itemName : String - The Name of the Item, e.g. "Heavy Silk Bandage" | ||
; | :;[[itemLink]] : String - The [[itemLink]], when Shift-Clicking items. | ||
:;[[unitId|unit]] : String - The [[unitId]] for which the check is done. | |||
: | === Returns === | ||
:;result : Integer - If in range to perform the action ''1''. Otherwise ''0''. ''nil'' if the action is invalid. | |||
== Example == | |||
if ( IsItemInRange("Heavy Silk Bandage","target") ) then | if ( IsItemInRange("Heavy Silk Bandage","target") ) then | ||
-- light up a part of the interface | -- light up a part of the interface | ||
Line 30: | Line 20: | ||
-- darken | -- darken | ||
end | end | ||
== Common Ranges == | |||
Bandages: 18 yards |
Revision as of 17:36, 4 June 2008
← 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
Arguments
Returns
- result
- Integer - If in range to perform the action 1. Otherwise 0. nil if the action is invalid.
Example
if ( IsItemInRange("Heavy Silk Bandage","target") ) then -- light up a part of the interface else -- darken end
Common Ranges
Bandages: 18 yards