SwordMasters.io - Custom UI Panel

Panel kéo được + On/Off + Slider (UI only, safe)

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

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

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

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

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

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.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name         SwordMasters.io - Custom UI Panel
// @namespace    https://greasyfork.org/
// @version      2.0
// @description  Panel kéo được + On/Off + Slider (UI only, safe)
// @match        https://swordmasters.io/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    let value = 50;
    let isEnabled = false;

    const panel = document.createElement('div');
    panel.style.cssText = `
        position: fixed; left: 30px; top: 30px; z-index: 999999;
        background: rgba(0,0,0,0.85); color: white; padding: 15px;
        border-radius: 12px; font-family: Arial; width: 250px;
    `;

    panel.innerHTML = `
        <div style="font-weight:bold; margin-bottom:10px;">⚔️ Custom Panel</div>
        <div id="status">OFF</div>

        <input type="range" id="slider" min="1" max="100" value="${value}">
        <div>Value: <span id="val">${value}</span></div>

        <button id="btn">BẬT</button>
    `;

    document.body.appendChild(panel);

    const slider = panel.querySelector('#slider');
    const val = panel.querySelector('#val');
    const btn = panel.querySelector('#btn');
    const status = panel.querySelector('#status');

    slider.oninput = () => {
        value = slider.value;
        val.textContent = value;
    };

    btn.onclick = () => {
        isEnabled = !isEnabled;
        status.textContent = isEnabled ? "ON" : "OFF";
    };

    // drag
    let drag = false, x, y;

    panel.onmousedown = (e) => {
        drag = true;
        x = e.clientX - panel.offsetLeft;
        y = e.clientY - panel.offsetTop;
    };

    document.onmousemove = (e) => {
        if (drag) {
            panel.style.left = (e.clientX - x) + "px";
            panel.style.top = (e.clientY - y) + "px";
        }
    };

    document.onmouseup = () => drag = false;

})();