WoW:API ActionHasRange: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
(First version of page)
 
m (Move page script moved page API ActionHasRange to API ActionHasRange without leaving a redirect)
 
(3 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{wowapi}} __NOTOC__
{{wowapi}}
 
 
<!-- Describe the purpose of the function, exhausting detail can be saved for a later section -->
Returns true is the action has a numeric range requirement.
 
<!-- List return values and arguments as well as function name, follow Blizzard usage convention for args -->
isTrue = ActionHasRange(slotID)
 
 
 
 
 
 
 
 


Returns true if the action has a numeric range requirement.


local hasRange = ActionHasRange(slotID)


== Parameters ==
== Parameters ==
''Arguments''
=== Arguments ===
<!-- List each argument, together with its type -->
* slotID (number) - The [[actionSlot|slot ID]] to test
 
:;slotID : Number - The [[actionSlot|slot ID]] to test.
 
''Returns''
<!-- List each return value, together with its type -->
 
:Boolean - True if the specified action has a numeric range requirement.
 
 


=== Returns ===
* hasRange (boolean) - True if the specified action has a numeric range requirement


== Example ==
== Example ==
<!-- If it helps, include an example here, though it's not required if the usage is self-explanatory -->
  /script if ActionHasRange(1) then if IsActionInRange(1) then ChatFrame1:AddMessage("Action 1 is in range!"); end end
  /script if (ActionHasRange(1)) then if (IsActionInRange(1))
  then ChatFrame1:AddMessage("Action 1 is in range!");end;end;


'''Result'''
;Result
<!-- If it helps, include example results here, though they are not required. You're allowed to cheat liberally since WoW isn't a command line language. -->
  "Action 1 is in range!"
  "Action 1 is in range!"
: The above message will be printed if the action in slot 1 has a numeric range requirement and you are within range of the target (or if there is no target; see [[API IsActionInRange|IsActionInRange]]).
The above message will be printed if the action in slot 1 has a numeric range requirement and you are within range of the target (or if there is no target; see [[API IsActionInRange|IsActionInRange]]).
 
 
==Details==
<!-- Details not appropriate for the main description can go here.
    REMOVE the section if you're just going to restate the intro line! -->


: This function returns true if the action in the specified slot ID has a numeric range requirement as shown in the action's tooltip, e.g. [[Fire Blast]] has a numeric range of 20 yards.  For actions like [[Attack]] which have no numeric range requirement in their tooltip (even though they only work within a certain range), this function will return false.
== Details ==
This function returns true if the action in the specified slot ID has a numeric range requirement as shown in the action's tooltip, e.g. Fire Blast has a numeric range of 20 yards.  For actions like Attack which have no numeric range requirement in their tooltip (even though they only work within a certain range), this function will return false.

Latest revision as of 04:45, 15 August 2023

WoW API < ActionHasRange

Returns true if the action has a numeric range requirement.

local hasRange = ActionHasRange(slotID)

Parameters[edit]

Arguments[edit]

  • slotID (number) - The slot ID to test

Returns[edit]

  • hasRange (boolean) - True if the specified action has a numeric range requirement

Example[edit]

/script if ActionHasRange(1) then if IsActionInRange(1) then ChatFrame1:AddMessage("Action 1 is in range!"); end end
Result
"Action 1 is in range!"

The above message will be printed if the action in slot 1 has a numeric range requirement and you are within range of the target (or if there is no target; see IsActionInRange).

Details[edit]

This function returns true if the action in the specified slot ID has a numeric range requirement as shown in the action's tooltip, e.g. Fire Blast has a numeric range of 20 yards. For actions like Attack which have no numeric range requirement in their tooltip (even though they only work within a certain range), this function will return false.