WoW:API GetBonusBarOffset: Difference between revisions

→‎Example: upgraded code blocks
(Added Druid info - may not be complete.)
(→‎Example: upgraded code blocks)
Line 1: Line 1:
{{wowapi}} __NOTOC__
{{wowapi}}


Returns the current bonus action bar index.
Returns the current bonus action bar index.
{{Code/Begin}}
offset = GetBonusBarOffset()
offset = GetBonusBarOffset()
{{Code/End}}
 


== Parameters ==
== Parameters ==
Line 33: Line 30:


== Example ==
== Example ==
{{Code/Begin}}
/script ChatFrame1:AddMessage(GetBonusBarOffset())
{{Code/End}}
:This will simply print the output of GetBonusBarOffset().  It should change as you change between your bonus bars.


{{Code/Begin}}
/script ChatFrame1:AddMessage(GetBonusBarOffset())
slotID = (1 + (NUM_ACTIONBAR_PAGES + GetBonusBarOffset() - 1) * NUM_ACTIONBAR_BUTTONS)
 
{{Code/End}}
This will simply print the output of GetBonusBarOffset().  It should change as you change between your bonus bars.
: 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]])
 
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]])
Anonymous user