Knolix Auto Tree Click and Home Click Loop

Click on the bitcoin tree every 20 minutes and then click home on knolix.com with infinite loop

当前为 2025-07-24 提交的版本,查看 最新版本

// ==UserScript==
// @name         Knolix Auto Tree Click and Home Click Loop
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  Click on the bitcoin tree every 20 minutes and then click home on knolix.com with infinite loop
// @author       PixelHash
// @license      MIT
// @match        https://knolix.com/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    const CLICK_INTERVAL = 20 * 60 * 1000; // 20 minutes

    function doubleClickTree() {
        const tree = document.getElementById('btctree');
        if (!tree) {
            console.log('Tree element not found');
            return false;
        }
        tree.click();
        setTimeout(() => tree.click(), 100);
        console.log('Double clicked the tree at', new Date().toLocaleTimeString());
        return true;
    }

    function clickHomeLink() {
        const homeLink = document.querySelector('a[href="/"].navlink.w-nav-link');
        if (homeLink) {
            homeLink.click();
            console.log('Clicked home link at', new Date().toLocaleTimeString());
        } else {
            console.log('Home link not found');
        }
    }

    function cycleClicks() {
        if (doubleClickTree()) {
            setTimeout(() => {
                clickHomeLink();
                setTimeout(cycleClicks, CLICK_INTERVAL);
            }, 3000);
        } else {
            console.log('Retrying in 1 minute...');
            setTimeout(cycleClicks, 60 * 1000);
        }
    }

    window.addEventListener('load', () => {
        // Start cycle 20 minutes after page load
        setTimeout(cycleClicks, CLICK_INTERVAL);
    });

})();