Good morning @phaedrux @dc42 @owend @oozebot
When I deleted the double quotes it didn't give me an error, but it generated a blank file, I realised it was because I was trying to run M916 but it didn't exist yet, so I solved it this way.
M911 S22 R23 P "M913 X0 Y0 Z0 E0 M28""0:/sys/runonce.g"" M98 P""run1.g"" M29"
in run1.g I typed M916 and this did work as expected
only that runonce.g is not deleted, something that is good for me because I thought that if I had two blackouts in a row without having recovered this would be deleted and would not work as I wanted, when I finish printing is not deleted either, only to restart again, this makes some errors appear, so I added to my final script and my cancel.g a M30 to delete it.
This was my solution and it works fine so far:
config.g I added:
M911 S22 R23 P "M913 X0 Y0 Z0 E0 M28""0:/sys/runonce.g"" M98 P""run1.g"" M29"
; Global Variables
global delete = 0
run1.g contains:
set global.delete = 1
M916
resurrect-prologue.g contains:
var temp = heat.heaters[1].active
M116 ; wait for temperatures
G28 XY ; house X and Y, hope Z hasn't moved
G10 P0 S0
M291 R "Recovery" P "Want to recover the part" S2 T0
G10 P0 S{var.temp}
M116 P0
final script I added: (resurrect.g if automatically deleted)
if global.delete = 1
M30 "/sys/runonce.g"
set global.delete = 0
cancel.g I added:
if global.delete = 1
M471 S"/sys/resurrect.g" T{"/sys/resurrect1.g"} D1 ; I rename it in case I want to use it later on.
M30 "/sys/runonce.g"
set global.delete = 0
I hope you find this solution useful and if you think of any improvement I will be happy to hear it.
Best regards and thanks for your support.