枪神纪战令活动领取
// ==UserScript==
// @name 枪神纪战令活动领取
// @namespace http://mywebsite.com
// @version 5.1
// @description 自动领取任务和奖励
// @author 七七
// @match https://tps.qq.com/cp/a20240914yyhd/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 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(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 goToNewPage() {
const newPageURL = "https://tps.qq.com/cp/a20240903gift/index.html?atm_cl=ad&atm_pos=20023";
const newWindow = window.open(newPageURL);
setTimeout(function() {
clickNewPageButtons(newWindow);
}, delayBetweenActions);
}
function clickNewPageButtons(newWindow) {
const buttons = newWindow.document.querySelectorAll('[href="javascript:xiangjianli(1);"], [href="javascript:xiangjianli(2);"], [href="javascript:xiangjianli(3);"], [href="javascript:xiangjianli(4);"], [href="javascript:xiangjianli(5);"], [href="javascript:xiandingli();"], [href="javascript:zuozhanli(1);"], [href="javascript:zuozhanli(2);"], [href="javascript:zheguili();"],[href="javascript:xiangsili(4);"]');
let index = 0;
const clickNextButton = () => {
if (index < buttons.length) {
buttons[index].click();
index++;
setTimeout(clickNextButton, delayBetweenActions);
} else {
newWindow.close();
}
};
clickNextButton();
}
createButtons();
})();