WoW:API IsUsableAction: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
mNo edit summary |
||
Line 1: | Line 1: | ||
'''isUsableAction''' | '''isUsableAction''' | ||
Checks to see if a given action is usable, and also if you have the required mana/energy/rage to activate it. | 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. | ||
isUsable, notEnoughMana = IsUsableAction(id); | isUsable, notEnoughMana = IsUsableAction(id); | ||
Line 11: | Line 11: | ||
The "id" is the actionbutton 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. If you keep it on action button | 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'' | ;''Returns'' | ||
isUsable, | isUsable, notEnoughMana | ||
isUseable = 1 or 'nil' | 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. | |||
---- | ---- |
Revision as of 11:07, 13 September 2005
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.
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