MacroParser Progress

This input macro…

/petautocastoff [group,@focus,help,nodead][group:raid]Growl
/cast [nogroup:raid,group,@focus,help,nodead][@pet,exists,nodead]Misdirection
/click ElvUI_Bar5Button11
/click ElvUI_Bar5Button12

…comes out in my (very rough) data like this…

{
	"if . . .", -- [1]
	"    [group,@focus,help,nodead]", -- [2]
	"    [group:raid]", -- [3]
	"then . . .", -- [4]
	"    /petautocastoff Growl", -- [5]
	"if . . .", -- [6]
	"    [nogroup:raid,group,@focus,help,nodead]", -- [7]
	"    [@pet,exists,nodead]", -- [8]
	"then . . .", -- [9]
	"    /cast Misdirection", -- [10]
	"    /click ElvUI_Bar5Button11", -- [11]
	"    /click ElvUI_Bar5Button12", -- [12]
}

This one…

#showtooltip
/cast [combat][mod:shift]Disengage;[mod:alt]Traveler's Tundra Mammoth;[mod]Vicious War Spider;Expedition Bloodswarmer

…comes out like this…

{
	"    #showtooltip ", -- [1]
	"if . . .", -- [2]
	"    [combat]", -- [3]
	"    [mod:shift]", -- [4]
	"then . . .", -- [5]
	"    /cast Disengage", -- [6]
	"if . . .", -- [7]
	"    [mod:alt]", -- [8]
	"then . . .", -- [9]
	"    /cast Traveler's Tundra Mammoth", -- [10]
	"if . . .", -- [11]
	"    [mod]", -- [12]
	"then . . .", -- [13]
	"    /cast Vicious War Spider", -- [14]
	"    /cast Expedition Bloodswarmer", -- [15]
}, -- [18]

Clearly there is more work to do. I especially need to work out a way to gracefully deal with indicating unconditional actions in a way that differentiates them from the “ELSE” part of an if/then/else fall-through.

This is NOT REMOTELY what the output will look like when it’s finished, but it does show good progress.

I did discover that the explain process is fast enough that I can do the entire library of macros in under 1/20th of a second, so I’m just going to run them all every time there’s an update to macros rather than worrying about picking them up one at a time.

Right now I’m dumping the display into a Saved Variables file. Getting it to show up nicely on screen is a different process.

But, tabling up the explain is a good way to start that.

Thanks for all the help, both past and (I’m sure) in advance for the future, guys.

1 Like

Not sure if you saw this but the 2 /click statements are in the wrong place of the output. In the “very rough data” output you have them indented implying that they are part of the same condition the controls misdirection but they are independent executed unconditionally in the original macro

This this seems incorrect because it implies conditional execution of the /clicks

"if . . .", -- [6]
"    [nogroup:raid,group,@focus,help,nodead]", -- [7]
"    [@pet,exists,nodead]", -- [8]
"then . . .", -- [9]
"    /cast Misdirection", -- [10]
"    /click ElvUI_Bar5Button11", -- [11] indented implying conditional execution
"    /click ElvUI_Bar5Button12", -- [12] indented implying conditional execution

And it seems like this should be the correct output

"if . . .", -- [6]
"    [nogroup:raid,group,@focus,help,nodead]", -- [7]
"    [@pet,exists,nodead]", -- [8]
"then . . .", -- [9]
"    /cast Misdirection", -- [10]
"/click ElvUI_Bar5Button11", -- [11] not indented
"/click ElvUI_Bar5Button12", -- [12] not indented

Also, if you could satisfy my curiosity: what is the final addon supposed to accomplish?

And completely unrelated comment: I find it disturbing that you’re now undead and not the kindly looking moose/tauren dude.

You are absolutely correct on that and that is what I meant when I said I need to deal with unconditional and “else” statements which I have. I’ll post new output for those two macros at the end.

The only macro “explainer” I’ve found is an obsolete one that is web-based.

This one will be in-game and will incorporate spell/talent knowledge and item possession into it (in the final version).

I’ve also built into it a rudimentary “shortener” as well including using the most character-efficient command names and full characterization of command types into four categories (system-defined commands, emotes, display commands, addon commands). I haven’t figured out how to determine which command comes from which addon, but the way this is set up, on first run and on demand later you can reset it so that it picks up and correctly categorizes things.

To be honest, though, the purpose of this is to keep me occupied and keep my depression and anxiety “under the trap door” (the metaphor I have with my therapist is that my depression and anxiety are still there - they’re just trapped under a door that I keep weighted down with distracting activities).

New output (same two macros):

{
	"if", -- [1]
	"    [group,@focus,help,nodead]", -- [2]
	" or [group:raid]", -- [3]
	"    /petautocastoff Growl", -- [4]
	"if", -- [5]
	"    [nogroup:raid,group,@focus,help,nodead]", -- [6]
	" or [@pet,exists,nodead]", -- [7]
	"    /cast Misdirection", -- [8]
	"/click ElvUI_Bar5Button11", -- [9]
	"/click ElvUI_Bar5Button12", -- [10]
}
{
	"#showtooltip ", -- [1]
	"if", -- [2]
	"    [combat]", -- [3]
	" or [mod:shift]", -- [4]
	"    /cast Disengage", -- [5]
	"elseif", -- [6]
	"    [mod:alt]", -- [7]
	"    /cast Traveler's Tundra Mammoth", -- [8]
	"elseif", -- [9]
	"    [mod]", -- [10]
	"    /cast Vicious War Spider", -- [11]
	"else", -- [12]
	"    /cast Expedition Bloodswarmer", -- [13]
}

This is STILL not remotely the final output format. Right now I’m just building a lexical table that I can build that from and there are conditions (specially) that don’t exactly follow the same pattern as everything else that I simply haven’t accounted for in the code.

It’s a work-in-progress that I hope, when it’s finished, will be of some actual use to the community.

Ehiztari-EarthenRing hasn’t existed for some time now. When I started back up into Shadowlands, I deleted him and all of my original characters as well as the guild I ran on Earthen Ring. I was posting on him simply because he was known here as “me” but I ran into a few issues with folks who (justifiably) thought I was obfuscating my game identity so I decided with this project to officially swap to my Shadowlands main character - also named Ehiztari, but on Blood Furnace. He was originally a Pandaren (the “bouncy” thing is useful in a few of the rated battlegrounds) and Night Fae, but I swapped him over to Venthyr to pick up Flayed Shot and later swapped him to Undead to pick up the racials for PVP. I role-play him as only recently having become Undead and the transmog I have for him is deliberately designed to mimic Worgen, but a sort of feline version of them.

RIP moose Ehiztari.