Wowpedia

We have moved to Warcraft Wiki. Click here for information and the new URL.

READ MORE

Wowpedia
(clarify the mana return value, and also that it ignores cooldown)
DDCBot (talk | contribs)
m (→‎Returns: .apilink)
Tag: WoW API docs
(9 intermediate revisions by 9 users not shown)
Line 1: Line 1:
  +
{{wowapi}} __NOTOC__
'''isUsableAction'''
 
   
Checks to see if a given action is usable, and also if you have the required mana/energy/rage to activate it. Does not consider cooldown.
+
Determine if an action can be used (you have sufficient mana, reagents and the action is not on cooldown).
   
isUsable, notEnoughMana = IsUsableAction(id);
+
isUsable, notEnoughMana = IsUsableAction(slot)
   
 
== Arguments ==
----
 
;''Arguments''
 
   
  +
:;slot : Number - [[Action slot]] to query
id
 
The "id" is the actionbutton id.
 
   
 
== Returns ==
If you keep your action you want to check for usability on, say, action button 1 on action bar 1, the id is 1. Action bar 1 starts at id 1, action bar 2 starts at id 12, action bar 3 at id 24 and so on.
 
If you keep it on action button 5 on bar 3, it's (3-1)*12 + 5 = 27.
 
   
  +
;isUsable : <span class="apitype">boolean</span> - true if the action is currently usable (does not check cooldown or range), false otherwise.
----
 
  +
;notEnoughMana : <span class="apitype">boolean</span> - true if the action is unusable beacuse the player does not have enough mana, rage, etc.; false otherwise.
;''Returns''
 
 
isUsable, notEnoughMana
 
 
isUseable = 1 if the action button is useable, or 'nil' if it is not.
 
notEnoughMana = 1 if low mana is the cause, or 'nil' if mana is not the cause, or if the button is usable.
 
 
----
 
;''Example''
 
local isUsable, notEnoughMana = IsUsableAction(1);
 
 
;''Result''
 
 
----
 
;''Description''
 
 
 
 
----
 
{{Template:WoW API}}
 
[[Category:API Functions|IsUsableAction]]
 
[[Category:API Action Functions|IsUsableAction]]
 

Revision as of 03:21, 26 August 2021

Determine if an action can be used (you have sufficient mana, reagents and the action is not on cooldown).

isUsable, notEnoughMana = IsUsableAction(slot)

Arguments

slot
Number - Action slot to query

Returns

isUsable
boolean - true if the action is currently usable (does not check cooldown or range), false otherwise.
notEnoughMana
boolean - true if the action is unusable beacuse the player does not have enough mana, rage, etc.; false otherwise.