Autosave, Autoload with script only?

What's up, so I just want to create an event where I can autosave when I touch an specific event (without entering the Menu/Save window, because it'll be disabled), like a checkpoint.

Same with autoload, at the beginning of the game you pick one of the options, then it loads that file and every autosave will be saved in that file only.

I found this script, is this the right one?:

$gameSystem.onBeforeSave();
DataManager.saveGame(id);
SceneManager.goto(Scene_Map);

What should I replace here?, let's say I want to save in slot 0.

Thanks, I'll post the results!

AP
For a simple autosave, you can run this as a script in an Event Command.

This is what I use for an auto-save, replace the "1" with whatever save slot you would like to use. There is no save slot 0, it starts counting at 1 for normal saves (-1 is the config data, 0 is the global data).
Code:
$gameSystem.onBeforeSave();
if(DataManager.saveGame(1)) {
   StorageManager.cleanBackup(1);
}
Pretty cool, thanks!

What about Loading now?
For auto-load you can run this as a script in an Event Command:

Code:
if(DataManager.loadGame(1)) {
   SoundManager.playLoad();
   this.fadeOutAll();
   $gamePlayer.reserveTransfer($gameMap.mapId(), $gamePlayer.x, $gamePlayer.y);
   $gamePlayer.requestMapReload();
   SceneManager.goto(Scene_Map);
   $gameSystem.onAfterLoad();
}
Thanks!, I found this one working for me though:

$gameSystem.onAfterLoad();

DataManager.loadGame(1);

StorageManager.cleanBackup(1);

$gamePlayer.reserveTransfer($gameMap.mapId(), $gamePlayer.x, $gamePlayer.y);

$gamePlayer.requestMapReload();
That's fine, if you notice, all the commands you listed are also listed in my version. Except for cleanBackup, which is unnecessary when loading because backups aren't created when loading (backups are created when saving).

Original thread: https://forums.rpgmakerweb.com/threads/autosave-autoload-with-script-only.91803/