Item Does Exist Question
Over in FlexbarForums they show a script for creating a button that when pressed will use the highest mana gem available. I thought this was a pretty nifty idea and set out to try and recreate the same function on DAB.
The problem I am sticking on is that I am unable to figure out how to determine which mana gem is next highest. I can see how to swap the floater IDs on subsequent pushes, but I cannot figure out how to determine which gem to swap to (or use even). Is there some function that I can call to determine if an item is usable (or present)?
For example, assume all 4 are created and assigned to floaters. There is a 5th floater that serves as my "Use Mana Gem" button. Then assume we set the action ID of the Use Mana Gem button to the Mana Ruby floater. On pressing the Mana Gem button we use the Mana Ruby, but how do I decide which of the other gems action IDs to go to next?
Do I even need to create 5 buttons for all this (given the 4 buttons with the gems would be hidden)? Is there any way I can use the mana gems directly from my backpack without assigning to floaters? I can call UseInventory() if I knew the bag/slot of the gem, but I would rather not have to have 4 slots dedicated to only those gems. Or does anyone know of a function to use an item by name?
Any suggestions or thoughts are greatly appreciated.
|