☰

SwordMasters.io - Custom UI Panel

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

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

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

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği indirebilmeniz için ayrıca Tampermonkey gibi bir eklenti kurmanız gerekmektedir.

Bu betiği yüklemek için bir betik yöneticisi eklentisi yüklemeniz gerekecektir.

(Zaten bir betik yöneticim var, hadi yükleyelim!)

Bu stili yüklemek için Stylus gibi bir uzantı yüklemeniz gerekir.

Bu stili yüklemek için Stylus gibi bir uzantı kurmanız gerekir.

Bu stili yükleyebilmek için Stylus gibi bir uzantı yüklemeniz gerekir.

Bu stili yüklemek için bir kullanıcı stili yöneticisi uzantısı yüklemeniz gerekir.

Bu stili yüklemek için bir kullanıcı stili yöneticisi uzantısı kurmanız gerekir.

Bu stili yükleyebilmek için bir kullanıcı stili yöneticisi uzantısı yüklemeniz gerekir.

(Zateb bir user-style yöneticim var, yükleyeyim!)

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

})();