您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Greasy Fork is available in English.
Auto
当前为
// ==UserScript== // @name 自动点击 // @namespace https://aic.oceanengine.com/ // @include https://aic.oceanengine.com/* // @version 2025-02-11 // @description Auto // @author You // @match https://aic.oceanengine.com/tools/commodity_card?bpId=1802895905078362 // @icon https://www.google.com/s2/favicons?sz=64&domain=oceanengine.com // @license MIT // @grant none // ==/UserScript== (function() { 'use strict'; // 定义一个标志,表示是否正在执行流程 let isExecuting = false; // 定义一个标志,表示是否需要停止流程 let shouldStop = false; // 定义一个变量来存储“继续生成”按钮的定时器 let continueIntervalId; // 定义一个函数来查找并点击“立即生成”按钮 function checkAndClickGenerateButton() { if (isExecuting || shouldStop) { // 如果正在执行流程或需要停止流程,暂停检测“立即生成”按钮 return; } const span = Array.from(document.querySelectorAll('span')).find(el => el.textContent.trim() === '立即生成'); if (span) { const button = span.parentElement; if (button) { button.click(); console.log('已点击“立即生成”按钮'); // 开始点击“继续生成”按钮九次 clickContinueButton(9); // 9次 } else { console.error('未找到span的父级button元素'); } } else { console.log('未找到文本内容为“立即生成”的span元素,继续检查...'); } } // 定义一个函数来点击“继续生成”按钮九次 function clickContinueButton(count) { if (shouldStop) { console.log('停止流程'); return; } isExecuting = true; // 设置标志,表示正在执行流程 let remainingClicks = count; continueIntervalId = setInterval(() => { if (shouldStop) { clearInterval(continueIntervalId); isExecuting = false; console.log('停止流程'); return; } // 查找文本内容为“继续生成”的按钮 const continueButton = Array.from(document.querySelectorAll('button')).find(button => button.textContent.trim() === '继续生成'); if (continueButton) { continueButton.click(); remainingClicks -= 1; console.log('已点击“继续生成”按钮,剩余次数:'+remainingClicks); if (remainingClicks === 0) { clearInterval(continueIntervalId); // 停止定时器 console.log('完成9次“继续生成”按钮的点击'); // 等待30秒后,重新开始检查“立即生成”按钮 setTimeout(() => { if (!shouldStop) { isExecuting = false; // 清除标志,表示流程完成 checkAndClickGenerateButton(); } }, 30000); // 等待30000毫秒(30秒) } } else { console.log('未找到“继续生成”按钮,继续检查...'); } }, 10000); // 每次点击间隔1000毫秒(1秒) } // 添加一个自定义按钮来触发整个流程 function addCustomButtons() { const startButton = document.createElement('button'); startButton.textContent = '开始全流程'; startButton.style.position = 'fixed'; startButton.style.top = '10px'; startButton.style.left = '10px'; startButton.style.zIndex = '9999'; startButton.style.padding = '10px'; startButton.style.fontSize = '16px'; startButton.style.backgroundColor = 'lightblue'; startButton.style.border = '1px solid #000'; startButton.style.cursor = 'pointer'; startButton.addEventListener('click', () => { console.log('开始全流程'); shouldStop = false; // 确保流程可以开始 checkAndClickGenerateButton(); }); const stopButton = document.createElement('button'); stopButton.textContent = '停止全流程'; stopButton.style.position = 'fixed'; stopButton.style.top = '10px'; stopButton.style.left = '120px'; stopButton.style.zIndex = '9999'; stopButton.style.padding = '10px'; stopButton.style.fontSize = '16px'; stopButton.style.backgroundColor = 'lightcoral'; stopButton.style.border = '1px solid #000'; stopButton.style.cursor = 'pointer'; stopButton.addEventListener('click', () => { console.log('停止全流程'); shouldStop = true; // 设置停止标志 clearInterval(continueIntervalId); // 清除“继续生成”按钮的定时器 isExecuting = false; // 清除执行标志 }); document.body.appendChild(startButton); document.body.appendChild(stopButton); } // 添加自定义按钮 addCustomButtons(); })();