Super Cache Cleaner Tool Development [discontinued]

Discussion in 'Content Developer's Area' started by Reef, Jan 27, 2021.

  1. Reef

    Reef Well-Known Member

    Joined:
    Jul 27, 2018
    Messages:
    2,718
    Likes Received:
    1,772
    If you know what the clear cache batch file is then this is for you.

    It's basically the same thing only that it offers you 4 options when you run it...
    1. Delete .pak files only (commonly deleted after adding a repaint to rolling stock)
    2. Delete .bak files only (commonly deleted if you use the route editor a lot)
    3. Delete BOTH file types
    4. Delete nothing and EXIT

    Once completed it then auto closes so you don't have to interact with it after it's done (for me at least that usually means refocusing on the cmd window and then looking for that elusive "any key").

    It's as safe as the existing available batch cache scripts out there it just gives you a little more functionality and options.

    Anyway let me know if you want me to steal all your cloud nudes uh I mean if you want to try it out ahem..
     
    • Like Like x 3
  2. Reef

    Reef Well-Known Member

    Joined:
    Jul 27, 2018
    Messages:
    2,718
    Likes Received:
    1,772
    Nobody interested then? I was going to put it up on either UKTS or ATS once confirmed working ok for other people, guess it's just me that finds the cache batch file useful.
     
  3. Not many people around anymore that are familiar with DOS and BAT files.
     
  4. Reef

    Reef Well-Known Member

    Joined:
    Jul 27, 2018
    Messages:
    2,718
    Likes Received:
    1,772
    So it would seem, anyway no bother, the only reason I wrote my own is because I lost mine with the great data disaster of 2021 (it's now a historical event as far as I'm concerned at least), and as per usual I got carried away and embellished it.
    I've still achieved what I set out to do which is have a .bat cache cleaner in my assets folder again so all good. :)
     
  5. Reef

    Reef Well-Known Member

    Joined:
    Jul 27, 2018
    Messages:
    2,718
    Likes Received:
    1,772
    I've embellished this script even further now here it is in it's final state for anyone that's interested..

    Image4.jpg

    Image5.jpg

    Image6.jpg

    The "Could Not Find E:\Program Files (x86)\Steam\steamapps\common\RailWorks\Assets\*.___" are because all the files had already been deleted on a prior run so obviously it couldn't find them if there weren't any left to find.

    This script is available to anyone who wants it (just don't claim it as your own or re-share it, direct people here to me in this thread if they want it too) I will post it up (with instructions for those unfamiliar with Batch scripts) if there is enough interest in it.
     
    • Like Like x 1
  6. IsambardKingdomBrunel

    IsambardKingdomBrunel Well-Known Member

    Joined:
    Oct 6, 2017
    Messages:
    438
    Likes Received:
    796
  7. Reef

    Reef Well-Known Member

    Joined:
    Jul 27, 2018
    Messages:
    2,718
    Likes Received:
    1,772
    Sent you a DM :)
     
  8. Doomotron

    Doomotron Well-Known Member

    Joined:
    Oct 24, 2018
    Messages:
    2,822
    Likes Received:
    3,387
    Sorry to bump the thread, but could you send this to me please?
     
  9. Reef

    Reef Well-Known Member

    Joined:
    Jul 27, 2018
    Messages:
    2,718
    Likes Received:
    1,772
    Sent you a DM :)
     
  10. cscarpenter

    cscarpenter Well-Known Member

    Joined:
    Jun 15, 2020
    Messages:
    1,151
    Likes Received:
    3,381
    OMG bumped forum threads can actually be useful, I was not aware of this little gem.
    Could you please do me the honour?
    MTIA Cheers Reef. :cool::love:
     
  11. Reef

    Reef Well-Known Member

    Joined:
    Jul 27, 2018
    Messages:
    2,718
    Likes Received:
    1,772
    Sure np ;)

    Doomotron I sent you the "Lite" version by mistake it only deletes .pak & .bak files (options one thru three) if you want the full version that deletes the .cost .xml & .tgt also let me know, tbh I only use the lite one myself nowadays.

    cscarpenter I'll offer you the same option, would you prefer the "Lite" or the "Full" version
     
  12. ajpardy

    ajpardy Member

    Joined:
    Feb 7, 2021
    Messages:
    122
    Likes Received:
    4
    yes please
     
  13. Reef

    Reef Well-Known Member

    Joined:
    Jul 27, 2018
    Messages:
    2,718
    Likes Received:
    1,772
    Please state which version - v1 (Lite only removes .pac & .bak) or v2 (Full as screenshots above show)
     
  14. cscarpenter

    cscarpenter Well-Known Member

    Joined:
    Jun 15, 2020
    Messages:
    1,151
    Likes Received:
    3,381
    Both if you wouldn't mind
    Always good to have options open to play with.
    Many thanks
     
  15. Doomotron

    Doomotron Well-Known Member

    Joined:
    Oct 24, 2018
    Messages:
    2,822
    Likes Received:
    3,387
    Don't worry about it, but when you can could you please send me the full version?
     
  16. ajpardy

    ajpardy Member

    Joined:
    Feb 7, 2021
    Messages:
    122
    Likes Received:
    4
    both please.
     
  17. Reef

    Reef Well-Known Member

    Joined:
    Jul 27, 2018
    Messages:
    2,718
    Likes Received:
    1,772
    Just to be clear you wont need both, as v2 does all that v1 does + more, I'll send you all links to v2 now.
     
  18. Reef

    Reef Well-Known Member

    Joined:
    Jul 27, 2018
    Messages:
    2,718
    Likes Received:
    1,772
    New version (v3) available, thanks to a suggestion by ajpardy you can now delete the SDBCache.bin to reset your scenario lists if you're missing content you know you own.

    • Tidied up the exit strategies (this makes sense to me more than anyone else, don't worry about it)
    • Inserted warnings/reminders about having the SuperCacheCleaner.bat in the right place (In your Assets folder), you can't proceed without acknowledging that, I really don't want anyone messing their system up so yeah I think it's necessary, sorry.
    • Added 5th option to delete your SDBCache.bin (you will also get a confirmation prompt showing the path and file to be deleted, please check it's pointing to the right location before pressing Y and then Enter).
    As usual hit me up for a copy, same as before.
     
    • Like Like x 1
  19. Reef

    Reef Well-Known Member

    Joined:
    Jul 27, 2018
    Messages:
    2,718
    Likes Received:
    1,772
    Right v3's latest function of deleting the SDBCache.bin only worked locally on my system for some odd reason, there are probably big brained ways of sorting this out but I ain't got one so I came up with another solution instead.

    the revised v3 (I suppose I should've called it v4, oh well too late now) is the same exact script more or less as the other versions with two major differences.

    • Most Importantly the file is placed directly in your RailWorks folder now NOT the Assets folder as before (this was the only way I could get it to find and delete the SDBCache)
    • 2nd Most Importantly, it's no longer a .bat (batch file) it's now an .exe (compiled batch file) this is not to keep my code secret I don't give a fluff who looks at it and the source code will be available to anyone that wants it, I converted it to an .exe so I could add a snazzy desktop icon to it.. That's it.
    • Umm there was a third point but by the time I finished writing the second point I forgot what it was..
    As per if you want it hit me up via DM, I will eventually publicly post a link up for anyone and everyone but at the moment I want to keep track of who's got it so any (unlikely) issues don't run amok.
     
    • Like Like x 1
  20. Reef

    Reef Well-Known Member

    Joined:
    Jul 27, 2018
    Messages:
    2,718
    Likes Received:
    1,772
    Apparently I can't distribute my compiled scripts using the compiler I'm using right now, if it's not on my local system then it just throws an error message about being an unregistered version and closes.
    wIir4Gt_d.jpg

    looking into it.
     
  21. get-geeky

    get-geeky New Member

    Joined:
    Jul 15, 2020
    Messages:
    28
    Likes Received:
    20
    Can you fire a copy my way please? exe or bat version - cheers
     
  22. Reef

    Reef Well-Known Member

    Joined:
    Jul 27, 2018
    Messages:
    2,718
    Likes Received:
    1,772
    Sure thing, I'm at work the next couple of nights then I'm going to add a few more options based on recommendations fed back to me then I'll drop you a DM.
     
  23. Reef

    Reef Well-Known Member

    Joined:
    Jul 27, 2018
    Messages:
    2,718
    Likes Received:
    1,772
    .exe version distribution is solved btw, I'm using a different compiler now as I'm not paying $89 for a full licenced copy of the free version I used before just for 1 free converted batch file lol.
     
  24. KodiakJac

    KodiakJac Active Member

    Joined:
    Jul 30, 2022
    Messages:
    142
    Likes Received:
    78
    Hi Reef, When you've got your latest greatest ready, please send me the link to download it :)
     
  25. Reef

    Reef Well-Known Member

    Joined:
    Jul 27, 2018
    Messages:
    2,718
    Likes Received:
    1,772
    Will do bud, just going to add a couple more things now I know this new compiler is working and I'll drop you a link.
     
    • Like Like x 1
  26. Reef

    Reef Well-Known Member

    Joined:
    Jul 27, 2018
    Messages:
    2,718
    Likes Received:
    1,772
    V4.1 added more features and also streamlined the options..

    Here's a picture of the uncompiled batch just to show you the new menu..
    Image2.jpg
     
  27. KeithG

    KeithG Member

    Joined:
    Jan 18, 2023
    Messages:
    83
    Likes Received:
    68
    Hi Reef, Must have missed this thread. What you are doing sounds interesting. Any chance you can send me a copy , to try.
    Thanks Keith
     
  28. ajpardy

    ajpardy Member

    Joined:
    Feb 7, 2021
    Messages:
    122
    Likes Received:
    4
    great work ,could you add in .bak1.bak2 etc files and the 2 scenariobackup2023xxx. Also looks like the old option 3 has gone,could you add it back,don't always need full clean.Reef
     
    Last edited: Jun 1, 2023
  29. Reef

    Reef Well-Known Member

    Joined:
    Jul 27, 2018
    Messages:
    2,718
    Likes Received:
    1,772
    .bak1 2 3 whatever is easy enough to include, will do.

    Where is scenariobackup2023 and what creates it?

    Option 3 was superfluous, running the full cleaner has no negative effect and takes only a second or two longer to execute.
     
    Last edited: Jun 1, 2023
  30. ajpardy

    ajpardy Member

    Joined:
    Feb 7, 2021
    Messages:
    122
    Likes Received:
    4
    ok,np. i sent you screenshots of Locoswap backup files. there saved to scenario folder, so path would be :Steam\steamapps\common\RailWorks\Content\Routes , search and delete if there are any there if not close. Reef
     
  31. cscarpenter

    cscarpenter Well-Known Member

    Joined:
    Jun 15, 2020
    Messages:
    1,151
    Likes Received:
    3,381
    Hi Reef, happy to give your latest offering a go.
    Will feed back accordingly.
    Many thanks for taking the time to create and share this gem with us all. :cool:
     
  32. Reef

    Reef Well-Known Member

    Joined:
    Jul 27, 2018
    Messages:
    2,718
    Likes Received:
    1,772
    Will have a look later.
     
  33. Reef

    Reef Well-Known Member

    Joined:
    Jul 27, 2018
    Messages:
    2,718
    Likes Received:
    1,772
    Should have a release ready later, look out for my next update post coming later too listing the latest changes, there's been some more streamlining and nifty features added.
     
    • Like Like x 1
  34. Reef

    Reef Well-Known Member

    Joined:
    Jul 27, 2018
    Messages:
    2,718
    Likes Received:
    1,772
    Ok, Latest Version v4.1 is complete, here are the changes..

    SuperCacheCleaner now checks that it is installed into the correct location (your RailWorks folder) this is important because it cannot function from anywhere else.

    Should you happen to open it and it's not in the RailWorks folder then you will get this message displayed and it will close..
    Image1.jpg

    What it does..
    Once SuperCacheCleaner is happy it's in the correct location (RailWorks folder) you are greeted with an options menu with 7 (my favourite number) options..
    Image2.jpg

    Hopefully the above image describes everything fully for you..

    This is still in the Beta testing phase so there is no public download link at this stage, if you wish to grab a copy understanding that it is a Beta and is installed at your own risk and full understanding then send me a DM.

    This way I can keep a close contact feedback loop on the program.

    Please feel free to comment whether you wish to partake with the Beta testing or not.
     
  35. Reef

    Reef Well-Known Member

    Joined:
    Jul 27, 2018
    Messages:
    2,718
    Likes Received:
    1,772
    Nothing ever goes smoothly does it, Windows Attachment Manager is deleting the file that I uploaded when I try to download it lol

    Apparently most AV's flag BATtoEXE conversions as a virus, literally the only reason I wanted it as a .exe is because it can have an icon attached to it..

    Oh well, I'll let a few people try to download it and see if they get the same issue as me (it's absolutely not a virus btw) and if they do then I'll just have to release it as a boring old batch file..
     
  36. Reef

    Reef Well-Known Member

    Joined:
    Jul 27, 2018
    Messages:
    2,718
    Likes Received:
    1,772
    And now Google Drive is blocking it being downloaded..

    I've requested a review..

    Such fun..
     
  37. Reef

    Reef Well-Known Member

    Joined:
    Jul 27, 2018
    Messages:
    2,718
    Likes Received:
    1,772
    Right think I've figured out the problem, it didn't like one part of my code that checked that the .exe was in the right location, turns out that code isn't even needed anyway due to the fact if it's not in the correct location it will just return an error message saying "The system cannot find the file specified" so wont harm or delete any incorrect files (the original batch code this is based upon was potentially very harmful if the .bat was in the wrong location).

    So now there are no "Are you sure this is in the right folder" messages anymore either.

    Anyway Google Drive and my Windows Defender seem happy enough with it so we're good to go..

    Fingers crossed it's ok and works for you all too.

    Changelog:
    • Removed .exe location check code as this was throwing Google Drive and Windows Defender into a cold sweat crazed frenzy (turns out I didn't even need it anyway lol)
    • Corrected menu saying .bac files when they are in fact .bak files (it was deleting the correct files I just named them wrong in the options menu.... and the READ_ME too... Go Reef... Genius!) (thanks ajpardy for spotting that)
    • READ_ME.txt edited to correct typo's and deleted doom and gloom warnings about the .exe being in the wrong location, it doesn't matter if it is it just wont work and will return an error saying "The system cannot find the file specified" so if you want it to work make sure it'sa in the RailWorks folder, simples..

    Finally, sorry to all my
    Guinea pi.... I mean stalwart Beta testers for putting up with my unprofessional link spam and amateur coding and dev skills..

    If I haven't already hit you up with a new link DM me..
     
  38. Reef

    Reef Well-Known Member

    Joined:
    Jul 27, 2018
    Messages:
    2,718
    Likes Received:
    1,772
    V5.1 just released.

    • Fixed README missing the 6th option
    • Changed completion behaviour, you now have the option to return to the main menu (so you can clean other files) or exit

    Quick message to the guys that have had links off of me so far..

    Only one of you have got back to me with feedback so far and has reported that option 4 wasn't working, for me it's working on both my custom install path and my standard Steam directory path so I'd love to hear back if anyone else had an issue with this option.

    Don't worry if you haven't yet had a chance to test v5 yet just DM me for v5.1 instead
     
  39. Bekns

    Bekns Member

    Joined:
    Jan 20, 2019
    Messages:
    75
    Likes Received:
    37
    Hi Reef

    I have a similar batch file that Rosgar(UKTS User) made to which I have added some amendments myself to resemble pretty much what you are offering as well but I have always been nervous about adding xml files to it as I had thought there were occasions where TSC uses xml instead of bin (RouteProperties.xml being one of them)

    There is at least 1 instance (after a quick glance) of xml files being used instead of bin files for audio purposes in the GNTX Stevens Pass ES44DC, it uses an ES44 Engine Sound.xml file so I presume there are other assets that use them as well.

    I would be careful deleting them but I am happy to be proved wrong if there are others who have removed these files with no issues afterwards.

    upload_2023-6-5_9-9-10.png
     
  40. Reef

    Reef Well-Known Member

    Joined:
    Jul 27, 2018
    Messages:
    2,718
    Likes Received:
    1,772
    Interesting, thanks for that Bekns, tbh it was so long ago the full option was added I cannot even remember now where I originally sourced that info from (same for the .tgt and .cost files).

    It does not touch the RouteProperties.xml's as my script only looks in the Assets folder not the Content folder for the .xmls

    It might be worth erring on the side of caution though in the case of these sound files..


    I'll release an amendment forthwith, if it's proven harmless then It'll be easy enough to add the option back in..
     
    Last edited: Jun 5, 2023
  41. Reef

    Reef Well-Known Member

    Joined:
    Jul 27, 2018
    Messages:
    2,718
    Likes Received:
    1,772
    v.5.1.1

    • .xml deletion (from Assets folders) removed at least for now due to new information supplied by Bekns
    • README updated to reflect this change
     
  42. Reef

    Reef Well-Known Member

    Joined:
    Jul 27, 2018
    Messages:
    2,718
    Likes Received:
    1,772
    This is now on hold until either I can figure out or someone else can teach me (infant school entry level computer coding style) how to use REG QUERY and set up the variable and then get it all working so that it doesn't matter where the .exe is located it will still find the correct files..

    I've been battling with this since last Monday and I just can't figure it out and it's pickled my brain (the last remaining cell) and I'm ready to bin the whole thing at this point.. :(
     
  43. Reef

    Reef Well-Known Member

    Joined:
    Jul 27, 2018
    Messages:
    2,718
    Likes Received:
    1,772
    Changed title.

    Still in development it's just on the back burner for a little while.

    Edit:
    Solved my issue by making the initial download package an installer, so you have to choose the RailWorks folder to install SuperCacheCleaner into..

    Only thing is Google Drive has flagged this latest version as suspicious so I can't share it from there right now, I have submitted it for review but obviously I don't know if they'll unflag it or not.
     
    Last edited: Jun 12, 2023
  44. Reef

    Reef Well-Known Member

    Joined:
    Jul 27, 2018
    Messages:
    2,718
    Likes Received:
    1,772
    Edited a few variables (removed %cd% from file paths) and uploaded this new version to Google Drive, Google seems happier with this version as it hasn't been flagged as a trojan this time (yet). ¯\_(ツ)_/¯
     
    • Like Like x 1

Share This Page