ueuyegf

1 click = 2 clicks, with UI and proper CPS control

이 스크립트를 설치하려면 Tampermonkey, Greasemonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey와 같은 확장 프로그램을 설치해야 합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Userscripts와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 유저 스크립트 관리자 확장 프로그램이 필요합니다.

(이미 유저 스크립트 관리자가 설치되어 있습니다. 설치를 진행합니다!)

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

(이미 유저 스타일 관리자가 설치되어 있습니다. 설치를 진행합니다!)

// ==UserScript==
// @name         ueuyegf
// @namespace    https://greasyfork.org/users/yourname
// @version      1.1
// @description  1 click = 2 clicks, with UI and proper CPS control
// @match        *://*/*
// @run-at       document-end
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    let enabled = false;
    let toggleKey = "KeyG"; // Press G to toggle
    let menuVisible = true;

    // Cooldown to prevent 500 CPS spam
    let lastClickTime = 0;
    const cooldown = 50; // ms — prevents multiple duplicates per real click

    // --- UI CREATION ---
    const ui = document.createElement("div");
    ui.style = `
        position: fixed;
        top: 20px;
        left: 20px;
        width: 180px;
        padding: 12px;
        background: rgba(20,20,20,0.85);
        color: white;
        font-family: sans-serif;
        border-radius: 10px;
        z-index: 999999;
        backdrop-filter: blur(6px);
        border: 1px solid #444;
        user-select: none;
        transition: opacity 0.2s ease;
    `;
    ui.innerHTML = `
        <div style="font-size:16px; margin-bottom:8px; font-weight:600;">
            DoubleClick UI
        </div>

        <div style="margin-bottom:6px;">
            <b>Status:</b> <span id="dc-status" style="color:#f55;">OFF</span>
        </div>

        <div style="margin-bottom:6px;">
            <b>Toggle Key:</b> G
        </div>

        <div style="margin-bottom:6px;">
            <b>Hide Menu:</b> ArrowDown
        </div>

        <button id="dc-toggle" style="
            width:100%;
            padding:6px;
            background:#333;
            color:white;
            border:1px solid #555;
            border-radius:6px;
            cursor:pointer;
        ">Enable</button>
    `;
    document.body.appendChild(ui);

    const statusEl = ui.querySelector("#dc-status");
    const toggleBtn = ui.querySelector("#dc-toggle");

    // --- DRAGGABLE UI ---
    let dragging = false, offsetX = 0, offsetY = 0;

    ui.addEventListener("mousedown", e => {
        dragging = true;
        offsetX = e.clientX - ui.offsetLeft;
        offsetY = e.clientY - ui.offsetTop;
    });

    document.addEventListener("mousemove", e => {
        if (!dragging) return;
        ui.style.left = (e.clientX - offsetX) + "px";
        ui.style.top = (e.clientY - offsetY) + "px";
    });

    document.addEventListener("mouseup", () => dragging = false);

    // --- TOGGLE LOGIC ---
    function updateUI() {
        if (enabled) {
            statusEl.textContent = "ON";
            statusEl.style.color = "#5f5";
            toggleBtn.textContent = "Disable";
        } else {
            statusEl.textContent = "OFF";
            statusEl.style.color = "#f55";
            toggleBtn.textContent = "Enable";
        }
    }

    toggleBtn.onclick = () => {
        enabled = !enabled;
        updateUI();
    };

    document.addEventListener("keydown", e => {
        if (e.code === toggleKey) {
            enabled = !enabled;
            updateUI();
        }

        // ArrowDown hides/shows menu
        if (e.code === "ArrowDown") {
            menuVisible = !menuVisible;
            ui.style.opacity = menuVisible ? "1" : "0";
            ui.style.pointerEvents = menuVisible ? "auto" : "none";
        }
    });

    // --- DOUBLE CLICK LOGIC ---
    window.addEventListener("click", function(e) {
        if (!enabled) return;

        const now = performance.now();

        // Prevent multiple duplicates from bubbling
        if (now - lastClickTime < cooldown) return;
        lastClickTime = now;

        // Fire 1 extra synthetic click
        const c1 = new MouseEvent("click", {
            bubbles: true,
            cancelable: true,
            clientX: e.clientX,
            clientY: e.clientY
        });

        e.target.dispatchEvent(c1);
    }, true);

})();