您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Modified from code by @Andrew_Haine. Also saves first discoveries, which is not currently supported on neal.fun.
当前为
// ==UserScript== // @name Infinite Craft - Clipboard Save/Load // @namespace http://ow0.me/infinite // @version 2024-02-01v1 // @description Modified from code by @Andrew_Haine. Also saves first discoveries, which is not currently supported on neal.fun. // @author Ina' // @match https://neal.fun/* // @icon https://ow0.me/infinite/icon48.png // @icon64 https://ow0.me/infinite/icon64.png // @grant GM_getValue // @grant GM_setValue // @grant unsafeWindow // @require https://neal.fun/_nuxt/992eef7.js // @require https://neal.fun/_nuxt/dcc1889.js // @run-at document-idle // @license GPLv3 // ==/UserScript== // note - the icon may be moved to n-o.one const buttonStyle = { appearance: 'none', position: 'absolute', width: '80px', height: '35px', backgroundColor: '#1A1B31', color: 'white', fontWeight: 'bold', fontFamily: 'Roboto,sans-serif', border: '0', outline: 'none', borderRadius: '5px', cursor: 'pointer', padding: 4, } const init = () => { const container = document.querySelector('.container'); const saveButton = document.createElement('button'); const restoreButton = document.createElement('button'); Object.keys(buttonStyle).forEach((attr) => { saveButton.style[attr] = buttonStyle[attr]; restoreButton.style[attr] = buttonStyle[attr]; }); saveButton.style.bottom = '24px'; saveButton.style.left = '24px'; restoreButton.style.bottom = '24px'; restoreButton.style.left = '120px'; saveButton.innerText = 'Copy'; restoreButton.innerText = 'Load'; var that = unsafeWindow.$nuxt.$children[2].$children[0].$children[0].$data; const saveElements = () => { window.prompt("Copy this text:", JSON.stringify({elements : that.elements, discoveries : that.discoveries})); } const restoreElements = () => { const stored = JSON.parse(window.prompt("Paste your save here", "")); if (stored?.elements?.length > 4) { that.elements = stored.elements; that.discoveries = stored.discoveries } else { window.alert("Invalid input (must be a JSON list of length greater than 4."); } } saveButton.addEventListener('click', () => saveElements()); restoreButton.addEventListener('click', () => restoreElements()); container.appendChild(saveButton); container.appendChild(restoreButton); } var yuri = () => { 'use strict'; console.log('establishing yuri'); init(); console.log('yuri established'); } window.addEventListener("load", yuri);