Thought I'd share my Prusa style autoload macro (firmware => 3.5.0) for others to use or improve. Please feel free to add your suggestions! This assumes you have a filament sensor.
EDIT: I've updated the load.g code to make it a little more smart.
daemon.g
; Monitor the Filament Sensor to see if it's loaded
if {sensors.filamentMonitors[0].status = "noFilament"}
M98 P"0:/macros/load.g"
load.g
; Filament AutoLoad Macro for RepRapFirmware
; While waiting for the user to load filament, check the filament sensor
while {sensors.filamentMonitors[0].status = "noFilament"}
M117 "Please load filament."
; Read filament sensor and if filment is present, continue the load process
if {sensors.filamentMonitors[0].status = "ok"}
; Ask user what type of filament is loaded
M291 S4 T0 P"Select Filament Type" R"Filament Type" K{"PLA","PETG","ABS","TPU","Nylon"}
; Set the temperature based on the filament type
if {input == 0}
G10 S200 ; Set temperature for PLA
elif {input == 1}
G10 S235 ; Set temperature for PETG
elif {input == 2}
G10 S240 ; Set temperature for ABS
elif {input == 3}
G10 S220 ; Set temperature for TPU
elif {input == 4}
G10 S250 ; Set temperature for Nylon
M116 ; Wait for the temperatures to be reached
M83 ; Extruder to relative mode
; Move E till filament is grabbed by gears
G1 E15 F120 ; Extrude 15mm of filament at a speed of 120mm/min
; Ask user if filament was grabbed by gears. If not, grab a little more filament
var loaded = false
while {var.loaded = false}
M291 S4 T0 P"Filament Loaded?" R"Filament Loaded?" K{"Continue","Try Again"}
if {input == 1} ; Try again
set var.loaded = false
G1 E15 F120 ; Extrude 15mm of filament at a speed of 120mm/min
continue
elif {input == 0} ; Continue
set var.loaded = true
break
if {var.loaded == true}
; Change the extruded amount depending on the size of your hotend setup.
G1 E80 F240 ; Extrude 80mm of filament at a speed of 240mm/min.
; Ask user if filament is extruding properly
var extruded = false
while {var.extruded = false}
M291 S4 T0 P"Filament Extruding?" R"Did filament come out?" K{"No","Yes"}
if {input == 0} ; No
set var.extruded = false
G1 E15 F240 ; Extrude 15mm more of filament at a speed of 240mm/min
continue
elif {input == 1} ; Yes
set var.extruded = true
break
; Set the extruder position to 0
G92 E0
M104 S0 ; set tool temp to 0