正文
增加 161 行删除 103 行
123456789101112131415246 行未改动全部展开26226326426526626726826927036 行未改动307308309310311312313314315120 行未改动全部展开436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635179 行未改动全部展开8158168178188198208218228238248258268278281,104 行未改动全部展开审核大大放我一马吧😭**欢迎关注本人B站账号[开元玩游戏](https://space.bilibili.com/3546719373494519),冲刺100粉!***~~大部分js为AI生成,保证本人贡献大于AI,我贡献的提示词比AI生成量还多,所有总量也有个至少1亿token了~~*# 通用---- 前置类- ---### 通用设置中心:::info[展开]```js// ==UserScript==// @name 通用设置中心// @namespace http://tampermonkey.net/246 行未改动全部展开---- 前置类---### note.ms 内容获取接口:::info[展开]```js// ==UserScript==// @name note.ms 内容获取接口// @namespace http://tampermonkey.net/36 行未改动---- 普通类---### note.ms KYVS单页面覆盖 (需设置中心):::info[展开]>前置 $\footnotesize\mathbf{\colorbox{#cccccc}{\textcolor{#505050}{通用设置中心}}}$```js// ==UserScript==// @name note.ms KYVS单页面覆盖 (需设置中心)120 行未改动全部展开});})();```:::### note.ms KYVS批量循环覆盖 (需设置中心):::info[展开]>前置 $\footnotesize\mathbf{\colorbox{#cccccc}{\textcolor{#505050}{通用设置中心}}}$```js// ==UserScript==// @name note.ms KYVS批量循环覆盖 (需设置中心)// @namespace http://tampermonkey.net/// @version 2.3// @author B站开元玩游戏// @match https://note.ms/*// @run-at document-end// @grant GM_setValue// @grant GM_getValue// @grant GM_registerMenuCommand// @grant unsafeWindow// ==/UserScript==(function() {'use strict';const scriptId = 'batch_cover';const scriptName = '批量循环覆盖';const defaultConfig = {pages: ['/0', '/1', '/2', '/3', '/4', '/5'],fillText: '关注B站开元玩游戏',normalDelay: 200,errorDelay: 10000};const schema = {pages: { label: '页面列表 (逗号分隔)', type: 'array', default: ['/0', '/1', '/2', '/3', '/4', '/5'] },fillText: { label: '填充内容', type: 'textarea', default: '关注B站开元玩游戏', rows: 4 },normalDelay: { label: '成功延迟 (毫秒)', type: 'number', default: 200 },errorDelay: { label: '错误延迟 (毫秒)', type: 'number', default: 10000 }};const INDEX_KEY = 'batch_cover_index';// ---- 等待设置中心 ----function waitForSettings(callback) {let win = (typeof unsafeWindow !== 'undefined') ? unsafeWindow : window;console.log('🔍 检测设置中心,当前 win 对象:', win === window ? 'window' : 'unsafeWindow');if (win.NoteMsSettings) {console.log('✅ 立即检测到设置中心');callback(win.NoteMsSettings);return;}let attempts = 0;const maxAttempts = 50;const interval = setInterval(() => {attempts++;win = (typeof unsafeWindow !== 'undefined') ? unsafeWindow : window;if (win.NoteMsSettings) {clearInterval(interval);console.log(`✅ 第 ${attempts} 次检测到设置中心`);callback(win.NoteMsSettings);return;}if (attempts >= maxAttempts) {clearInterval(interval);console.error('❌ 等待超时,未检测到设置中心');alert('❌ 错误:未检测到“设置中心”脚本,请先安装并启用 Note.ms 设置中心。');}}, 100);}waitForSettings(function(settings) {settings.registerScript(scriptId, scriptName, defaultConfig, schema);console.log('✅ 批量循环覆盖注册成功');// ---- 配置变量(可动态刷新) ----let config = settings.getConfig(scriptId) || defaultConfig;let pages = config.pages || [];// ---- 当前索引 ----let currentIndex = parseInt(GM_getValue(INDEX_KEY, '0'), 10);if (currentIndex >= pages.length) currentIndex = 0;// ---- 重载配置函数(每轮循环结束时调用) ----function reloadConfig() {const newConfig = settings.getConfig(scriptId) || defaultConfig;const newPages = newConfig.pages || [];if (newPages.length === 0) {console.warn('⚠️ 新配置页面列表为空,停止运行');stop();return;}// 更新配置和页面列表config = newConfig;pages = newPages;// 如果当前索引超出新列表长度,重置为0if (currentIndex >= pages.length) {currentIndex = 0;GM_setValue(INDEX_KEY, currentIndex);}console.log('🔄 配置已刷新,当前页面列表:', pages.join(', '));console.log(`📍 当前进度: ${pages[currentIndex]} (索引 ${currentIndex})`);}let running = false;let timer = null;function postContent() {if (!running) return;if (pages.length === 0) {console.warn('⚠️ 页面列表为空,暂停');stop();return;}// 确保索引有效if (currentIndex >= pages.length) {currentIndex = 0;GM_setValue(INDEX_KEY, currentIndex);}const target = pages[currentIndex];const url = location.origin + target;const fillText = config.fillText || '';const normalDelay = config.normalDelay || 200;const errorDelay = config.errorDelay || 10000;console.log(`📤 正在覆盖 ${target} ...`);fetch(url, {method: 'POST',headers: { 'Content-Type': 'application/x-www-form-urlencoded' },body: '&t=' + encodeURIComponent(fillText)}).then(response => {if (response.ok) {console.log(`✅ ${target} 保存成功,状态: ${response.status}`);moveToNext(normalDelay);} else if (response.status === 403) {console.warn(`⚠️ ${target} 限流 403,等待 ${errorDelay}ms 后重试当前页面`);scheduleNext(errorDelay);} else {console.warn(`⚠️ ${target} 其他错误: ${response.status},等待 ${errorDelay}ms 后重试`);scheduleNext(errorDelay);}}).catch(err => {console.error(`❌ ${target} 网络错误:`, err, `,等待 ${errorDelay}ms 后重试`);scheduleNext(errorDelay);});}function moveToNext(delay) {// 检查是否完成一轮循环(即下一个索引是 0)const nextIndex = (currentIndex + 1) % pages.length;if (nextIndex === 0) {// 🎯 一轮结束,刷新配置reloadConfig();// 刷新后,从新列表的第一个开始currentIndex = 0;} else {currentIndex = nextIndex;}GM_setValue(INDEX_KEY, currentIndex);console.log(`⏭️ 移动到下一个: ${pages[currentIndex]}`);scheduleNext(delay);}function scheduleNext(delay) {if (timer) clearTimeout(timer);timer = setTimeout(postContent, delay);}function start() {if (running) return;if (pages.length === 0) {console.warn('⚠️ 页面列表为空,无法启动');return;}running = true;console.log('▶️ 批量循环覆盖开始');postContent();}function stop() {running = false;if (timer) { clearTimeout(timer); timer = null; }console.log('⏹️ 批量循环覆盖停止');}GM_registerMenuCommand('▶️ 批量覆盖开始', start);GM_registerMenuCommand('⏹️ 批量覆盖停止', stop);console.log('📋 批量循环覆盖已就绪,每轮循环结束后会自动刷新配置。');console.log(`📌 当前配置: 页面列表 [${pages.join(', ')}], 延迟 ${config.normalDelay}ms`);});})();```:::### note.ms 轮回查询器 (需设置中心&内容接口):::info[展开]>前置 $\footnotesize\mathbf{\colorbox{#cccccc}{\textcolor{#505050}{通用设置中心}}}\mathbf{\colorbox{#555555}{\textcolor{#cccccc}{note.ms 内容获取接口}}}$```js// ==UserScript==179 行未改动全部展开})();```:::## luogu.com & luogu.com.cn---- 普通类---### 洛谷随机跳题:::info[展开]**仅收藏,[原位置见此](https://www.luogu.me/article/0v7tv27r),此为在线版**```js/*MIT License1,104 行未改动全部展开123456789101112131415161718192021222324252627246 行未改动全部展开27427527627727827928028128228328428528628736 行未改动324325326327328329330331332333334335336337120 行未改动全部展开458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691179 行未改动全部展开8718728738748758768778788798808818828838848858861,104 行未改动全部展开审核大大放我一马吧😭**欢迎关注本人B站账号[开元玩游戏](https://space.bilibili.com/3546719373494519),冲刺100粉!***~~大部分js为AI生成,保证本人贡献大于AI,我贡献的提示词比AI生成量还多,所有总量也有个至少4亿token了~~*# [:===:原创:===:]# 通用---- 前置类- ---### 通用设置中心:::info[更新日志]>v1.3.0>--->更改版本计数方式>>更改API名字>v1.2>--->- 新增更新日志::::::success[v1.2]```js// ==UserScript==// @name 通用设置中心// @namespace http://tampermonkey.net/246 行未改动全部展开---- 前置类---### note.ms 内容获取接口:::info[更新日志]>v1.1>--->- 新增更新日志::::::success[v1.1]```js// ==UserScript==// @name note.ms 内容获取接口// @namespace http://tampermonkey.net/36 行未改动---- 普通类---### note.ms KYVS单页面覆盖 (需设置中心):::info[更新日志]>v4.3>--->- 新增更新日志::::::success[v4.3]>前置 $\footnotesize\mathbf{\colorbox{#cccccc}{\textcolor{#505050}{通用设置中心}}}$```js// ==UserScript==// @name note.ms KYVS单页面覆盖 (需设置中心)120 行未改动全部展开});})();```:::### note.ms KYVS批量循环覆盖 (需设置中心&内容接口):::info[更新日志]>v3.5>--->- 新增更新日志>- 根据新防火墙修复大部分区域覆盖失效的BUG>- 新增校验功能::::::success[v3.5]>前置 $\footnotesize\mathbf{\colorbox{#cccccc}{\textcolor{#505050}{通用设置中心}}}\mathbf{\colorbox{#555555}{\textcolor{#cccccc}{note.ms 内容获取接口}}}$```js// ==UserScript==// @name note.ms KYVS批量循环覆盖 (需设置中心&内容接口)// @namespace http://tampermonkey.net/// @version 3.5// @author B站开元玩游戏// @match https://note.ms/*// @run-at document-end// @grant GM_setValue// @grant GM_getValue// @grant GM_registerMenuCommand// @grant GM_xmlhttpRequest// @grant unsafeWindow// ==/UserScript==(function() {'use strict';// ---- 配置 ----const scriptId = 'batch_cover_verify';const scriptName = '批量循环覆盖';const defaultConfig = {pages: ['/0', '/1', '/2', '/3', '/4', '/5'],fillText: '关注B站开元玩游戏',normalDelay: 500,errorDelay: 10000,verifyDelay: 1000,warmUpDelay: 300};const schema = {pages: { label: '页面列表 (逗号分隔)', type: 'array', default: defaultConfig.pages },fillText: { label: '填充内容', type: 'textarea', default: defaultConfig.fillText, rows: 4 },normalDelay: { label: '成功延迟 (毫秒)', type: 'number', default: defaultConfig.normalDelay },errorDelay: { label: '错误延迟 (毫秒)', type: 'number', default: defaultConfig.errorDelay },verifyDelay: { label: '验证延迟 (毫秒)', type: 'number', default: defaultConfig.verifyDelay },warmUpDelay: { label: '预热延迟 (毫秒)', type: 'number', default: defaultConfig.warmUpDelay }};const INDEX_KEY = 'batch_cover_index';// ---- 工具:GM_xmlhttpRequest 封装为 Promise ----function gmRequest(method, url, data = null, headers = {}) {return new Promise((resolve, reject) => {GM_xmlhttpRequest({method: method,url: url,headers: Object.assign({'Referer': url,'Origin': location.origin,'User-Agent': navigator.userAgent,'X-Requested-With': 'XMLHttpRequest'}, headers),data: data,onload: (resp) => resolve(resp),onerror: (err) => reject(err)});});}// ---- 获取页面内容(验证用) ----async function getContent(path) {if (!path.startsWith('/')) path = '/' + path;const url = location.origin + path;try {const resp = await gmRequest('GET', url);if (resp.status !== 200) return null;const html = resp.responseText;const match = html.match(/<textarea[^>]*class\s*=\s*["']content["'][^>]*>([\s\S]*?)<\/textarea>/i);return match ? match[1] : null;} catch (_) { return null; }}// ---- 预热(GET 建立会话) ----async function warmUp(url) {try {await gmRequest('GET', url);} catch (_) {}}// ---- 等待设置中心 ----function waitForSettings(callback) {const win = (typeof unsafeWindow !== 'undefined') ? unsafeWindow : window;if (win.NoteMsSettings) {callback(win.NoteMsSettings);return;}let attempts = 0;const interval = setInterval(() => {attempts++;const w = (typeof unsafeWindow !== 'undefined') ? unsafeWindow : window;if (w.NoteMsSettings) {clearInterval(interval);callback(w.NoteMsSettings);} else if (attempts >= 50) {clearInterval(interval);console.error('❌ 设置中心未检测到');alert('❌ 请先安装并启用“设置中心”脚本。');}}, 100);}waitForSettings((settings) => {settings.registerScript(scriptId, scriptName, defaultConfig, schema);console.log('✅ 批量循环覆盖注册成功');let config = settings.getConfig(scriptId) || defaultConfig;let pages = config.pages || [];let currentIndex = parseInt(GM_getValue(INDEX_KEY, '0'), 10) % pages.length || 0;let running = false;let timer = null;const reloadConfig = () => {const newConfig = settings.getConfig(scriptId) || defaultConfig;const newPages = newConfig.pages || [];if (newPages.length === 0) {console.warn('⚠️ 页面列表为空,停止');stop();return;}config = newConfig;pages = newPages;if (currentIndex >= pages.length) currentIndex = 0;console.log('🔄 配置已刷新:', pages.join(', '));};// ---- 核心覆盖流程(预热 + POST + 验证) ----async function postContent() {if (!running || pages.length === 0) return;if (currentIndex >= pages.length) currentIndex = 0;const target = pages[currentIndex];const url = location.origin + target;const fillText = config.fillText || '';const { normalDelay, errorDelay, verifyDelay, warmUpDelay } = config;// 1. 预热console.log(`🌐 预热 ${target} ...`);await warmUp(url);await new Promise(r => setTimeout(r, warmUpDelay));// 2. POST 保存console.log(`📤 覆盖 ${target} ...`);try {const postResp = await gmRequest('POST', url, '&t=' + encodeURIComponent(fillText), {'Content-Type': 'application/x-www-form-urlencoded'});if (postResp.status !== 200) {console.warn(`⚠️ ${target} HTTP ${postResp.status}`);scheduleNext(errorDelay);return;}console.log(`✅ ${target} HTTP 200`);// 3. 验证await new Promise(r => setTimeout(r, verifyDelay));const currentContent = await getContent(target);if (currentContent === null) {console.warn(`⚠️ ${target} 读取失败,跳过验证`);moveToNext(normalDelay);return;}if (currentContent.trim() === fillText.trim()) {console.log(`✅ ${target} 验证通过`);moveToNext(normalDelay);} else {console.warn(`⚠️ ${target} 验证失败,${verifyDelay}ms后重试`);scheduleNext(verifyDelay);}} catch (err) {console.error(`❌ ${target} 网络错误:`, err);scheduleNext(errorDelay);}}function moveToNext(delay) {const nextIndex = (currentIndex + 1) % pages.length;if (nextIndex === 0) reloadConfig();currentIndex = nextIndex;GM_setValue(INDEX_KEY, currentIndex);console.log(`⏭️ 移动到 ${pages[currentIndex]}`);scheduleNext(delay);}function scheduleNext(delay) {if (timer) clearTimeout(timer);timer = setTimeout(postContent, delay);}function start() {if (running || pages.length === 0) return;running = true;console.log('▶️ 批量覆盖开始');postContent();}function stop() {running = false;if (timer) { clearTimeout(timer); timer = null; }console.log('⏹️ 批量覆盖停止');}GM_registerMenuCommand('▶️ 批量覆盖开始', start);GM_registerMenuCommand('⏹️ 批量覆盖停止', stop);console.log(`📋 已就绪,延迟 ${config.normalDelay}ms`);});})();```:::### note.ms 轮回查询器 (需设置中心&内容接口):::info[更新日志]>v1.2>--->- 新增更新日志::::::success[v1.2]>前置 $\footnotesize\mathbf{\colorbox{#cccccc}{\textcolor{#505050}{通用设置中心}}}\mathbf{\colorbox{#555555}{\textcolor{#cccccc}{note.ms 内容获取接口}}}$```js// ==UserScript==179 行未改动全部展开})();```:::# [:===:收藏:===:]# 单一网站## luogu.com & luogu.com.cn---- 普通类---### 洛谷随机跳题:::success[v1.0]**仅收藏,[原位置见此](https://www.luogu.me/article/0v7tv27r),此为在线版**```js/*MIT License1,104 行未改动全部展开