Time-in-raid Tracker 1.1.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.

Finally! View the time you've spent in raid!

This mod enables you to track the amount of time you've spent in raid. There are two ways you can view the time you have spent in raid:

- check the file user/mods/plebeianrat-timeinraidtracker-1.1.0/{profile name}-time-tracker.txt

- check in the profile stats section of the EFT UI (note: this only visually updates after game client restart, so it will likely only be accurate when you first boot up the game, not after every raid)


Thanks to lopas123 for help getting the UI section working! As well as fixing a bug regarding multiple profiles


note: this mod will not track your time if you alt+f4 or crash, it only saves data when you end a raid by dying, extracting, or going MIA


This mod should be compatible with older versions of AKI.


Important: delete old versions of the mod when updating to a new one. You may keep your stats when upgrading from version 1.0.0 by copying the contents of user/mods/plebeianrat-TimeInRaidTracker-1.0.0/time-tracker.txt to user/mods/plebeianrat-TimeInRaidTracker-1.1.0/{profile name}-time-tracker.txt (note that profile name is case sensitive)



To install, just drop the contents of the zip into SPT/user/mods

  • this is good for the live game. so every (i have 20000 quintillion hours in raid) it become i have 200 hours in raid and every others in menu and loading screen XD

    Heart 1
  • Believe with 3.6.1 the game now tracks the time in raid on the UI finally. But it seems to me quite broken (sometimes barely registers time, spent 30 min in PMC raid, but the profile thinks I only spent 2 minutes), this is where think your mod can in a way fix it. (unless somehow this mod breaks the functionality and the time tracking becomes incorrect, which I really doubt).


    Found that by using this we can always replace the profile time with yours, which is more accurate. After it logs/ writes the changes to txt file (and we see in console that it was successful) would then add the following code:

    Code
    var raidTimeSeconds = Math.floor(totalTimePlayedInMilliseconds / 1000);
    profile.Stats.TotalInGameTime = raidTimeSeconds;
    Thumbs Up 1
    • where do you put this code?

    • Thanks for the suggestion! I implemented it and added a new release. there is a bug where using this method, it only refreshes the UI after client restart, so it isn't perfect but it does basically work.


      also FYI @lopas123 , in JS/TS, you generally want to use let or const for variables rather than var as vars get hoisted to the top of the file, meaning they break scope and become global variables basically.


      @Colkillervin the code is in this repo here: https://github.com/ezra-sg/SPT-TimeInRaidTracker specifically, the changes were added in src/mod.ts at line 106

  • Can't you ask the maker of the radar mod how he solved it so that it appears on the screen? Perhaps with this mod solution, this could also be solved so that the information can be placed on the screen.

  • Great mod, even works on 3.5.8 with no changes, hopefully you will be able to get the UI part working in the future.


    It appears the mod tracks the time for all accounts combined. So if you have more than one account all of their time will be added up. Checked through your code and can see that if we wanted to do it per account can just edit mod.js file (if you ran the mod before) and add the following to ....registerStaticRouter -> Action (anywhere between action and filePath).


    Code
    const profile = container.resolve("ProfileHelper").getPmcProfile(sessionId);


    then change

    Code
    const filePath = path.join(process.cwd(), "user", "mods", "plebeianrat-TimeInRaidTracker-1.0.0", "time-tracker.txt");

    with the following:

    Code
    const filePath = path.join(process.cwd(), "user", "mods", "plebeianrat-TimeInRaidTracker-1.0.0", `${sessionId}-${profileName}-time-tracker.txt`);
    • ah excellent point, thank you. I will try this out

    • i appreciate the help, great catch. i have updated the code with your changes (minus the sessionID in the file name)

      Heart 1