Thread Tools Display Modes
01-10-06, 12:49 PM   #1
Artenn
A Kobold Labourer
Join Date: Jan 2006
Posts: 1
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.
  Reply With Quote
01-10-06, 02:47 PM   #2
Lozareth
An Onyxian Warder
 
Lozareth's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2005
Posts: 366
I'd say install Discord Macro Functions and create this regular macro then drop it in the button:

/script local m={"highest mana gem", "2nd highest", "3rd highest", "4th highest"}; for _,x in m do if UseItemByName(x) then break end end
__________________
High Pope of the Divine Chihuahua
http://www.discordmods.com
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » Released AddOns » Item Does Exist Question


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off