Knolix Auto Coin Collector

Collect coins automatically, click home after harvest page, and check tree every minute.

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

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

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name         Knolix Auto Coin Collector
// @namespace    http://tampermonkey.net/
// @description  Collect coins automatically, click home after harvest page, and check tree every minute.
// @version      2.4
// @author       Rubystance
// @license      MIT
// @match        https://knolix.com/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    if (typeof window.Fingerprint2 === "undefined") {
        window.Fingerprint2 = { get: function(cb){ try{ cb([], []); } catch(e){} } };
        console.log("[Tampermonkey] Fake Fingerprint2 injected.");
    }

    if (typeof window.Recaptcha === "undefined") {
        window.Recaptcha = {
            execute: function(){ console.log("[Tampermonkey] Fake Recaptcha.execute called."); return Promise.resolve("fake-token"); },
            getResponse: function(){ return "fake-token"; },
            reset: function(){ console.log("[Tampermonkey] Fake Recaptcha.reset called."); },
            reload: function(){ console.log("[Tampermonkey] Fake Recaptcha.reload called."); }
        };
        console.log("[Tampermonkey] Fake Recaptcha injected.");
    }

    function triggerClick(element){
        if(!element) return;
        let event = new MouseEvent('click', { view: window, bubbles: true, cancelable: true });
        element.dispatchEvent(event);
    }

    function autoCollect(){
        const MIN_COIN_SIZE = 30;
        let coins = document.querySelectorAll(".coin, img[src*='coin'], .coin-animation");
        coins.forEach(coin => {
            if(coin.offsetParent !== null){
                let rect = coin.getBoundingClientRect();
                if(rect.width >= MIN_COIN_SIZE && rect.height >= MIN_COIN_SIZE){
                    triggerClick(coin);
                    console.log(`[Tampermonkey] Big coin clicked! Size: ${rect.width}x${rect.height}`);
                }
            }
        });
    }

    function handleHarvestPage(){
        if(window.location.href.includes("/harvest.php?reward_token")){
            let homeBtn = document.querySelector("i.fas.fa-home");
            if(homeBtn){
                triggerClick(homeBtn);
                console.log("[Tampermonkey] Harvest page: Home button clicked!");
            }
        }
    }

    function checkTree(){

        let treeBtn = document.querySelector(".tree, #check-tree, .tree-button");
        if(treeBtn){
            triggerClick(treeBtn);
            console.log("[Tampermonkey] Tree checked!");
        } else {
            console.log("[Tampermonkey] Tree button not found, reloading page...");
            window.location.reload();
        }
    }

    setInterval(autoCollect, 3000);
    setInterval(handleHarvestPage, 2000);
    setInterval(checkTree, 60000);

})();