WoW:API IsUsableAction: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
mNo edit summary
m (Formatting)
Line 1: Line 1:
'''isUsableAction'''
<center>'''IsUsableAction'''</center>


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.
 
isUsable, notEnoughMana = IsUsableAction(id);
 
----
;''Arguments''
 
id
The "id" is the actionbutton id.
 
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.
 
----
;''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''


isUsable, notEnoughMana = IsUsableAction(slot)
== Parameters ==
=== Arguments ===
:(slot)


:;slot : Integer - The action slot to retrieve data for.
=== Returns ===
:isUsable, notEnoughMana


:;isUsable : Flag - Returns 1 if the action is valid for use at present (Does NOT include cooldown or range tests), nil otherwise.
:;notEnoughMana : Flag - Returns 1 if the reason for the action not being usable is because there is not enough mana/rage/energy, nil otherwise.
== Example ==
<!-- begin code -->
local isUsable, notEnoughMana = IsUsableAction(1);
<!-- end code -->
----
----
__NOTOC__
{{Template:WoW API}}
{{Template:WoW API}}
[[Category:API Action Functions|IsUsableAction]]
[[Category:API Functions|IsUsableAction]]
[[Category:API Functions|IsUsableAction]]
[[Category:API Action Functions|IsUsableAction]]

Revision as of 02:09, 20 September 2005

IsUsableAction

Determine if an action can be used.

isUsable, notEnoughMana = IsUsableAction(slot)

Parameters

Arguments

(slot)
slot
Integer - The action slot to retrieve data for.

Returns

isUsable, notEnoughMana
isUsable
Flag - Returns 1 if the action is valid for use at present (Does NOT include cooldown or range tests), nil otherwise.
notEnoughMana
Flag - Returns 1 if the reason for the action not being usable is because there is not enough mana/rage/energy, nil otherwise.

Example

local isUsable, notEnoughMana = IsUsableAction(1);

Template:WoW API