WoW:API IsActionInRange: Difference between revisions

mNo edit summary
 
m (Move page script moved page API IsActionInRange to API IsActionInRange without leaving a redirect)
 
(8 intermediate revisions by 8 users not shown)
Line 1: Line 1:
<center>'''IsActionInRange''' - ''Documentation by [[User:Flickering|Flickering]]''</center>
{{wowapi}} __NOTOC__
 
Test whether an action is in range for use.
Test whether an action is in range for use.


  inRange = IsActionInRange(actionSlot)
  inRange = IsActionInRange(actionSlot);
== Parameters ==
== Parameters ==
=== Arguments ===
=== Arguments ===
:(actionSlot)
:;actionSlot : Numeric - The [[actionSlot|action slot]] to test.
=== Returns ===
:;inRange : Flag - nil if the slot has no action or if there is no current target. 0 if the action is out of range, and 1 if the action is in range. Note that it always returns 1 if range does not apply to this action  or if you can't use the spell on the target.


:;actionSlot : Numeric - The action slot to test.
== Note ==
=== Returns ===
:inRange


:;inRange : Flag - nil if the slot has no action or has an action to which range does not apply. 0 if the action is out of range, and 1 if the action is in range.
If you need more performance than target switching and checking with IsActionInRange provides then check out [[API_CheckInteractDistance|CheckInteractDistance]]. It has certain limits and will not work for all ranges, but it is several orders of magnitude faster than target switching/scanning.
----
__NOTOC__
{{Template:WoW API}}
[[Category:API Action Functions|IsActionInRange]]

Latest revision as of 04:46, 15 August 2023

WoW API < IsActionInRange

Test whether an action is in range for use.

inRange = IsActionInRange(actionSlot);

Parameters

Arguments

actionSlot
Numeric - The action slot to test.

Returns

inRange
Flag - nil if the slot has no action or if there is no current target. 0 if the action is out of range, and 1 if the action is in range. Note that it always returns 1 if range does not apply to this action or if you can't use the spell on the target.

Note

If you need more performance than target switching and checking with IsActionInRange provides then check out CheckInteractDistance. It has certain limits and will not work for all ranges, but it is several orders of magnitude faster than target switching/scanning.