Discord AutoQuest

Automatically completes Discord Quests — free, fast, and reliable!

// ==UserScript==
// @name         Discord AutoQuest
// @name:vi      Discord Tự Động Làm Nhiệm Vụ
// @name:es      Discord AutoMisión
// @name:ja      Discord自動クエスト
// @name:ko      디스코드 자동퀘스트
// @namespace    https://discord.gg/Gvmd7deFtS
// @version      1.0
// @description  Automatically completes Discord Quests — free, fast, and reliable!
// @description:vi Tự động làm nhiệm vụ Discord miễn phí — nhanh chóng và hiệu quả!
// @description:es Completa misiones de Discord automáticamente — gratis, rápido y confiable!
// @description:ja 無料でDiscordクエストを自動的に完了します。高速で信頼できます!
// @description:ko 무료로 Discord 퀘스트를 자동으로 완료합니다 — 빠르고 안정적!
// @author       DuoHacker Community
// @author       tw1sk
// @license      MIT
// @homepage     https://discord.gg/Gvmd7deFtS
// @supportURL   https://discord.gg/Gvmd7deFtS
// @match        *://*.discord.com/*
// @icon         https://i.ibb.co/SXWR8nkN/uok.png
// @grant        GM_addStyle
// @grant        GM_xmlhttpRequest
// @connect      raw.githubusercontent.com
// @run-at       document-end
// ==/UserScript==

(function() {
    'use strict';

    // PLSS DONT CHANGEEEE
    const DEFAULT_EXECUTE_URL = "https://raw.githubusercontent.com/pillowslua/TampermonkeyProjects/refs/heads/main/user.txt";
    const DEFAULT_TUTORIAL_URL = "https://discord.com/invite/Gvmd7deFtS";
    const DEFAULT_CREDIT_URL = "https://raw.githubusercontent.com/pillowslua/TampermonkeyProjects/refs/heads/main/cre.txt";
    // ===========================================================

    // === Styles (glass blur, Roblox-like) ===
    GM_addStyle(`
    .daq-hub {
        position: fixed;
        top: 100px;
        left: 100px;
        width: 540px;
        height: 340px;
        background: linear-gradient(180deg, rgba(24,24,24,0.76), rgba(12,12,12,0.64));
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border-radius: 10px;
        border: 1px solid rgba(255,255,255,0.06);
        box-shadow: 0 14px 36px rgba(0,0,0,0.6);
        color: #e9eef3;
        font-family: "Segoe UI", Roboto, Arial, sans-serif;
        z-index: 2147483647;
        display: flex;
        overflow: hidden;
        user-select: none;
    }
    .daq-sidebar {
        width: 150px;
        background: linear-gradient(180deg, rgba(14,14,14,0.94), rgba(8,8,8,0.9));
        border-right: 1px solid rgba(255,255,255,0.03);
        padding: 14px;
        box-sizing: border-box;
        display:flex;
        flex-direction:column;
        align-items:center;
    }
    .daq-logo { text-align:center; font-weight:800; font-size:15px; margin-bottom:10px; color:#f5f5f5; }
    .daq-tab { padding: 9px 8px; margin: 6px 0; border-radius:8px; text-align:center; cursor:pointer; font-weight:700; transition: transform .08s, background .12s; width:100%; }
    .daq-tab:hover { transform: translateY(-2px); }
    .daq-tab.active { background: linear-gradient(90deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02)); box-shadow: inset 0 -1px 0 rgba(255,255,255,0.02); }
    .daq-content { flex:1; padding:16px; position:relative; box-sizing:border-box; }
    .daq-header { position:absolute; top:8px; left:50%; transform:translateX(-50%); height:30px; line-height:30px; padding:0 12px; background: rgba(255,255,255,0.03); border-radius:6px; cursor:move; font-weight:800; z-index:2; }
    .daq-ops { position:absolute; right:10px; top:6px; display:flex; gap:8px; z-index:3; }
    .daq-icon { width:28px; height:28px; display:inline-flex; align-items:center; justify-content:center; border-radius:6px; cursor:pointer; font-weight:700; color:#ddd; }
    .daq-icon:hover { background: rgba(255,255,255,0.03); color:#fff; transform: translateY(-2px); }
    .daq-close { font-size:14px; padding:4px 6px; }
    .daq-button { width:100%; padding:10px 12px; margin:8px 0; background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01)); border:1px solid rgba(255,255,255,0.04); color:#fff; border-radius:8px; font-size:13px; cursor:pointer; text-align:left; transition: transform .08s, background .12s; }
    .daq-button:hover { transform: translateY(-3px); background: rgba(255,255,255,0.06); }
    .daq-title { color:#bfc7d1; font-size:13px; margin:6px 0 10px 0; font-weight:700; }
    .daq-small { font-size:12px; color:#aab3bd; }
    .daq-modal { position:fixed; left:50%; top:50%; transform:translate(-50%,-50%); width:760px; max-height:70vh; overflow:auto; background: #0f0f10; border-radius:10px; border:1px solid rgba(255,255,255,0.06); box-shadow:0 20px 60px rgba(0,0,0,0.7); z-index:2147483650; padding:12px; color:#eaeaea; }
    .daq-modal pre { white-space:pre-wrap; word-break:break-word; font-family:monospace; font-size:12px; background:rgba(0,0,0,0.6); padding:10px; border-radius:6px; max-height:58vh; overflow:auto; }
    .daq-modal .row { display:flex; gap:8px; margin-top:10px; }
    .daq-modal .btn { padding:8px 10px; border-radius:6px; cursor:pointer; font-weight:700; }
    `);

    // === Build HTML ===
    const hub = document.createElement('div');
    hub.className = 'daq-hub';
    hub.innerHTML = `
        <div class="daq-sidebar">
            <div class="daq-logo">Discord AutoQuest</div>
            <div class="daq-tab active" data-tab="main">Main</div>
            <div class="daq-tab" data-tab="credit">Credits</div>
        </div>
        <div class="daq-content">
            <div class="daq-header" id="daq-drag">Discord AutoQuest</div>
            <div class="daq-ops">
                <div class="daq-icon" id="daq-close" title="Close">✕</div>
            </div>

            <div id="tab-main" class="daq-tabpane">
                <div class="daq-title">Main Actions</div>
                <button class="daq-button" id="btn-doquest">Do Quest</button>
                <button class="daq-button" id="btn-tutorial">Tutorial</button>
                <div class="daq-small" style="margin-top:8px;">Please don't change any links if you want this script work probably🥰</div>
            </div>

            <div id="tab-credit" class="daq-tabpane" style="display:none;">
                <div class="daq-title">Credits</div>
                <button class="daq-button" id="btn-credits">Credits</button>
            </div>
        </div>
    `;
    document.body.appendChild(hub);

    // === Drag functionality ===
    const handle = hub.querySelector('#daq-drag');
    let dragging = false, dx = 0, dy = 0;
    handle.addEventListener('mousedown', (e) => {
        dragging = true;
        dx = e.clientX - hub.offsetLeft;
        dy = e.clientY - hub.offsetTop;
        handle.style.cursor = 'grabbing';
    });
    document.addEventListener('mousemove', (e) => {
        if (!dragging) return;
        hub.style.left = Math.max(8, e.clientX - dx) + 'px';
        hub.style.top = Math.max(8, e.clientY - dy) + 'px';
    });
    document.addEventListener('mouseup', () => { dragging = false; handle.style.cursor = 'grab'; });

    // === Close button ===
    hub.querySelector('#daq-close').addEventListener('click', () => hub.remove());

    // === Tab switch ===
    const tabEls = hub.querySelectorAll('.daq-tab');
    tabEls.forEach(t => {
        t.addEventListener('click', () => {
            tabEls.forEach(x => x.classList.remove('active'));
            t.classList.add('active');
            const name = t.getAttribute('data-tab');
            hub.querySelectorAll('.daq-tabpane').forEach(p => p.style.display = 'none');
            if (name === 'main') hub.querySelector('#tab-main').style.display = 'block';
            else hub.querySelector('#tab-credit').style.display = 'block';
        });
    });

    // === GM fetch helper ===
    function gmFetch(url) {
        return new Promise((resolve, reject) => {
            try {
                GM_xmlhttpRequest({
                    method: "GET",
                    url,
                    headers: { "Cache-Control": "no-cache" },
                    onload(res) {
                        if (res.status >= 200 && res.status < 400) resolve(res.responseText);
                        else reject(new Error('HTTP ' + res.status));
                    },
                    onerror(err) { reject(err); },
                    ontimeout() { reject(new Error('timeout')); }
                });
            } catch (e) {
                reject(e);
            }
        });
    }

    // === inject via blob to avoid inline-CSP blocks (if blob: allowed) ===
    function injectScriptBlob(code, filename = 'discord-autoquest-injected.js') {
        try {
            const blob = new Blob([`// ${filename}\n${code}`], { type: 'text/javascript' });
            const blobUrl = URL.createObjectURL(blob);
            const s = document.createElement('script');
            s.type = 'text/javascript';
            s.src = blobUrl;
            s.async = false;
            s.onload = () => {
                setTimeout(() => {
                    try { URL.revokeObjectURL(blobUrl); } catch (e) {}
                    if (s.parentNode) s.parentNode.removeChild(s);
                }, 50);
            };
            s.onerror = (ev) => {
                try { URL.revokeObjectURL(blobUrl); } catch (e) {}
                if (s.parentNode) s.parentNode.removeChild(s);
                console.error('[Discord AutoQuest] Blob injection failed (CSP).', ev);
                alert('Blob injection failed — the page may block blob: in CSP. Script not executed.');
            };
            (document.head || document.documentElement).appendChild(s);
        } catch (e) {
            console.error('[Discord AutoQuest] inject error:', e);
            alert('Injection failed: ' + e);
        }
    }

    // === Button actions ===

    // Do Quest -> fetch DEFAULT_EXECUTE_URL and inject (with confirm)
    hub.querySelector('#btn-doquest').addEventListener('click', async () => {
        const url = DEFAULT_EXECUTE_URL;
        const ok = confirm('Do you want to start doing quest?');
        if (!ok) return;
        try {
            const txt = await gmFetch(url);
            console.log('[Discord AutoQuest] fetched script length:', txt.length, 'from', url);
            injectScriptBlob(txt, 'discord-autoquest-remote.js');
            alert('Successfully execute DoQuest API.');
        } catch (err) {
            console.error('[Discord AutoQuest] fetch error:', err);
            alert('Error fetching script: ' + err);
        }
    });

    // Tutorial -> open in new tab
    hub.querySelector('#btn-tutorial').addEventListener('click', () => {
        window.open(DEFAULT_TUTORIAL_URL, '_blank');
    });

    // Credits -> open in new tab
    hub.querySelector('#btn-credits').addEventListener('click', () => {
        window.open(DEFAULT_CREDIT_URL, '_blank');
    });

    // Log ready
    console.log('[Discord AutoQuest] UI injected. DEFAULT_EXECUTE_URL =', DEFAULT_EXECUTE_URL);
})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址