Timing based loop backs and Macro Breaks

so here i am right, looking for something that breaks my macro into (X) smaller macros allowing me to run through the first segment then decide if i want to proceed… well ive nailed it for the most part, not sure if it throws errors ( it doesnt as of V1.1) but the loop backs seem to function appropriately and allows for the macro to be mashed hard with very few consequences due to the checks… Probably not the prettiest or most efficient, i already know that i could clump the debug timer checks into macros and do simple button presses to consolidate the code but it seems to function.

I used paladin for my example because Holy Power seems to be a limitation within the macro system itself so i wanted a loop back where if i delayed a keypress by a few milliseconds i could loopback into a judgement/crusader strike/crusader strike then do a time sensetive AOE with divine storm or a large follow up with templars verdict.
Seems like a good solution to the problem at hand.

Edit* (just using this for personal notes and scribbles )

1.0 Starter

1.1 Consolidated variables, fine tuned timers for rotations

1.21 Removed the Divine storm from the macro for V1.21 , decided it needs to stay on the action bar as a holy power dump incase the loopback catches before it reaches Templar verdict, moved Blade of justice to before the Timer check for the Crusaders strike Loopback, generates better holy power. Also added an additional Blade of Justice to AFTER the timer Sync in order to attempt to keep it on 100% Cool down.



Sequences['PyroOP---V1.1'] = {
specID = 70,
author = "pyroim",
helpTxt = "RetHolyPowerLoopback– 1131132",

TimerFunction = [[

MPresetBase = debugprofilestop(); - return the time in milliseconds since the last call to debugprofile//start()//Stop()
MPresetWoA = debugprofilestop(); -returns the step 3000 MS diff
MPresetDS = debugprofilestop(); --- returns the 1000ms Diff for Wake Of Ashes to Decide Divine storm or nah
MPresetCheckCheck = debugprofilestop(); ---Post macro check, has it been 10 seconds since Step 1? If so reset anyhow.

MPresetWoA - MPresetDS = TV --- Wake of Ashes to Templars verdict timing scale 1000ms

MPresetBase - MPresetWoA = JCS ---- LoopBack for Crusaders Strike, Includes MPresetBase=nil (via hard reset)  4000MS scale 

MPresetCheckCheck - MPresetBase = LongCheck --- checks for inactivity for 10seconds ( IE running around from boss mechanics, CCed ect, ect

]],

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

 
PreMacro = [[
/targetenemy [noharm][dead]
]],

"/run MPresetBase = debugprofilestop(); MPresetWoA = 0 MPresetDS = 0 ", ---S1
"/cast Judgment",---S2
"/cast Crusader Strike",----S3
"/run MPresetWoA = debugprofilestop(); if  JCS <= -4000 then step = 1 MPresetBase = 0 ",
"/cast !Wake of Ashes",----S5
"/run MPresetDS = debugprofilestop(); if TV <= -2200 then step = 8 ",
"/cast Templar's Verdict",---S7
"/cast Blade Of Justice",------S8
"/cast Divine Storm",---s9

PostMacro=[[
/cast [combat] Avenging Wrath
/run MPresetCheckCheck = debugprofilestop(); if LongCheck <= -10000 then step = 1 MPresetBase = 0 else MPresetCheckCheck = 0 end;
]]
}