// ==UserScript==
// @name QSJZL
// @namespace http://mywebsite.com
// @version 2.0
// @description 点击任务按钮后自动帮您领取奖励,点击银币按钮后自动领取银币,点击等级按钮后自动领取对应等级的奖励
// @author 七七
// @match https://tps.qq.com/cp/a20231128qsjzl/index.html?atm_cl=ad&atm_pos=20022*
// @match https://tps.qq.com/cp/a20231128qsjzl/index.html?atm_cl=ad&atm_pos=6092*
// @grant none
// ==/UserScript==
(function() {
'use strict';
// 创建提示框
function createConfirmationDialog() {
var confirmationDialog = document.createElement('div');
confirmationDialog.style.position = 'fixed';
confirmationDialog.style.top = '10px';
confirmationDialog.style.left = '10px';
confirmationDialog.style.backgroundColor = '#1e90ff';
confirmationDialog.style.padding = '10px';
confirmationDialog.style.border = '1px solid #ccc';
confirmationDialog.style.zIndex = '9999';
confirmationDialog.innerHTML = '点击任务领取按钮后,将自动帮您领取任务奖励。
点击银币领取按钮后,将自动领取多余银币奖励。
点击等级领取按钮后,将自动领取对应等级奖励。
';
var confirmButton = document.createElement('button');
confirmButton.textContent = '任务领取';
confirmButton.style.marginTop = '10px';
confirmButton.addEventListener('click', function() {
clickButtons(); // 开始自动领取任务奖励
});
var silverButton = document.createElement('button');
silverButton.textContent = '银币领取';
silverButton.style.marginTop = '10px';
silverButton.addEventListener('click', function() {
clickSilverButton(); // 开始自动领取银币
});
var levelButton = document.createElement('button');
levelButton.textContent = '等级领取';
levelButton.style.marginTop = '10px';
levelButton.addEventListener('click', function() {
var levelRange = prompt('请输入要领取的等级区间(例如2-10):');
if (levelRange) {
var levels = levelRange.split('-');
if (levels.length === 2 && !isNaN(levels[0]) && !isNaN(levels[1])) {
clickLevelButtons(levels[0], levels[1]); // 开始自动领取等级区间的奖励
} else {
alert('请输入有效的等级区间(例如2-10)!');
}
} else {
alert('请输入等级区间!');
}
});
confirmationDialog.appendChild(confirmButton);
confirmationDialog.appendChild(silverButton);
confirmationDialog.appendChild(levelButton);
document.body.appendChild(confirmationDialog);
}
// 点击任务按钮函数
function clickButton(buttonIndex) {
var button = document.querySelector('.get-btn');
if (button) {
button.click();
// 等待一段时间后点击下一个按钮
setTimeout(function() {
button.classList.remove('get-btn');
button.classList.add('out-btn');
clickButton(buttonIndex + 1);
}, 2000); // 2000表示等待2秒
}
}
// 点击银币按钮函数
function clickSilverButton() {
var silverButton = document.querySelector('a[href="javascript:btnLingqu(\'LingquYl\');"]');
if (silverButton) {
silverButton.click();
}
}
// 点击等级按钮函数
function clickLevelButton(level) {
var levelButton = document.querySelector(`a[href="javascript:lingqu(${level});"]`);
if (levelButton) {
levelButton.click();
}
}
// 开始点击任务按钮
function clickButtons() {
clickButton(0);
}
// 点击等级区间的按钮
function clickLevelButtons(startLevel, endLevel) {
var currentLevel = startLevel;
var interval = setInterval(function() {
clickLevelButton(currentLevel);
if (currentLevel >= endLevel) {
clearInterval(interval);
}
currentLevel++;
}, 2000); // 2000表示等待2秒
}
// 创建提示框
createConfirmationDialog();
})();