SwordMaster.io Speed Attack UI

Tăng tốc độ đánh từ 1x đến 5x với giao diện tùy chỉnh

Dovrai installare un'estensione come Tampermonkey, Greasemonkey o Violentmonkey per installare questo script.

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

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Userscripts per installare questo script.

Dovrai installare un'estensione come ad esempio Tampermonkey per installare questo script.

Dovrai installare un gestore di script utente per installare questo script.

(Ho già un gestore di script utente, lasciamelo installare!)

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

(Ho già un gestore di stile utente, lasciamelo installare!)

// ==UserScript==
// @name         SwordMaster.io Speed Attack UI
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  Tăng tốc độ đánh từ 1x đến 5x với giao diện tùy chỉnh
// @author       Gemini AI
// @match        *://swordmaster.io/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    // --- CẤU CẤU HÌNH GIAO DIỆN ---
    const container = document.createElement('div');
    container.style = `
        position: fixed; top: 20px; right: 20px; z-index: 9999;
        background: rgba(0, 0, 0, 0.8); color: white; padding: 15px;
        border-radius: 10px; font-family: Arial, sans-serif;
        display: none; border: 1px solid #ffcc00; width: 200px;
    `;

    const toggleBtn = document.createElement('div');
    toggleBtn.innerText = '⚔️';
    toggleBtn.style = `
        position: fixed; top: 20px; right: 20px; z-index: 10000;
        background: #ffcc00; padding: 10px; border-radius: 50%;
        cursor: pointer; font-size: 20px; box-shadow: 0 0 10px rgba(0,0,0,0.5);
    `;

    const title = document.createElement('div');
    title.innerText = 'Attack Speed: 1x';
    title.style = 'margin-bottom: 10px; font-weight: bold; text-align: center;';

    const slider = document.createElement('input');
    slider.type = 'range'; slider.min = '1'; slider.max = '5'; slider.value = '1';
    slider.style = 'width: 100%; cursor: pointer;';

    container.appendChild(title);
    container.appendChild(slider);
    document.body.appendChild(toggleBtn);
    document.body.appendChild(container);

    // --- LOGIC ĐIỀU KHIỂN ---
    let attackMultiplier = 1;

    // Ẩn/Hiện bảng điều khiển
    toggleBtn.onclick = () => {
        container.style.display = container.style.display === 'none' ? 'block' : 'none';
    };

    slider.oninput = () => {
        attackMultiplier = parseInt(slider.value);
        title.innerText = `Attack Speed: ${attackMultiplier}x`;
    };

    // --- LOGIC CAN THIỆP GAME ---
    // Script sẽ cố gắng ghi đè hoặc gọi liên tục hàm tấn công dựa trên hệ số nhân
    function autoAttack() {
        // Gửi lệnh tấn công nhiều lần dựa trên multiplier
        // 5x sẽ tương đương với việc gửi lệnh gần như liên tục
        for (let i = 0; i < attackMultiplier; i++) {
            // Mô phỏng sự kiện click chuột hoặc gọi hàm attack của game
            const canvas = document.querySelector('canvas');
            if (canvas) {
                canvas.dispatchEvent(new MouseEvent('mousedown', { bubbles: true, clientX: window.innerWidth/2, clientY: window.innerHeight/2 }));
                canvas.dispatchEvent(new MouseEvent('mouseup', { bubbles: true }));
            }
        }
        
        // Điều chỉnh tần suất lặp lại: 100ms là tốc độ ổn định, 5x sẽ dồn damage rất nhanh
        setTimeout(autoAttack, 100 / attackMultiplier);
    }

    // Chạy script
    autoAttack();

})();