GnomeSequencer - New Step Function (customized rotation)

Concept: People have requested the ability to customize the sequence of macros. This step function performs to that specification.
Benefits: 1) Reduce redundant macro entries; 2) enhanced granularity
Constraint: The restricted execution environment does not permit the creation or use of arrays.

Sequences["GnomeExample3"] = { 
	StepFunction = [[
		stepa = "12213142111"

		limit = string.len(stepa) or 1
		if stepc == nil then
			stepc = 1
		end
		if stepc >= limit then
			stepc = 1
		else
			stepc = stepc + 1
		end
		step = tonumber(strsub (stepa, stepc, stepc))
	]],

	-- Macro 1
	[[
/run print("Executing macro 1!")
/cast SpellName1
	]],
	
	-- Macro 2
	[[
/run print("Executing macro 2!")
/cast SpellName2
	]],
	
	-- Macro 3
	[[
/run print("Executing macro 3!")
/cast SpellName 3
	]],

	-- Macro 4
	[[
/run print("Executing macro 4!")
/cast SpellName4
	]],
}
stepa - string containing steps in the sequence to be executed "12213142111" - is the actual sequence to be executed limit - is the rotation length or the total number of steps in the sequence (automatically calculated from stepa -- no user editing required) stepc - is the step counter (used to dereference the step in the string)

CAUTION: Results will be unpredictable if you enter any characters NOT 1 thru 9

Note on ‘SpellName*’: I believe it is intuitive; however, I will be explicit – SpellName* is not a variable. YOU must actually replace the word (e.g. SpellName1, SpellName2, etc) with YOUR actual spell or talent.

Note on ‘print’ commands: You may delete the lines beginning /run print OR if you choose you may edit what is printed by changing the “text” – your mileage may vary.

When I then bind this to a key and press it repeatedly it produces:

[QUOTE]Executing macro 1!
Executing macro 2!
Executing macro 2!
Executing macro 1!
Executing macro 3!
Executing macro 1!
Executing macro 4!
Executing macro 2!
Executing macro 1!
Executing macro 1!
Executing macro 1!

and then it repeats
[/QUOTE]

(I previously posted this at WoWInterface in the Gnome Sequencer comments)

After some feedback from semlar, I recoded it thusly –

Sequences["GnomeExample3"] = {
	StepFunction = [[
	 order = newtable(1, 2, 2, 1, 3, 1, 4, 2, 1, 1, 1)
	 
	 newstep = (newstep and (newstep % #order + 1)) or 2
	 step = order[newstep]
	]],

	PreMacro = [[
	]],
	
	PostMacro = [[
	]],

	-- Macro 1
	[[
/run print("Executing macro 1!")
/cast SpellName1
	]],
	
	-- Macro 2
	[[
/run print("Executing macro 2!")
/cast SpellName2
	]],
	
	-- Macro 3
	[[
/run print("Executing macro 3!")
/cast SpellName 3
	]],

	-- Macro 4
	[[
/run print("Executing macro 4!")
/cast SpellName4
	]],
}

Both methods work and achieve the same results. This StepFunction method is more concise and elegant; however, what it gains is lost to complexity. That said, if profiled, I suspect it may also execute with less overhead. So, for boxers, it may mean an improvement in performance when scaled up to 5x+ instances each spamming one-button macro sequences.

You did Awesome, thx man!!
I made a gladiator macro with this and it runs even better than the pre-WOD macros did. I’m very impressed.

Hey starcub,

It looks like you have put a tremendous amount of work in here so a big thank you from all of us, unfortunately it might as well be written in Chinese for me :smiley: , if you or anyone who knows how to and has time would it be possible to do an enhancement shaman single target macro, not including
fire ele, elemental mastery, ascendance, or lightning bolt, but it has to include fire nova .

Any help would be brilliant and thanks in advance

Hi! I am trying to figure out the use of /castsequence with the step function. Could you please confirm if the following is true:

CODE

StepFunction = [[
    limit = limit or 1
    if step == limit then
        limit = limit % #macros + 1
        step = 1
    else
        step = step % #macros + 1
    end
]],

[[--macro 1
/castsequence spell1, spell2
]],
[[
--macro2
/castsequence spell3, spell4
]],
[[
--macro3
/cast spell 5
]],

My “expected” result - please verify if this is correct:

(macro 1)spell1

(macro 1)spell2
(macro 2)spell3

(macro 1)spell1
(macro 2)spell4
(macro 3)spell5

and then repeat?

I am trying to determine what happens during the cast sequence - does GnomeSequencer step through the /castsequence BEFORE moving on to the next macro or not?

Thanks! Once I get this sorted I will post some of the macros I have been using, but I need to make sure of this issue first.

Nice in theory, but not practical at all when combined with autohotkey.

macro keeps spamming chat with executing macro. how do i fix this? i noticed you said you posted in the comments but idk where the comment section is.

how do i make it stop spamming chat with executing macro in say?

This is a great tool. I’m looking to learn as much as I can on how to create the best optimized macros that I can.

I want to use the StepFunction as I see great value in it. What I’m missing is how to reset a series based on change of target?

In a castsequence, I can put a reset=target to begin the sequence again. Is there a way to do that within GnomeSequencer?

Thanks!