@dc42 is there a way to do conditional logic in macros? Something like this sudocode:
resume.g
// resume method after filament runout
// maintain sub state for what action to perform next on same macro call
int globalSubState;
// initial state after runout detected
if (state == "paused" && globalSubState < 1 && e0_temp > 210)
{
// execute whatever macro sets tool to active temperature
execcmd "G1 E-100 F1800"; // retract all filament left from runout
globalSubState = 1; // set flag for next execution of macro
}
// remaining filament has been removed and new filament has been hand loaded
// go to just above where the last print position was and extrude 10mm to prime, but do not start printing yet
else if (globalSubState == 1)
{
execcmd "G1 R1 X0 Y0 Z5 F6000 ; go to 5mm above position of the last print move";
execcmd "G1 R1 X0 Y0 ; go back to the last print move";
execcmd "M83 ; relative extruder moves";
execcmd "G1 E10 F3600 ; extrude 10mm of filament";
globalSubState = 2; // set flag for next execution of macro
}
// resume print
else
{
state == "printing"; // unpause the print and resume printing
continueprint;
}
Or is there another way to do this with multiple macros that you can call, but all off the same trigger? I doubt it, but it doesn't hurt to ask i hope lol