So, I think I need to break this down into several bite-sized pieces...
First:
A button that can cast a spell/use an item. I'm sure this is simple enough, but I just haven't done it before.
Second:
A way to find out which spells a player knows that can heal, and which items they have on them that can heal them. Build a list of these items, and come up with some values for them based on healing amount, cast time, etc.
Third:
Determine if the player is in or out of combat at a given time, and switch between two different modes - if in combat, look for the fastest possible healing, if out of combat, look at the most effective.
Fourth:
Give the player some settings:
- Option to Enable/Disable addon.
- Option to Use/Not use Spells.
- Option to Use/Not use Potions.
- Option to Use/Not use Bandages.
- Option to define different modifier keys to change the functionality of the button - for instance, ALT could force "Speed" casting, CTRL could force using an Item, etc.
- Option to set Hotkey for the button.
#2 is definately going to be the hardest, and I'm really not sure how I'm going to do it yet...
#1 looks like it
should be simple, but I'm not sure where to start with making a simple, draggable button (similar to Coconuts or something). Are there any tutorials, or simple examples for doing that somewhere?