********** IMPORTANT ***********
If you are upgrading from a previous version, you must not overwrite Sequences.lua or you will wipe out any sequences you've created. I suggest extracting only MacroSequence.lua from the zip file or copying Sequences.lua out of the MacroSequence folder and then copying it back once you've installed the new version.
The next major version will add a GUI and will no longer use Sequences.lua to store the macros you create. However, it will be able to import anything in your Sequences.lua.
*******************************
Have you ever wanted to sequence arbitrary macro commands instead of just spells and items? Now's your chance! MacroSequence reproduces most of /castsequence's functionality but instead of individual spells or items, each element in the sequence can be an entire macro. There are only two missing behaviors of /castsequence: reset on target change (impossible to do with current state headers) and holding position if an action fails (something many people don't like about /castsequence anyway).
In addition to its sequencing, the macros can be of unlimited length. This makes MacroSequence a contender as an extended macro addon.
To create sequences, you need to edit a table in Sequences.lua, though I've tried to make this very simple. Here is the documentation comment at the beginning of that file:
Code:
Each entry in this table defines a single macro sequence akin to the
/castsequence command. Take the following macro, for example:
/castsequence reset=alt/10 Immolate, Corruption, Curse of Agony
This can be represented as follows:
WarlockStarter = {
reset = {
alt = true,
seconds = 10
},
"/cast Immolate",
"/cast Corruption",
"/cast Curse of Agony"
},
The easiest way to trigger a sequence is to /click it in a macro. The button's
name is the same as the sequence (so be sure to choose a unique name). For the
example above, the /click macro would be:
/click WarlockStarter
Alternatively, you can set a key binding to the button with a one-time command
like:
/run SetBindingClick("CTRL-5", "WarlockStarter") SaveBindings(GetCurrentBindingSet())
The first time you click the button, it will run the first command in the
sequence. Each subsequent click will advance to the next one until it reaches
the end, in which case it will reset to the beginning. Like the /castsequence
command, the sequence will also reset if you die.
The reset entry is optional, but every sequence must have a list of macros. Each
item in the list can be an entire macro of unlimited size (meaning this addon
can also be used for extended macros). Use Lua's long string syntax to make
editing easier (be sure to align it with the left column or they will not be
seen as slash commands):
MageSequence = {
[[
/say Hello
/wave
]],
[[
/use Talisman of Ephemeral Power
/cast Arcane Power
/cast Presence of Mind
/cast Pyroblast
]]
}
Alternatively, you can use one-line strings with \n to separate the lines.
The reset entry can contain any combination of the following items:
alt - boolean
Reset the sequence when you run it while holding alt.
ctrl - boolean
Reset the sequence when you run it while holding ctrl.
shift - boolean
Reset the sequence when you run it while holding shift.
combat - boolean
Reset the sequence when you enter or leave combat.
seconds - number
If specified, the sequence will reset after the given amount of time. If the
sequence is advanced before the time is up, the timer will be restarted. A
time of 0 is the same as not specifying a time.
cycle - number
Instead of returning to the beginning when you click past the end, you can use
cycle to repeat some number of macros at the end of the sequence. For example,
if you have 6 macros and a cycle of 3, it will use them in the order 1, 2, 3,
4, 5, 6, 4, 5, 6, 4... Any other reset condition (including the implied death
reset) will return the sequence to 1.