Evolve Idle Cloud Save

Automatically upload your evolve save to a gist

目前為 2024-12-22 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

作者
Alistair1231
評價
0 0 0
版本
0.3.0
建立日期
2024-03-20
更新日期
2024-12-22
尺寸
11.0 KB
授權條款
GPL-3.0
腳本執行於

Evolve Idle Cloud Save

I lost my save game 😞. To prevent this from happening again, I implemented a quick backup, that uses GitHub Gist to store the save data.

What does it do?

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. 😉

I recommend using a separate file for each PC, otherwise your savegame might get overwritten by another PC, which has the tab open in the background. Also, only have one tab open at a time, otherwise the save might get overwritten by the other tab. This is easily recoverable, using the revision history of the gist, but it is worth mentioning. 😅

How to use?

On first setup you will need to manually create a GitHub API key and a Gist and then input them for the script to use. This is only tested on Violentmonkey. Some other Userscript managers might handle the GM functions differently. If something does not work, try to use Violentmonkey. 😊

Setup instructions

You will need a GistID and a Personal Access Token with Gist scope to use this.

Create a gist, the description does not matter, in this Gist, create a file e.g. called "save.txt", add some random content and save. You can do that here (You will need a GitHub account): 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. In Violentmonkey you can access this by clicking on the extension icon, then right-clicking on the script and selecting Values. There we want values like this (these are random examples I didn't leak my credentials 😉):

{
filename: "save.txt",
gistId: "856ce06ecda1234e095c156da8fd44d7",
token: "ghp_k928znRUu7ZI0tySv9gP2A2x9VdvVLrmrXCD"
}

I installed, what now?

Now, every 30 minutes your save game will be saved to the gist. You can also manually trigger a backup by clicking the "Save in Gist" button in the game UI. You can also import the save game from the gist by clicking the "Import Gist" button in the game UI. After "Import Gist", you still have to click the "Import Game" button for the save to be loaded. "Import Gist" only fills the textarea.

How does it work? (technical)

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. For saving the Data the GitHub API is used. The save game is exported using the exportGame function, which is exposed by the game. The save game is then sent to the GitHub API using a PATCH request.

I hope I can prevent some people from loosing their save games, and allow for more easy switching between devices. 😊