Interface: Export logs with a single button / script

Suggestions for game development and improvements. One suggestion to a thread, please.
Post Reply
User avatar
cat
Posts: 147
Joined: Wed Nov 24, 2021 3:07 am

Interface: Export logs with a single button / script

Post by cat »

Suggestion: a button on character select screen that allows for quick exporting of all character logs.
At the moment I go through each character's logs one by one, manually copy and paste, and I have to remember to do this every 2 weeks - so it'd be great to see a better way to do this.
If the storage/mechanism of doing this is unreasonable via the game UI, a script/extension would be very welcome instead. Bonus points if the script is able to knit together exported data with previously exported logs, sorting of logs by character ID etc.
User avatar
Badziew
Posts: 105
Joined: Wed Nov 24, 2021 3:23 am
Location: Poland

Re: Interface: Export logs with a single button / script

Post by Badziew »

The only hard problem I see for implementing this on user side is handling counters for message duplicates - how to safely combine "(N times) some message (some date)" with ("M times) some message (some other date)".

Well, that and somehow storing message data between page views, because I have no idea if userscript launchers like Greasemonkey actually allow and support any such storage.
My characters (sorted by IDs): Badziew, Tiger Fist, Pilgrim, Sentient Spellbook, a trojan cat.

Check my wiki profile for more information, including contact information.
User avatar
Badziew
Posts: 105
Joined: Wed Nov 24, 2021 3:23 am
Location: Poland

Re: Interface: Export logs with a single button / script

Post by Badziew »

But yeah, generally +1, this sounds like a nice feature to have for all the data hoarders among us.
My characters (sorted by IDs): Badziew, Tiger Fist, Pilgrim, Sentient Spellbook, a trojan cat.

Check my wiki profile for more information, including contact information.
User avatar
Badziew
Posts: 105
Joined: Wed Nov 24, 2021 3:23 am
Location: Poland

Re: Interface: Export logs with a single button / script

Post by Badziew »

I feel inclined to start working on this, but there are some technical difficulties that cannot be ignored, only worked around.

The most important problem is that userscripts have exactly the same restrictions as visited websites, which includes no direct access to disk. Which is a sensible security feature (you would not want random websites to be able to uncontrollably spam junk and viruses in your computer, do you?) but it makes automated backups impossible.

The second problem is that until the data is saved it only resides in browser's internal storage/cache, so it could theoretically disappear any moment for any reason (e.g. browser run out of disk space, or executed some automatic cleanup).

I only see a few possible workarounds:

1) I could forget about automatic backups and just create a button to generate a giant text field where I dump all accumulated message logs, and let user manually copy-paste that somewhere else (e.g. a file on disk). This is the easiest to implement but gives little advantage over what is already available in game, mostly that the logs would be conveniently aggregated in a single place.

2) I checked and it looks like it is possible to create a button or link that launches browser's file saving dialog and let user manually save the logs to a file - but it would still be manual saving and not an automated backups, just a bit more convenient than visiting character profile and hitting "save as" in browser menu.

3) Instead of automatically saving to disk, the userscript could automatically send messages to some cloud storage. This type of action seems to not be blocked by browser so zealously so it would probably work, it all depends on what operations are supported by cloud storage. It would be the best of the storage allowed appending new content at end of existing file, but if not then I could try uploading a new file - it is still better to have a swarm of small files that nothing. I plan to check Google Docs documentation today (because it seems to be a popular service here) but if you know about some other provider that supports such things then please let me know.

4) And finally the most tedious option - creating my own "cloud backup service" that is tailored to support exactly what we need here. This is definitely doable, and maybe even easier than integrating with someone else's cloud service (because you have control over all design decisions instead of adapting to someone else's opinions), but it would require that you trust me to not spy on your precious data :P

Of course nothing forbids me from combining all the options into a single mega-solution, but I am asking about the "low hanging fruit" here - which solution you find the mot convenient and thus which should be done first, if at all.
My characters (sorted by IDs): Badziew, Tiger Fist, Pilgrim, Sentient Spellbook, a trojan cat.

Check my wiki profile for more information, including contact information.
User avatar
Goliath
Posts: 695
Joined: Wed Nov 24, 2021 10:01 am

Re: Interface: Export logs with a single button / script

Post by Goliath »

Badziew wrote: Sat May 14, 2022 1:02 pm I feel inclined to start working on this, but there are some technical difficulties that cannot be ignored, only worked around.

The most important problem is that userscripts have exactly the same restrictions as visited websites, which includes no direct access to disk. Which is a sensible security feature (you would not want random websites to be able to uncontrollably spam junk and viruses in your computer, do you?) but it makes automated backups impossible.

The second problem is that until the data is saved it only resides in browser's internal storage/cache, so it could theoretically disappear any moment for any reason (e.g. browser run out of disk space, or executed some automatic cleanup).

I only see a few possible workarounds:

1) I could forget about automatic backups and just create a button to generate a giant text field where I dump all accumulated message logs, and let user manually copy-paste that somewhere else (e.g. a file on disk). This is the easiest to implement but gives little advantage over what is already available in game, mostly that the logs would be conveniently aggregated in a single place.

2) I checked and it looks like it is possible to create a button or link that launches browser's file saving dialog and let user manually save the logs to a file - but it would still be manual saving and not an automated backups, just a bit more convenient than visiting character profile and hitting "save as" in browser menu.

3) Instead of automatically saving to disk, the userscript could automatically send messages to some cloud storage. This type of action seems to not be blocked by browser so zealously so it would probably work, it all depends on what operations are supported by cloud storage. It would be the best of the storage allowed appending new content at end of existing file, but if not then I could try uploading a new file - it is still better to have a swarm of small files that nothing. I plan to check Google Docs documentation today (because it seems to be a popular service here) but if you know about some other provider that supports such things then please let me know.

4) And finally the most tedious option - creating my own "cloud backup service" that is tailored to support exactly what we need here. This is definitely doable, and maybe even easier than integrating with someone else's cloud service (because you have control over all design decisions instead of adapting to someone else's opinions), but it would require that you trust me to not spy on your precious data :P

Of course nothing forbids me from combining all the options into a single mega-solution, but I am asking about the "low hanging fruit" here - which solution you find the mot convenient and thus which should be done first, if at all.
I have made an userscript that would download a file, handled as a download (the one that goes to the bottom bar of Chrome, is saved on your download location and can easily be cancelled), and can and will add it to Nexus Tweaks for everyone's convenience (and I can make it as a separate script if necessary).
A Parrot with a Blade - Melee/Touchcaster Holy Champion || GrayScimitar - Heavy Sword Tlac IB || RustyWire - Gunwiz
User avatar
Badziew
Posts: 105
Joined: Wed Nov 24, 2021 3:23 am
Location: Poland

Re: Interface: Export logs with a single button / script

Post by Badziew »

Goliath wrote: Sat May 14, 2022 1:54 pm I have made an userscript that would download a file, handled as a download (the one that goes to the bottom bar of Chrome, is saved on your download location and can easily be cancelled), and can and will add it to Nexus Tweaks for everyone's convenience (and I can make it as a separate script if necessary).
Heh, nice, I did not see it in your "Argavyon's Nexus Tweaks" thread so I thought nobody is working on it.
But since you're taking it over, I will pass, as I definitely have less experience in making userscripts than you.

Good luck and no hard bugs :)
My characters (sorted by IDs): Badziew, Tiger Fist, Pilgrim, Sentient Spellbook, a trojan cat.

Check my wiki profile for more information, including contact information.
Post Reply