Automatically upload your evolve save to a gist
Mint
I lost my save game 😞. To prevent this from happening again, I implemented a quick and dirty cloud backup using a GitHub Gist.
Only export is implemented and that will most likely stay so, importing is fast and pretty rare.
It makes a backup every 30 minutes (adjustable at the bottom of the script). The save game will be written to a gist, that is defined by the user. By using a gist, you also get the benefit of versioning. So you can roll back to earlier saves. 😉
The API token is saved as plaintext, so be sure to only give it the gist scope and use a token for this purpose alone so you can revoke it if necessary. Better safe than sorry. If you are really paranoid, make a GitHub account only for this purpose. I don't want to implement encryption, that sounds like a hassle, and then you have the new issue of loosing that password as well as having to always enter it as saving the password next to the encrypted content pretty much defeats the purpose. 😁
On first setup you will need to manually create a GitHub API key and a Gist. That is described in an alert box when you first use the script, but since I think I remember Google having plans to remove those, I will put the description here as well.
Be aware, I usually forget to update these descriptions, so if in doubt look at the code.
Also, this is only tested on Violenmonkey and Firefox. The Browser should not matter, but some other Userscript managers might handle the GM functions differently. If something does not work, try to use Violentmonkey, or message me, if I have time I might try to help.
(I updated the instruction last on v0.1.0)
You will need a GistID and a Personal Access Token to use this.
Create a gist, the description does not matter, in it make a file called "save.txt" and add some random content so GitHub doesn't complain, you can do that here: https://gist.github.com Afterwards, you can find the GistID in the URL: https://gist.github.com/{{Username}}/{{GistID}}
The Personal Access Token you have to create here: https://github.com/settings/tokens you only need the gist scope.
If you make a mistake you should be asked again, alternatively you can manually set these values in the Userscript storage.
The script makes use of GM.xmlhttpRequest for the request and GM.setValue/GM.getValue for storing/retrieving the secrets. The timing is done with setInterval.
I hope I can prevent some people from loosing their save games, and allow for more easy switching between devices. 😊