Lua's Auto Profile Backup (Updated) 1.5.0

Please do not ask when mod authors will update their mods to 3.9.X
Bothering mod authors will lead to warnings and repeat offenses will lead to eventual bans.

No more worries to backup your profile. A minor update to Lua's mod so all options work.

Auto Profile Backup

Backup your profile automatically

mod is disabled by default, check out the config file

  • Auto Profile Backup when (Configurable)
    • Game Start
    • Raid Start
    • Raid End
    • ...maybe more
  • Prevent profile's filename error by auto rename
    • You don't have to rename the backup file
      select backup file then drop into /user/profiles folder
  • Maximum Backup Per Profile (Configurable)
  • Auto-Backup path: %SPT%/user/profiles/Autobackup/
  • Backup file format: %Event%-%ISO Timeformat%.json
    (Example: onRaidStart-2022-08-30T161622490Z.json)


Installation

  1. Extract zip and place Lua-AutoProfileBackup folder into %SPT%/user/mods folder




How To Use

  1. Drag and Drop also edit config.json
  2. Restore backup when you need to rollback
  • Version 1.5.0

    Updated for SPT 3.9+ by Solethia (Thanks!)


    Install to your base spt install directory

  • Version 1.4.0

    Updated for use in spt 3.8.0

  • Version 1.3.0

    Updated for SPT 3.7.4

    • Make sure to enable the backup loader in the config/config.jsonc file. Just a text editor and set the enabled parameter to true.
  • Version 1.2.0

    1. Added fix for raid start (it was using an outdated routing point). Other save points were working fine.


    Thanks Drakia XYZ for the report.

  • Version 1.0.0

  • Not working on 3.9.8

    • It works on my end. Maybe you have it disabled? it's disabled by default

      Thumbs Up 1
  • not working 3.9.6

  • This does not work out of the box when running it in a Linux docker container. based on the error message, it cannot determine where the profiles directory is

    After some quick tinkering, the crux of it seems to be on mod.ts Line 165 where it tries to get it from the %SPT% variable, which I assume does not exist here. If change that line and hard-code the path to my profiles directory, making it this.profilePath = `/app/user/profiles`;, it works just file. I'm not sure where %SPT% would have been set so I'm not sure where to look at the moment. An easy way to address this could be to just have a path override option in the config file (so it defaults to use the %SPT% prefix but will take whatever you specify, if you specify something). If you're amenable to that, I can try to put together a PR.

    • i'll consider it for the next update. thats simple enough

  • Oh, might be useful! I won't accidentally delete my level 52 permanently

  • now make it

    (UPDATED-UPDATED)

    :D

    Thumbs Up 1
  • for those that also want to create a backup when the game is closed:


    add to config:

    "OnLogout": true


    add to mod.ts:

    • Не работает, все сделал как ты написал. ;(



    • Sorry, I forgot to include the closing bracket on the if block. I edited the original comment if you want to copy it again, or you can just add the bracket yourself.


      5449140e6aa309129d719812afdad027.png


      e3c8f95ffc3f9b68ad0827833f658b45.png

  • Not sure if intentional but the config file is named config.jsonc and doesn't work without editing the file extension.

    • wait wtf why does it work when its .jsonc?? oh well, I was wrong, my bad.

      Happy 1
    • jsonc is json with comments

  • I wanted to try this mod out, but I'm getting an ENOENT error:

    Code
    Error: ENOENT: no such file or directory, copyfile 'undefined/ba9c76fd0503c37cfab6ac04.json' -> 'undefined/AutoBackup/undefined/ba9c76fd0503c37cfab6ac04/onGameStart-2024-01-28T114449849Z.json'

    The full traceback is pointing to lines 56:34 and 212:18 in the mod.ts file

  • And it works with 3.7.1 as well! <3

  • Still works well with 3.7.0! \o/

  • im not sure i understand how this works.. so if i need to rollback and copy over the backup, how come i dont need to rename it? the filename is completely different?


    edit: alright i undersrtand now after trying it out lol, nvm.

    Happy 1
  • Hey Props. Just a heads up, trying to load a profile with your updated version of this mod throws these errors. In this test no other mods were installed.


    TypeError: Cannot read properties of undefined (reading 'exists')

    TypeError: Cannot read properties of undefined (reading 'exists')

    at Mod.onEvent (C:\SP Tarkov\SPT-AKI-3.5.5 BACKUP\user\mods\AutoProfileBackup-1.1.0\src\mod.js:78:23)

    at Object.action (C:\SP Tarkov\SPT-AKI-3.5.5 BACKUP\user\mods\AutoProfileBackup-1.1.0\src\mod.js:22:30)

    at StaticRouterMod.handleStatic (C:\snapshot\project\obj\di\Router.js)

    at HttpRouter.handleRoute (C:\snapshot\project\obj\routers\HttpRouter.js)

    at HttpRouter.getResponse (C:\snapshot\project\obj\routers\HttpRouter.js)

    at AkiHttpListener.getResponse (C:\snapshot\project\obj\servers\http\AkiHttpListener.js)

    at IncomingMessage.<anonymous> (C:\snapshot\project\obj\servers\http\AkiHttpListener.js)

    at IncomingMessage.emit (node:events:527:28)

    at IncomingMessage.Readable.read (node:internal/streams/readable:527:10)

    at flow (node:internal/streams/readable:1011:34)

    TypeError: Cannot read properties of undefined (reading 'exists')

    TypeError: Cannot read properties of undefined (reading 'exists')

    at Mod.onEvent (C:\SP Tarkov\SPT-AKI-3.5.5 BACKUP\user\mods\AutoProfileBackup-1.1.0\src\mod.js:78:23)

    at Object.action (C:\SP Tarkov\SPT-AKI-3.5.5 BACKUP\user\mods\AutoProfileBackup-1.1.0\src\mod.js:22:30)

    at StaticRouterMod.handleStatic (C:\snapshot\project\obj\di\Router.js)

    at HttpRouter.handleRoute (C:\snapshot\project\obj\routers\HttpRouter.js)

    at HttpRouter.getResponse (C:\snapshot\project\obj\routers\HttpRouter.js)

    at AkiHttpListener.getResponse (C:\snapshot\project\obj\servers\http\AkiHttpListener.js)

    at IncomingMessage.<anonymous> (C:\snapshot\project\obj\servers\http\AkiHttpListener.js)

    at IncomingMessage.emit (node:events:527:28)

    at IncomingMessage.Readable.read (node:internal/streams/readable:527:10)

    at flow (node:internal/streams/readable:1011:34)

    • Looks like this was happening because the mod was disabled in the config. Enabled is set to false by default in your download. Seems to be working now that I set that to true :)

      Happy 1 Thumbs Up 1