REWARDS GET

Bing Rewards Page Click

目前為 2024-09-11 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==

// @name         REWARDS GET

// @namespace    http://tampermonkey.net/

// @version      0.1.1

// @description  Bing Rewards Page Click

// @author       Dongge

// @match        https://rewards.bing.com/*

// @license MIT

// @icon         https://az15297.vo.msecnd.net/images/rewards.png

// @grant        none

// ==/UserScript==



(function() {

    'use strict';

      clickcards();//进去就得执行一回

    // Your code here...
    // 调用函数以设置定时任务
    schedule12TenTask();


})();

function schedule12TenTask() {
    const now = new Date();
    const targetTime = new Date(now.getFullYear(), now.getMonth(), now.getDate(), 12, 10, 0);

    // 如果当前时间已经超过今天的中午十二点十分,则设置到明天的中午十二点十分
    if (now >= targetTime) {
        targetTime.setDate(targetTime.getDate() + 1);
    }

    // 计算当前时间到目标时间的毫秒数
    const delay = targetTime - now;

    // 使用setTimeout设置定时器
    setTimeout(function() {
        console.log('现在是中午十二点十分,执行任务!');
        // 在这里放置你想要执行的代码
        clickcards();
    }, delay);
}

function clickcards(){
    const elements = document.querySelectorAll('.ds-card-sec.ng-scope');

    let currentIndex = 0; // 初始化索引



    // 检查是否找到了元素

    if (elements.length > 0) {

        // 设置第一次点击的延迟

        setTimeout(() => {

            const clickElements = () => {

                if (currentIndex < elements.length) {

                    elements[currentIndex].click();

                    console.log(`元素 ${currentIndex + 1} 被自动点击`);

                    currentIndex++; // 更新索引

                } else {

                    currentIndex = 0; // 如果所有元素都被点击过,重置索引

                }

                // 设置下一次点击的延迟

                if (currentIndex < elements.length) {

                    setTimeout(clickElements, 10000); // 10000毫秒 = 10秒

                }

            };

            clickElements(); // 开始点击元素

        }, 10000); // 10000毫秒 = 10秒

    } else {

        console.log('没有找到匹配的元素');

    }
}