Minefun Fast Attack & Normal Mining

Tốc độ đánh siêu nhanh khi giữ chuột, không lỗi đập block

Voor het installeren van scripts heb je een extensie nodig, zoals Tampermonkey, Greasemonkey of Violentmonkey.

Voor het installeren van scripts heb je een extensie nodig, zoals {tampermonkey_link:Tampermonkey}.

Voor het installeren van scripts heb je een extensie nodig, zoals Tampermonkey of Violentmonkey.

Voor het installeren van scripts heb je een extensie nodig, zoals Tampermonkey of Userscripts.

Voor het installeren van scripts heb je een extensie nodig, zoals {tampermonkey_link:Tampermonkey}.

Voor het installeren van scripts heb je een gebruikersscriptbeheerder nodig.

(Ik heb al een user script manager, laat me het downloaden!)

Advertisement:

Voor het installeren van gebruikersstijlen heb je een extensie nodig, zoals {stylus_link:Stylus}.

Voor het installeren van gebruikersstijlen heb je een extensie nodig, zoals {stylus_link:Stylus}.

Voor het installeren van gebruikersstijlen heb je een extensie nodig, zoals {stylus_link:Stylus}.

Voor het installeren van gebruikersstijlen heb je een gebruikersstijlbeheerder nodig.

Voor het installeren van gebruikersstijlen heb je een gebruikersstijlbeheerder nodig.

Voor het installeren van gebruikersstijlen heb je een gebruikersstijlbeheerder nodig.

(Ik heb al een beheerder - laat me doorgaan met de installatie!)

Advertisement:

// ==UserScript==
// @name         Minefun Fast Attack & Normal Mining
// @namespace    http://tampermonkey.net/
// @version      2.0
// @description  Tốc độ đánh siêu nhanh khi giữ chuột, không lỗi đập block
// @author       Gemini
// @match        *://minefun.io/*
// @grant        none
// @run-at       document-start
// ==/UserScript==

(function() {
    'use strict';

    let isMouseDown = false;
    let attackInterval = null;
    
    // Tốc độ đánh siêu nhanh: Cứ mỗi 15 mili-giây ra 1 đòn (khoảng ~65 đòn/giây)
    // Bạn có thể giảm xuống 10 nếu muốn nhanh hơn nữa, nhưng <10 dễ bị server kick vì spam packet
    const ATTACK_SPEED = 15; 

    // Hàm thực hiện đòn đánh bằng cách mô phỏng click thuần cho hệ thống combat
    function performFastAttack() {
        const canvas = document.querySelector('canvas') || document.body;
        
        // Tạo sự kiện click độc lập với luồng giữ chuột đập block
        const clickEvent = new MouseEvent('click', {
            bubbles: true,
            cancelable: true,
            view: window,
            button: 0
        });
        canvas.dispatchEvent(clickEvent);
    }

    // Theo dõi trạng thái nhấn giữ chuột
    window.addEventListener('mousedown', (e) => {
        if (e.button === 0) { // Chuột trái
            isMouseDown = true;
            
            // Kích hoạt chuỗi đánh siêu nhanh ngay lập tức
            if (!attackInterval) {
                attackInterval = setInterval(() => {
                    if (isMouseDown) {
                        performFastAttack();
                    }
                }, ATTACK_SPEED);
            }
        }
    }, true);

    // Khi thả chuột ra thì ngừng đánh
    window.addEventListener('mouseup', (e) => {
        if (e.button === 0) {
            isMouseDown = false;
            clearInterval(attackInterval);
            attackInterval = null;
        }
    }, true);

    // Đề phòng trường hợp tab ra ngoài hoặc mất tiêu điểm chuột
    window.addEventListener('blur', () => {
        isMouseDown = false;
        clearInterval(attackInterval);
        attackInterval = null;
    });

    // --- ĐOẠN CODE PHỤ TRỢ: CHỐNG XUNG ĐỘT WEBOCKET (Nếu game dùng Packet) ---
    // Đoạn này giúp tách biệt lệnh click tấn công liên tục mà không chặn lệnh giữ chuột đập block của game
    const originalSend = WebSocket.prototype.send;
    WebSocket.prototype.send = function(data) {
        // Giữ nguyên tất cả các dữ liệu đập block và di chuyển gửi lên server
        return originalSend.apply(this, arguments);
    };

})();