Knolix Auto Coin Collector

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

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey, το Greasemonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Userscripts για να εγκαταστήσετε αυτόν τον κώδικα.

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

Θα χρειαστεί να εγκαταστήσετε μια επέκταση διαχείρισης κώδικα χρήστη για να εγκαταστήσετε αυτόν τον κώδικα.

(Έχω ήδη έναν διαχειριστή κώδικα χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

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.

(Έχω ήδη έναν διαχειριστή στυλ χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

// ==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);

})();