Quantcast
ESOUI - View Single Post - abilityIndex parameter of GetAbilityIdByIndex()
View Single Post
06/16/20, 11:34 AM   #2
Baertram
 
Baertram's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 3,042
Best advice: If you are unsure "how to" do something check how ZOs is doing it in their code.
Most of the code is located in the "ingame" folder and then in a subfolder having the name of the control or stuff you are currently working on like "actionbar":
https://github.com/esoui/esoui/tree/...game/actionbar

I cannot find the function GetAbilityIdByIndex anywhere used there so most probably it's not the one you should or could use.
And if so jist try it ingame. An index will normally start with 1 in lua (could be 0 as well).
So try a script like
Lua Code:
  1. /script d(tostring(GetAbilityIdByIndex(1)))
andd see what abilityId it returns. Should be either the ultimate slot or your 1st bar slot 1, or the active bar slot 1 if it's not making any difference in the 2 bars, and the index only works from 1 to 6 (5 slots + 1 ultimate) maybe.

These constants values could help as well:
https://wiki.esoui.com/Constant_Values

Code:
ACTION_BAR_FIRST_NORMAL_SLOT_INDEX = 2
ACTION_BAR_SLOTS_PER_PAGE = 6
ACTION_BAR_ULTIMATE_SLOT_INDEX = 7
You could use a loop like
Lua Code:
  1. --will loop from 2 to 7, increasing by 1. Maybe the values 2 and 7 are not the correct ones though so maybe it starts at 1, you need to chekc this on your own. But it should be okay, as:
  2. --+1 is there because ZOs is using the same (ACTION_BAR_ULTIMATE_SLOT_INDEX+1) for the ultimateslot index! So it's actually 8 not 7. Guess it's really starting at 2 then and not at 1.
  3. for actionButtonIndex=ACTION_BAR_FIRST_NORMAL_SLOT_INDEX, ACTION_BAR_ULTIMATE_SLOT_INDEX+1, 1 do
  4.   d("Slot number: " .. tostring(actionButtonIndex) ", abilityId: " .. tostring(GetAbilityIdByIndex(actionButtonIndex)))
  5. end

Last edited by Baertram : 06/16/20 at 11:42 AM.
  Reply With Quote