// ==UserScript== // @name 脚本猫脚本推荐助手(持续更新中......) // @namespace http://scriptcat.org // @version 1.1000.0 // @description 脚本猫上好用脚本推荐工具,弹窗展示+黑名单避雷###(敲重点:安装后并非没有窗口,浏览器右下角会出现紫色按钮,点击即可弹出窗口。) // @author ScriptCat User // @match *://*/* // @grant GM_addStyle // @grant GM_setValue // @grant GM_getValue // @license MIT // ==/UserScript== (function() { 'use strict'; // 推荐数据 - 直接从推荐.txt提取 const recommendData = `1. 学习通(刷课/视频+刷题): 编号:00001 网址:https://scriptcat.org/zh-CN/script-show-page/2453 使用教程:待更新...... [说明:暂无......] 2. 各种文库下载器(打勾可用,打叉不可用): 编号:10001 网址:https://scriptcat.org/zh-CN/script-show-page/2787 使用教程:待更新...... 适用范围:百度文库√...... [说明:测试了部分网站,其他网站待测试......] 3. 小红书优化: 编号:20001 网址:https://scriptcat.org/zh-CN/script-show-page/2538 使用教程:待更新...... [说明:暂无......] 4. BZ综合网页搜索脚本: 编号:30001 网址:https://scriptcat.org/zh-CN/script-show-page/3006 使用教程:待更新...... [说明:暂无......] 5.智能翻译助手: 编号:30002 网址:https://scriptcat.org/zh-CN/script-show-page/5633 使用教程:无 缺点:就是切换语言翻译完,语言选项也跟着翻译了,万一翻译成的语言中文不认识怎么切回简体中文?逻辑有点问题 [说明:按钮在屏幕左上角] 6.VPN: 编号:20002 网址:https://microsoftedge.microsoft.com/addons/detail/vpn/dalhgafbhpdolibignjckpmiejgfddjp [说明:PC端edge上好用,移动端edge不好用] 7.iTab新标签页: 编号:30003 用途:iTab 组件式图标自定义您的浏览器的标签页,精美日历、炫酷天气、每日头条、海量壁纸、常用网址随心订制等 (大白话:改善edge主页的一个好东西,有各种小组件、实用功能/网站、壁纸等) 网址:https://microsoftedge.microsoft.com/addons/detail/itab%E6%96%B0%E6%A0%87%E7%AD%BE%E9%A1%B5/inedkoakiaeepjoblbiiipedngonadhn [说明:暂无......] 黑名单: 1.抖音优化:https://scriptcat.org/zh-CN/script-show-page/2534 2.超星学习通九九助手[AI答题][一键启动][最小化运行]:https://scriptcat.org/zh-CN/script-show-page/1127 3.右键链接复制器 增强版:https://scriptcat.org/zh-CN/script-show-page/5967#google_vignette 4.【最强无套路脚本】你能看见多少我能下载多少&下载公开免费的PPT、PDF、DOC、TXT等文件:https://scriptcat.org/zh-CN/script-show-page/3046 [说明:安装运行后,没有后台运行,没有前端弹窗,不会用,脚本说明看了也不会用,没招了] 5.重要事件倒计时:https://scriptcat.org/zh-CN/script-show-page/1506 [说明:安装运行后,右上角有几行字,"倒计时结束,请重新设置"之类的话,但是没有设置按钮,用不了]`; // 解析数据 function parseData(text) { const scripts = []; const blacklist = []; // 按行分割 const lines = text.split('\n'); console.log('总行数:', lines.length); let currentScript = null; let inBlacklist = false; lines.forEach((line, index) => { const trimmedLine = line.trim(); console.log(`第${index + 1}行:`, trimmedLine); if (trimmedLine === '黑名单:') { inBlacklist = true; console.log('进入黑名单模式'); return; } if (inBlacklist) { // 解析黑名单项 if (trimmedLine) { const match = trimmedLine.match(/(\d+)\.(.*?):(https:\/\/\S+)/); if (match) { const blacklistItem = { name: match[2].trim(), url: match[3], note: '' }; blacklist.push(blacklistItem); console.log('添加黑名单项:', blacklistItem); } else if (trimmedLine.startsWith('[说明:') && trimmedLine.endsWith(']')) { // 解析黑名单说明 if (blacklist.length > 0) { blacklist[blacklist.length - 1].note = trimmedLine.substring(3, trimmedLine.length - 1).trim(); console.log('添加黑名单说明:', blacklist[blacklist.length - 1]); } } } } else { // 解析推荐脚本 const scriptMatch = trimmedLine.match(/^(\d+)\.\s*(.+?)(:|$)/); if (scriptMatch) { // 开始新脚本 if (currentScript) { scripts.push(currentScript); console.log('添加脚本:', currentScript); } currentScript = { id: scriptMatch[1], name: scriptMatch[2].trim(), number: '', url: '', tutorial: '待更新......', scope: '', note: '暂无......', purpose: '', 缺点: '' }; console.log('开始新脚本:', currentScript); } else if (currentScript) { // 解析脚本属性 if (trimmedLine.startsWith('编号:')) { currentScript.number = trimmedLine.replace('编号:', '').trim(); } else if (trimmedLine.startsWith('网址:')) { currentScript.url = trimmedLine.replace('网址:', '').trim(); } else if (trimmedLine.startsWith('使用教程:')) { currentScript.tutorial = trimmedLine.replace('使用教程:', '').trim(); } else if (trimmedLine.startsWith('适用范围:')) { currentScript.scope = trimmedLine.replace('适用范围:', '').trim(); } else if (trimmedLine.startsWith('用途:')) { currentScript.purpose = trimmedLine.replace('用途:', '').trim(); } else if (trimmedLine.startsWith('缺点:')) { currentScript.缺点 = trimmedLine.replace('缺点:', '').trim(); } else if (trimmedLine.startsWith('[说明:') && trimmedLine.endsWith(']')) { currentScript.note = trimmedLine.substring(3, trimmedLine.length - 1).trim(); } else if (trimmedLine.startsWith('(大白话:')) { // 处理大白话说明 if (!currentScript.purpose) { currentScript.purpose = ''; } currentScript.purpose += ' ' + trimmedLine.substring(4, trimmedLine.length - 1).trim(); } } } }); // 添加最后一个脚本 if (currentScript) { scripts.push(currentScript); console.log('添加最后一个脚本:', currentScript); } console.log('最终解析结果:', { scripts, blacklist }); console.log('推荐脚本数量:', scripts.length); console.log('黑名单数量:', blacklist.length); // 手动添加测试脚本,确保显示 if (scripts.length === 0) { console.log('没有解析到脚本,添加测试脚本'); scripts.push({ id: '1', name: '测试脚本', number: '00001', url: 'https://scriptcat.org', tutorial: '测试教程', scope: '测试范围', note: '测试说明', purpose: '测试用途', 缺点: '测试缺点' }); } return { scripts, blacklist }; } const { scripts, blacklist } = parseData(recommendData); // 添加样式 GM_addStyle(` /* 全局样式重置 */ .script-rec-modal, .script-rec-btn, .script-rec-window { box-sizing: border-box; } /* 悬浮按钮 */ .script-rec-btn { position: fixed; bottom: 30px; right: 30px; width: 60px; height: 60px; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); border-radius: 50%; border: none; color: white; font-size: 24px; cursor: pointer; box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4); z-index: 999999; transition: all 0.3s ease; display: flex; align-items: center; justify-content: center; } .script-rec-btn:hover { transform: scale(1.1); box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6); } /* 模态窗口背景 */ .script-rec-modal { display: none; position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(0, 0, 0, 0.5); z-index: 999999; justify-content: center; align-items: center; backdrop-filter: blur(5px); } .script-rec-modal.active { display: flex; } /* 窗口 */ .script-rec-window { background: white; width: 90vw; max-width: 800px; max-height: 85vh; border-radius: 16px; overflow: hidden; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3); display: flex; flex-direction: column; } /* 窗口头部 */ .script-rec-header { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; padding: 20px 25px; display: flex; justify-content: space-between; align-items: center; } .script-rec-title { font-size: 20px; font-weight: 600; display: flex; align-items: center; gap: 10px; } .script-rec-header-buttons { display: flex; gap: 10px; align-items: center; } .script-rec-developer-button { background: rgba(255,255,255,0.2); border: none; color: white; padding: 8px 16px; border-radius: 20px; cursor: pointer; font-size: 13px; font-weight: 500; transition: all 0.2s ease; } .script-rec-developer-button:hover { background: rgba(255,255,255,0.3); } .script-rec-close { background: rgba(255,255,255,0.2); border: none; color: white; width: 36px; height: 36px; border-radius: 50%; cursor: pointer; font-size: 20px; display: flex; align-items: center; justify-content: center; transition: all 0.2s ease; } .script-rec-close:hover { background: rgba(255,255,255,0.3); } /* 窗口内容 */ .script-rec-body { flex: 1; overflow-y: auto; padding: 25px; } /* 搜索栏 */ .script-rec-search { margin-bottom: 20px; width: 100%; } .script-rec-search input { width: 100%; padding: 14px 18px; border: 2px solid #e0e0e0; border-radius: 12px; font-size: 15px; outline: none; transition: all 0.3s ease; background: white; box-sizing: border-box; } .script-rec-search input:focus { border-color: #667eea; box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1); } /* 脚本列表 */ .script-rec-list { display: grid; gap: 15px; } /* 脚本项 */ .script-rec-item { background: #f8f9fa; border: 2px solid transparent; border-radius: 12px; padding: 18px; transition: all 0.3s ease; cursor: pointer; } .script-rec-item:hover { border-color: #667eea; transform: translateY(-2px); box-shadow: 0 8px 25px rgba(102, 126, 234, 0.15); } /* 脚本头部 */ .script-rec-item-header { display: flex; justify-content: space-between; align-items: start; margin-bottom: 10px; } .script-rec-item-name { font-size: 17px; font-weight: 600; color: #333; } .script-rec-item-number { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; padding: 4px 12px; border-radius: 15px; font-size: 13px; font-weight: 600; } /* 脚本信息 */ .script-rec-item-info { margin-top: 10px; } .script-rec-item-row { display: flex; margin-bottom: 6px; font-size: 14px; } .script-rec-item-label { color: #888; min-width: 80px; } .script-rec-item-value { color: #555; flex: 1; } /* 脚本说明 */ .script-rec-item-note { background: #fff3cd; padding: 10px 14px; border-radius: 8px; margin-top: 12px; font-size: 13px; color: #856404; } /* 脚本操作按钮 */ .script-rec-item-actions { display: flex; gap: 10px; margin-top: 15px; } .script-rec-btn-primary { flex: 1; padding: 12px; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; border: none; border-radius: 8px; cursor: pointer; font-weight: 600; font-size: 14px; transition: all 0.2s ease; } .script-rec-btn-primary:hover { transform: translateY(-2px); box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4); } .script-rec-btn-secondary { padding: 12px 20px; background: #e9ecef; color: #555; border: none; border-radius: 8px; cursor: pointer; font-weight: 500; font-size: 14px; transition: all 0.2s ease; } .script-rec-btn-secondary:hover { background: #dee2e6; } /* 无结果提示 */ .script-rec-no-result { text-align: center; padding: 50px 20px; color: #888; } .script-rec-no-result-icon { font-size: 60px; margin-bottom: 15px; } /* 分类标题 */ .script-rec-section-title { font-size: 16px; font-weight: 600; color: #333; margin: 25px 0 15px; padding-bottom: 10px; border-bottom: 2px solid #e0e0e0; } /* 黑名单项 */ .script-rec-blacklist-item { background: #f8d7da; border: 1px solid #f5c6cb; border-radius: 8px; padding: 15px; margin-bottom: 10px; display: flex; flex-direction: column; gap: 10px; } .script-rec-blacklist-content { display: flex; justify-content: space-between; align-items: center; } .script-rec-blacklist-name { color: #721c24; font-weight: 500; } .script-rec-blacklist-badge { background: #dc3545; color: white; padding: 3px 10px; border-radius: 12px; font-size: 12px; } .script-rec-blacklist-actions { display: flex; gap: 8px; justify-content: flex-end; } .script-rec-blacklist-btn { border: none; padding: 6px 12px; border-radius: 6px; cursor: pointer; font-size: 12px; font-weight: 500; } .script-rec-blacklist-btn-primary { background: #dc3545; color: white; } .script-rec-blacklist-btn-primary:hover { background: #c82333; } .script-rec-blacklist-btn-secondary { background: #6c757d; color: white; } .script-rec-blacklist-btn-secondary:hover { background: #5a6268; } .script-rec-blacklist-note { font-size: 12px; color: #6c757d; margin: 8px 0; line-height: 1.4; } /* 统计信息 */ .script-rec-stats { display: flex; gap: 20px; margin-bottom: 20px; padding: 15px; background: #f8f9fa; border-radius: 10px; } .script-rec-stat { text-align: center; } .script-rec-stat-value { font-size: 24px; font-weight: 700; color: #667eea; } .script-rec-stat-label { font-size: 12px; color: #888; margin-top: 4px; } /* 滚动条 */ .script-rec-body::-webkit-scrollbar { width: 8px; } .script-rec-body::-webkit-scrollbar-track { background: #f1f1f1; } .script-rec-body::-webkit-scrollbar-thumb { background: #c1c1c1; border-radius: 4px; } .script-rec-body::-webkit-scrollbar-thumb:hover { background: #a8a8a8; } /* 响应式设计 */ @media (max-width: 768px) { .script-rec-window { width: 95vw; max-height: 90vh; } .script-rec-btn { bottom: 20px; right: 20px; } } /* 开发者寄语弹窗 */ .script-rec-developer-popup { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(0, 0, 0, 0.5); z-index: 9999999; display: flex; justify-content: center; align-items: center; } .script-rec-developer-content { background: white; width: 85vw; max-width: 500px; border-radius: 12px; overflow: hidden; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2); } .script-rec-developer-header { background: #667eea; color: white; padding: 15px 20px; display: flex; justify-content: space-between; align-items: center; } .script-rec-developer-header h3 { margin: 0; font-size: 16px; font-weight: 600; } .script-rec-developer-close { font-size: 20px; cursor: pointer; } .script-rec-developer-body { padding: 20px; max-height: 60vh; overflow-y: auto; } .script-rec-developer-body p { margin: 10px 0; line-height: 1.5; color: #333; font-size: 14px; } .script-rec-developer-footer { padding: 15px 20px; background: #f5f5f5; text-align: center; } .script-rec-developer-btn { background: #667eea; color: white; border: none; padding: 10px 25px; border-radius: 6px; cursor: pointer; font-weight: 600; font-size: 14px; } .script-rec-developer-btn:hover { background: #5a6fd8; } `); // 创建UI function createUI() { // 创建悬浮按钮 const btn = document.createElement('button'); btn.className = 'script-rec-btn'; btn.innerHTML = '📋'; btn.title = '脚本推荐'; // 确保按钮添加到页面 document.body.appendChild(btn); console.log('脚本推荐按钮已添加'); // 创建模态窗口 const modal = document.createElement('div'); modal.className = 'script-rec-modal'; modal.innerHTML = `
🐱 脚本推荐
${scripts.length}
推荐脚本
${blacklist.length}
黑名单
`; document.body.appendChild(modal); console.log('脚本推荐窗口已添加'); // 绑定事件 btn.addEventListener('click', () => { // 显示开发者寄语(首次点击时) showDeveloperMessage(); modal.classList.add('active'); // 清空搜索框 const searchInput = modal.querySelector('#script-rec-search'); if (searchInput) { searchInput.value = ''; } renderScripts(); console.log('窗口已打开'); }); modal.querySelector('.script-rec-close').addEventListener('click', () => { // 清空搜索框 const searchInput = modal.querySelector('#script-rec-search'); if (searchInput) { searchInput.value = ''; } modal.classList.remove('active'); console.log('窗口已关闭'); }); // 绑定开发者的话按钮事件 const developerButton = modal.querySelector('.script-rec-developer-button'); if (developerButton) { developerButton.addEventListener('click', () => { // 重置显示状态,强制显示开发者寄语 GM_setValue('developerMessageShown', false); showDeveloperMessage(); console.log('显示开发者的话'); }); } // 移除点击弹窗外部关闭的逻辑,只允许点击关闭按钮关闭 // 搜索功能 const searchInput = modal.querySelector('#script-rec-search'); searchInput.addEventListener('input', (e) => { const query = e.target.value.trim().toLowerCase(); renderScripts(query); }); } // 渲染脚本 function renderScripts(searchQuery = '') { const container = document.querySelector('#script-rec-container'); if (!container) return; let html = ''; // 过滤脚本 let filteredScripts = scripts; if (searchQuery) { filteredScripts = scripts.filter(script => script.name.toLowerCase().includes(searchQuery) || script.number.includes(searchQuery) ); } // 渲染推荐脚本 if (filteredScripts.length > 0) { html += `
📌 推荐脚本
`; html += `
`; html += filteredScripts.map(script => `
${highlight(script.name, searchQuery)}
#${highlight(script.number, searchQuery)}
${script.scope ? `
适用范围: ${script.scope}
` : ''} ${script.purpose ? `
用途: ${script.purpose}
` : ''}
使用教程: ${script.tutorial}
${script.缺点 ? `
缺点: ${script.缺点}
` : ''}
💡 ${script.note}
`).join(''); html += `
`; } else if (searchQuery) { html += `
🔍
未找到匹配的脚本
试试其他关键词
`; } // 渲染黑名单 if (blacklist.length > 0 && !searchQuery) { html += `
⚠️ 黑名单(不推荐)
`; html += blacklist.map(item => `
${item.name} 不推荐
${item.note ? `
${item.note.replace(/^:/, '')}
` : ''}
`).join(''); } container.innerHTML = html; // 移除脚本项的点击跳转功能,只保留按钮点击 // 绑定查看脚本按钮事件 container.querySelectorAll('.script-rec-btn-primary').forEach(btn => { btn.addEventListener('click', (e) => { e.stopPropagation(); const url = btn.dataset.url; if (url) { window.open(url, '_blank'); console.log('点击查看脚本:', url); } }); }); // 绑定复制链接按钮事件 container.querySelectorAll('.script-rec-btn-secondary').forEach(btn => { btn.addEventListener('click', (e) => { e.stopPropagation(); const url = btn.dataset.url; if (url) { copyLink(url); console.log('复制脚本链接:', url); } }); }); // 移除黑名单项的点击跳转功能,只保留按钮点击 // 绑定黑名单查看脚本按钮事件 container.querySelectorAll('.script-rec-blacklist-btn-primary').forEach(btn => { btn.addEventListener('click', (e) => { e.stopPropagation(); const url = btn.dataset.url; if (url) { window.open(url, '_blank'); console.log('点击查看黑名单脚本:', url); } }); }); // 绑定黑名单复制链接按钮事件 container.querySelectorAll('.script-rec-blacklist-btn-secondary').forEach(btn => { btn.addEventListener('click', (e) => { e.stopPropagation(); const url = btn.dataset.url; if (url) { copyLink(url); console.log('复制黑名单脚本链接:', url); } }); }); } // 高亮搜索词 function highlight(text, query) { if (!query) return text; const regex = new RegExp(`(${escapeRegExp(query)})`, 'gi'); return text.replace(regex, '$1'); } function escapeRegExp(string) { return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); } // 复制链接 function copyLink(url) { navigator.clipboard.writeText(url).then(() => { alert('链接已复制到剪贴板!'); }).catch(() => { const textarea = document.createElement('textarea'); textarea.value = url; document.body.appendChild(textarea); textarea.select(); document.execCommand('copy'); document.body.removeChild(textarea); alert('链接已复制到剪贴板!'); }); } // 暴露到全局,以便其他地方调用 window.copyLink = copyLink; // 显示开发者寄语弹窗 function showDeveloperMessage() { const hasShown = GM_getValue('developerMessageShown', false); if (!hasShown) { // 创建弹窗 const popup = document.createElement('div'); popup.className = 'script-rec-developer-popup'; popup.innerHTML = `

开发者寄语

×

大家好,我是本脚本的开发者,也是一名长期使用脚本猫的普通用户。

平时使用脚本猫时,发现平台上的脚本良莠不齐,想要找到一款实用的脚本,往往需要反复试错、浪费不少时间,因此便开发了这款工具:专门推荐经过我实测好用的脚本,同时将劣质、不好用的脚本直接拉黑,帮大家快速避坑、节省时间。

所有推荐的脚本均经过我实际测试验证,确保好用、稳定;黑名单也会根据大家的反馈和后续实测,持续更新完善,也欢迎大家积极反馈,补充优质或劣质脚本信息。

我的初心很简单:让每一位脚本猫用户,都能轻松找到好用的脚本,不用在繁杂的资源中浪费精力,切实提升使用体验。后续我也会根据脚本猫版本更新和大家的需求,持续优化脚本功能,感谢大家的支持与使用❤️

联系方式:625716806[(QQ),加请备注来意,谢谢]

`; document.body.appendChild(popup); // 绑定关闭事件 popup.querySelector('.script-rec-developer-close').addEventListener('click', () => { document.body.removeChild(popup); // 标记已显示 GM_setValue('developerMessageShown', true); }); popup.querySelector('.script-rec-developer-btn').addEventListener('click', () => { document.body.removeChild(popup); // 标记已显示 GM_setValue('developerMessageShown', true); }); } } // 初始化 function init() { // 确保DOM已加载 if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', createUI); } else { createUI(); } console.log('脚本推荐初始化完成'); } // 启动 init(); })();