View Single Post
07/08/17, 03:00 AM   #2
sirinsidiator
 
sirinsidiator's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 1,578
I am moving this to a different forum since what you ask for is already possible.

In order to assign an item to a quickslot, you can't use
Code:
SelectSlotAbility *protected* (*luaindex* _abilityIndex_, *luaindex* _slotIndex_)
Items are not abilities, so instead you need to use
Code:
SelectSlotItem *protected* (*integer* _bagId_, *integer* _bagSlotId_, *luaindex* _slotIndex_)
The quickslot indices also do not go from 1 to QSB.ButtonMaxCount. They are in the same space as the action bar slots and start at 9. But you do not need to know the actual numbers. Instead you can use the ACTION_BAR_FIRST_UTILITY_BAR_SLOT and ACTION_BAR_UTILITY_BAR_SIZE constants.

So what you want to do is the following:
Lua Code:
  1. for i = ACTION_BAR_FIRST_UTILITY_BAR_SLOT + 1, ACTION_BAR_FIRST_UTILITY_BAR_SLOT + ACTION_BAR_UTILITY_BAR_SIZE do
  2.     CallSecureProtected("ClearSlot", i)
  3.     CallSecureProtected("SelectSlotItem", bagId, slotId, i)
  4. end
  Reply With Quote