[Solve]force save script

https://forums.rpgmakerweb.com/index.php?threads/auto-save-script-call-to-force-save.75236/
hi
I read this post for auto save script
and try that find some error
and the post is aroud year I don't know there will any one active
so I make a new thread
Code:
try {
        StorageManager.backup(savefileId);
        return this.saveGameWithoutRescue(savefileId);
    } catch (e) {
        console.error(e);
        try {
            StorageManager.remove(savefileId);
            StorageManager.restoreBackup(savefileId);
        } catch (e2) {
        }
        return false;
    }
So basically do that as a script call but instead of the parameter savefileId put the actual number of the slot you want to put the forced save file in.
Trihan say that
so I try to use it with common event
Capture.JPG Capture.JPG
and find this
I don't know what I do wrong
thank you
Return can only be used in function calls, not in scripts. So create a js file inside js/plugins, copy paste it there, turn it into a function and call that inside a script.

Or you can just use autosave plugins, there are a couple of them out there.
Or you can try this method:
Code:
var AutoSaveSlotNum = 30;

if (!$gameParty.inBattle()){

if (DataManager.lastAccessedSavefileId() !== 0){

$gameSystem.onBeforeSave();

DataManager.saveGame(AutoSaveSlotNum);

}

}
Clipboard01.jpg
thank you you two
Or you can try this method:
Code:
var AutoSaveSlotNum = 30;

if (!$gameParty.inBattle()){

if (DataManager.lastAccessedSavefileId() !== 0){

$gameSystem.onBeforeSave();

DataManager.saveGame(AutoSaveSlotNum);

}

}
Clipboard01.jpg
I try yours and got this
Capture.JPG
------
Poryg
I already find some out there
but all of it is fix slot
I want some that can specific slot
so I can let player make difference save play through
ps. no manual save in my game
hi I had find some that I want from this
thank you every one
https://steamcommunity.com/app/363890/discussions/0/451850849179124845/
Glad to hear it, but your error means you probably skipped one } when copying, at least I think so, because this works perfect in mine RMMV

Original thread: https://forums.rpgmakerweb.com/threads/solve-force-save-script.105788/