Mrfrippe@legacy41559417 (talk | contribs) (clarify the mana return value, and also that it ignores cooldown) |
m (→Returns: .apilink) Tag: WoW API docs |
||
(9 intermediate revisions by 9 users not shown) | |||
Line 1: | Line 1: | ||
+ | {{wowapi}} __NOTOC__ |
||
− | '''isUsableAction''' |
||
− | + | Determine if an action can be used (you have sufficient mana, reagents and the action is not on cooldown). |
|
− | isUsable, notEnoughMana = IsUsableAction( |
+ | isUsable, notEnoughMana = IsUsableAction(slot) |
⚫ | |||
− | ---- |
||
⚫ | |||
+ | :;slot : Number - [[Action slot]] to query |
||
− | 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. |
||
+ | ;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. |
||
⚫ | |||
− | |||
− | 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
Automated updating of API pages at this location, to reflect patch changes, has ceased from 10.1.7 onwards. |
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.