This is an old revision of the document!
You can see where to put these scripts within Cura on the Starting & Ending G-code Scripts Location page.
G28 ; home all axes ; The following lines can be eliminated if using a skirt ; The lines below are to prep the nozzle before a print begins G1 Z0.2 F1200 ; raise nozzle 0.2mm G92 E0 ; reset extrusion distance G1 Y10 ; move Y-Axis (bed) 10mm to prep for purge G1 X100 E12 F600 ; move X-carriage 100mm while purging 12mm of filament G92 E0 ; reset extrusion distance
M104 S0 ; turn off hotend/extruder heater M140 S0 ; turn off bed heater G91 ; Switch to use Relative Coordinates G1 E-2 F300 ; retract the filament a bit before lifting the nozzle to release some of the pressure G1 Z1 ; raise Z 1mm from current position G1 E-2 F300 ; retract filament even more G90 ; Switch back to using Absolute Coordinates G1 X20 ; move X axis close to tower but hopefully far enough to keep the fan from rattling G1 Y115 ; move bed forward for easier part removal M84 ; disable motors G4 S600 ; keep fan running for 600 seconds to cool hotend and allow the fan to be turned off M107 ; turn off fan. Some say M107 doesn't work for them but if the hotend is cool enough it should work ;M106 S1 ; turn off fan. Remove the semicolon in front of M106 if M107 doesn't work for you