// ==UserScript== // @name 枪神纪战令活动领取 // @namespace http://mywebsite.com // @version 4.2 // @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 instructionButton = document.createElement('button'); instructionButton.textContent = '使用说明'; instructionButton.style.cssText = ` margin-bottom: 10px; background-color:#5673D400; color: white; border: none; padding: 8px 16px; font-family: '微软雅黑', sans-serif; cursor: pointer; `; instructionButton.addEventListener('click', () => { showInstruction(); }); 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(); }); const oneClickButton = document.createElement('button'); oneClickButton.textContent = '一键领取'; oneClickButton.style.cssText = ` margin-bottom: 10px; background-color:#5673D400; color: white; border: none; padding: 8px 16px; font-family: '微软雅黑', sans-serif; cursor: pointer; `; oneClickButton.addEventListener('click', () => { clickOneClickButton(); }); const springButton = document.createElement('button'); springButton.textContent = '春日桃花(已过期)'; springButton.style.cssText = ` margin-bottom: 10px; background-color:#5673D400; color: white; border: none; padding: 8px 16px; font-family: '微软雅黑', sans-serif; cursor: pointer; `; springButton.addEventListener('click', () => { goToSpringPage(); }); const newButton = document.createElement('button'); newButton.textContent = '春光明媚白嫖活动'; newButton.style.cssText = ` margin-bottom: 10px; background-color:#5673D400; color: white; border: none; padding: 8px 16px; font-family: '微软雅黑', sans-serif; cursor: pointer; `; newButton.addEventListener('click', () => { goToNewPage(); }); buttonsContainer.appendChild(instructionButton); buttonsContainer.appendChild(taskButton); buttonsContainer.appendChild(oneClickButton); buttonsContainer.appendChild(springButton); buttonsContainer.appendChild(newButton); document.body.appendChild(buttonsContainer); } function showInstruction() { alert('使用说明:\n任务领取按钮单独领取每日任务 \n一键领取按钮领取任务包括等级奖励 \n白嫖活动自动领取自动兑换永久道具 \n 如有漏领自己改一下延迟 \n75折出点券 lx:qiqiqsj001'); } 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); } function clickOneClickButton() { // 模拟点击一键领取按钮 const script = document.createElement('script'); script.innerHTML = "goClaimPop();"; document.head.appendChild(script); // 执行任务领取按钮操作 setTimeout(function() { clickButtons(); }, delayBetweenActions); } function goToSpringPage() { const springPageURL = "https://tps.qq.com/cp/a20240228thddk/index.html?atm_cl=ad&atm_pos=20024"; const newWindow = window.open(springPageURL); setTimeout(function() { clickSpringPageButtons(newWindow); }, delayBetweenActions); } function clickSpringPageButtons(newWindow) { const buttons = newWindow.document.querySelectorAll('.dayTask1, .dayTask2, .dayTask3, [href="JavaScript:lotteryDraw();"], .exchangeLimit, .confirm-btn'); let index = 0; const clickNextButton = () => { if (index < buttons.length) { buttons[index].click(); index++; setTimeout(clickNextButton, delayBetweenActions); } else { // 关闭当前页面 newWindow.close(); } }; clickNextButton(); } function goToNewPage() { const newPageURL = "https://tps.qq.com/cp/a20240403tcj/index.html?atm_cl=ad&atm_pos=6092&e_code=541834"; const newWindow = window.open(newPageURL); setTimeout(function() { clickNewPageButtons(newWindow); }, delayBetweenActions); } function clickNewPageButtons(newWindow) { const buttons = newWindow.document.querySelectorAll('[href="javascript:leidneg(0);"], [href="javascript:leidneg(1);"], [href="javascript:meiri(0);"], [href="javascript:meiri(1);"], [href="javascript:duihuan(4);"]'); let index = 0; const clickNextButton = () => { if (index < buttons.length) { buttons[index].click(); index++; setTimeout(clickNextButton, delayBetweenActions); } else { // 关闭当前页面 newWindow.close(); } }; clickNextButton(); } createButtons(); })();