Skip to content

Instantly share code, notes, and snippets.

@MahouSirin
Created July 13, 2021 10:31
Show Gist options
  • Save MahouSirin/af3ef4090832365fdb2d5ded039f30a5 to your computer and use it in GitHub Desktop.
Save MahouSirin/af3ef4090832365fdb2d5ded039f30a5 to your computer and use it in GitHub Desktop.
PAIMON.MOE Backup/Restore Script
var keys = ['wish-counter-beginners', 'wish-counter-character-event', 'wish-counter-standard', 'wish-counter-weapon-event'];
var backupData = {};
(async () => {
for await (const key of keys) {
backupData[key] = await localforage.getItem(key);
}
copyToClipboard(JSON.stringify(backupData));
console.log('Copy completed!!!');
})();
function copyToClipboard(val) {
const t = document.createElement("textarea");
document.body.appendChild(t);
t.value = val;
t.select();
document.execCommand('copy');
document.body.removeChild(t);
}
var restoreData = REPLACE_TO_COPIED_DATA;
(async () => {
for await (const [key, value] of Object.entries(restoreData)) {
await localforage.setItem(key, value);
}
console.log('Restore completed!!!');
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment