Confused about PreMacro and PostMacro

Hello! I already read a lot of topics about how macro lines are executed but I’m still confused. Lets take a look at this scenario:

Keypress is blank
Keyrelease is blank

I have 5 lines in PreMacro
3 lines in Sequence
4 lines in PostMacro

Loop limit is set to 1

For each press, the macro will:
all 5 lines from premacro + line 1 from sequence + all 4 lines from postmacro
all 5 lines from premacro + line 2 from sequence + all 4 lines from postmacro
all 5 lines from premacro + line 3 from sequence + all 4 lines from postmacro

thats it? which line it will choose from that bunch of cast lines? the first one that its able to cast?

No.

Keypress and KeyRelease are prepended and postpended to each line so that each click create a stack of commands that are sent to WoW. From your post you are looking for these two options not PreMacro and PostMacro.

PreMacro and PostMacro are about macro execution and are controlled by the loop limit.

The way it works when you click you start first line of PreMacro and work through it line by line. When you finish the PreMacro you move onto the sequence itself and work through it based on the step function selected.

When you hit the end of the sequence GSE looks at the loop limit. If there is a loop limit of say 2 it will repeat the sequence part 2 times then it will go to post macro work through it line by line until the end and go back to PreMacro.

If there is a loop limit of 1 it will only do the Sequence part once in which case why bother with a PreMacro or PostMacro. You may as well just have the one sequence.

If there is a PreMacro and no loop limit it will execute the PreMacro once only at the start of combat and loop the sequence part indefinitely. If there is a PostMacro it will never get there.

Wow now I got it! Thank you so much!

so theoretically it would be better not to write anything on premacro and postmacro? the sequence will be based only on the lines written in sequence?
you said that pre and post are put after the main sequence right? so the macro will work like this if I understand correctly:

line 1
line 2
line 3
premacro without loop limit set and postmacro?

No. Without loop limit, post macro is not executed and pre macro is executed only one time before the sequence, and then sequence will be executed till the combat ends. Then, after you leave combat and start another fight, again, pre macro is executed once and then sequences lines forever till combat ends. If you set loop limit, pre macro is executed first, then sequences for x times you set the loop, then post macro, going back to pre macro, sequences x times you set the loop, post macro, then repeat.

ok so then so?
without inner loop limit
premacro
line 1
line 2
line 3
and repeats for lines 1-2-3 to infinity?

with inner loop limit inserted
premacro
line 1
line 2
line 3
postmacro and repeats all the pre-post steps like this?

1 Like

Yes! Now you got it. Remember: without loop limit, it will repeat UNTIL you get out of combat. Then it will come back to pre macro.

With loop limit, it will repeat pre -> sequence lines -> post always.

ok so if I enter do account inner loop limit 2
will it do this?
premacro
line 1
line 2
line 3
postmacro
the macro as a priority will then give
premacro
line 2 for inner loop limit as priority
line 1
line 3
postmacro?

I didn’t understand what u mean. Do not complicate things. If there is a loop limit, it will go from pre macro to sequence lines to post macro always. If there isn’t a loop limit, it will execute pre macro one time, then sequence lines. It will only go back to pre macro when u get out of combat and start another fight.

If you were talking about how sequence lines are being executed, priority, random or sequencial, this doesn’t affect how pre macro and post macros work, this only affects the sequence line itself.

I mean if I put inner loop limit 2 will give priority to line 2 always as before right? after running pre macro

I want to make a clear practical example, I play hunter bm run a macro like this:

priority list/sequenzial I don’t know what is better

premacro
/cast [nochanneling] barbed shot

princiaple sequence
/cast [nochanneling] bestial wrath
/cast [nochanneling] barbed shot
/castsequence [nochanneling] kill command, cobra shot, cobra shot
/cast [nochanneling] kill shot

post macro
/cast [nochanneling] kill command

In this way, according to what has been said so far, the macro runs like this
premacro at the beginning of the fight
and then run the sequence line1-2-3-4 post macro always, if target change starts again with premacro and same thing right?

Translated with www.DeepL.com/Translator (free version)

Assuming a loop limit of 2

/cast [nochanneling] barbed shot (from Premacro)

/cast [nochanneling] bestial wrath
/cast [nochanneling] barbed shot
/castsequence [nochanneling] kill command, cobra shot, cobra shot
/cast [nochanneling] kill shot (first pass as loop limit count is currently 1)

/cast [nochanneling] bestial wrath
/cast [nochanneling] barbed shot
/castsequence [nochanneling] kill command, cobra shot, cobra shot
/cast [nochanneling] kill shot (second pass - loop limit count is now 2 and = loop limit

/cast [nochanneling] kill command (from post macro and now back to PreMacro)

In this way, according to what has been said so far, the macro runs like this
premacro at the beginning of the fight
and then run the sequence line1-2-3-4 post macro always, if target change starts again with premacro and same thing right?

NOW to reset when you change targets you need to set a keybind in GSE’s options and use that keybind when you change targets