WoW:API GetBonusBarOffset: Difference between revisions
(Added Druid info - may not be complete.) |
(→Example: upgraded code blocks) |
||
Line 1: | Line 1: | ||
{{wowapi}} | {{wowapi}} | ||
Returns the current bonus action bar index. | Returns the current bonus action bar index. | ||
offset = GetBonusBarOffset() | |||
offset = GetBonusBarOffset() | |||
== Parameters == | == Parameters == | ||
Line 33: | Line 30: | ||
== Example == | == Example == | ||
/script ChatFrame1:AddMessage(GetBonusBarOffset()) | |||
slotID = (1 + (NUM_ACTIONBAR_PAGES + GetBonusBarOffset() - 1) * NUM_ACTIONBAR_BUTTONS) | |||
This will simply print the output of GetBonusBarOffset(). It should change as you change between your bonus bars. | |||
slotID = (1 + (NUM_ACTIONBAR_PAGES + GetBonusBarOffset() - 1) * NUM_ACTIONBAR_BUTTONS) | |||
Here, slotID will be the action slot number for the first slot of the current bonus bar. For example, for a Warrior in Defensive Stance, <tt>slotID = 85</tt>, which is correct. ([[ActionSlot]]) |
Revision as of 00:39, 13 May 2007
Returns the current bonus action bar index.
offset = GetBonusBarOffset()
Parameters
Arguments
- NONE
Returns
- offset - Number
- The current bonus action bar index.
Details
Certain classes have "bonus action bars" for their class-specific actions, e.g. the various Stance Bars for the Warrior class. GetBonusBarOffset() returns the index of the current action bar that is being displayed. Note that simply scrolling through the action bar pages won't change the output; only switching to the different bonus bars. Each class has their own way of indexing their bonus bars.
Warrior
- Battle Stance: 1
- Defensive Stance: 2
- Berserker Stance: 3
Druid
- Caster: 0
- Bear: 3
- Cat: 1
Rogue
- Normal: 0
- Stealthed: 1
Example
/script ChatFrame1:AddMessage(GetBonusBarOffset())
This will simply print the output of GetBonusBarOffset(). It should change as you change between your bonus bars.
slotID = (1 + (NUM_ACTIONBAR_PAGES + GetBonusBarOffset() - 1) * NUM_ACTIONBAR_BUTTONS)
Here, slotID will be the action slot number for the first slot of the current bonus bar. For example, for a Warrior in Defensive Stance, slotID = 85, which is correct. (ActionSlot)