Switchable macro sets with variables - Addon - Jamba-Macro
I've been hacking away at Jamba-Macro.
You need:
JambaDev (0.5) Download
This is alpha quality stuff and there are few places where you will get lua errors if you click some buttons without having a valid selection. Basically some buttons are not disabled when they should be. There is no validation on the names of macro and variable sets which should not have spaces in them.
Its much more stable now.
I want to know if:
a) Anyone thinks they would use this,
b) How to make it better.
How it works
The macros are stored within Jamba-Macro and are built on the fly. You cannot see their icons or cooldown status.
Macro Sets
Initial you create a set of macros and give them a name. Within this set, you can add and remove macros. You can make as many sets of macros as you like. They must have unique names and the names cannot have spaces in them. You can make a new macro set by copying an existing one.
Macros
The macros inside a macro set have 4 properties. A name, a tag, the macro text (the command) and a key binding.
Macro Name
The macro name can be anything you like (numbers and letters only).
Macro Tag
Only characters with this tag will enable this macro. You can put a ! in front of the tag to mean everyone expect the one with that tag.
Say I had 3 toons, toon1, toon2, toon3, tagged appropriately.
A tag of toon1 would get toon1.
A tag of !toon1 would get toon2 and toon3.
Macro Text
The macro text is like a regular macro, except that you can put variables in place of regular text. Variables are distinguished by being wrapped in #. An example:
/cast [target=#player2#] #spellheal#
in this macro there are two variables; player2 and spellheal
Macro Key
To use a macro, you must assign it a key. The key bound to each macro, does not affect your regular key bindings, but the Jamba-Macro key will take precedence over your regular key bindings.
Variable Sets
The macro above with its variables cannot be used by wow. The variables need to be substituted with a real player and a proper spell name. As with macro sets, you can make variable sets. Variable set names cannot have spaces in them.
Variables
Each variable set contains one or more variables. Each variable has a name and a value. The variable names should match up to the variables in your macros. The variable values are real values. For the example,
player2 = Sairam
spellheal = Flash Heal
You can use a tag in place of a variable - for instance the master tag #master#, will replace itself with the name of the current Jamba master.
In case of conflict, the tag value will override the variable value.
If you use a tag that has more the one character associated with it, the tag will be replaced with the first character name the tag system finds.
Variable Tag
Only characters with this tag will enable this variable. You can have the same variable several times, each with its own tag.
Putting it all together
I'm going to make 1 macro set with 1 macro in it.
My macro set is called: heals
My 1 macro in this set is as follows: /cast [target=#player2#] #spellheal# (this macro is bound to key F2)
I have 2 variable sets; 1 called normal and the other called pug
normal variable set has these values:
player2 = Sairam
spellheal = Greater Heal
pug variable set has these values:
player2 = Bob
spellheal = Flash Heal
Using the macros
The format of the command is (and should only be run out of combat):
/jamba-macro use <macro set name> <variable set name> <tag>
So to use my macro with the normal variable set I type
/jamba-macro use heals normal
Now when I press F2 I cast Greater Heal on Sairam.
Now I type
/jamba-macro use heals pug
and when I press F2 this time I cast Flash Heal on Bob.
Using the macros with /click
You can /click any macro, by prefixing the macroname with JMB_
e.g. /click JMB_
Notes
At the moment you can only use key binds to cast macros. I am thinking about allowing /click macro name, but this method would take up more resources as I could not recycle frames easily. Let me know if you would like to /click the macro names.
You can try /click JambaMacroFrame1, /click JambaMacroFrame2, etc. but every time you use a macro set, the buttons get recycled and there is no guarantee you will get the same macro again with that button.
You can have as many macros, variables, macro sets and variable sets as you like. Remember each macro set can have a lot of macros in it (not just the one as in my example).
Some screenshots of the UI
http://wow.jafula.com/images/extforums/jambamacro1.png
http://wow.jafula.com/images/extforums/jambamacro3.png
http://wow.jafula.com/images/extforums/jambamacro2.png
Let me know what you think...