SwordMaster.io Speed Attack UI

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

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

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

(Tôi đã có Trình quản lý tập lệnh người dùng, hãy cài đặt nó!)

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.

(I already have a user style manager, let me install it!)

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

})();