// ==UserScript== // @name 枪神纪战令活动领取 // @namespace http://mywebsite.com // @version 4.0 // @description 自动领取任务和奖励 // @author 七七 // @match https://tps.qq.com/cp/a20240313yyhd/index.html* // @grant none // ==/UserScript== (function() { 'use strict'; const delayBetweenActions = 2000; // 操作之间的延迟(毫秒) function createButtons() { const buttonsContainer = document.createElement('div'); buttonsContainer.style.cssText = ` position: fixed; top: 13%; left: 0; transform: translateY(-50%); z-index: 9999; padding: 10px; font-family: '微软雅黑', sans-serif; display: flex; flex-direction: column; align-items: flex-start; `; const taskButton = document.createElement('button'); taskButton.textContent = '任务领取'; taskButton.style.cssText = ` margin-bottom: 10px; background-color:#5673D400; color: white; border: none; padding: 8px 16px; font-family: '微软雅黑', sans-serif; cursor: pointer; `; taskButton.addEventListener('click', () => { clickButtons(); }); buttonsContainer.appendChild(taskButton); document.body.appendChild(buttonsContainer); } function clickButton(buttonIndex) { const button = document.querySelector('.get-btn'); if (button) { button.click(); setTimeout(function() { button.classList.remove('get-btn'); button.classList.add('out-btn'); clickButton(buttonIndex + 1); }, delayBetweenActions); } } function clickButtons() { clickButton(0); } createButtons(); })();