Script Hub

Fully collapsible Script Hub for all my scripts

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         Script Hub
// @namespace    http://tampermonkey.net/
// @version      2.0
// @description  Fully collapsible Script Hub for all my scripts
// @match        *://*/*
// @grant        none
// @run-at       document-end
// @license      All rights reserved. Copyright © 2026 Valhalla_Vikings
// You may not copy, distribute, or modify this script without permission.
// ==/UserScript==

(function () {
    'use strict';

    function createHub() {
        if (!document.body || document.getElementById("scriptHubUI")) return;

        const hub = document.createElement("div");
        hub.id = "scriptHubUI";
        hub.style.left = "20px";
        hub.style.top = "20px";

        hub.innerHTML = `
            <div id="shHeader">💾 Script Hub ▼</div>
            <div id="shContent">

                <div class="section">
                    <div class="sectionHeader">🎮 Games ▼</div>
                    <div class="sectionContent" id="gamesSection">
                        <!-- Add your game scripts here -->
                        <a href="https://greasyfork.org/en/scripts/570887-auto-clicker-game-mode" class="scriptLink" target="_blank">Auto Clicker-Game Mode</a>
<a href="https://greasyfork.org/en/scripts/570976-auto-clicker-game-mode-v-2" class="scriptLink" target="_blank">Auto Clicker-Game Mode V2</a>
                        <a href="https://greasyfork.org/en/scripts/570876-blooket-session-monitor" class="scriptLink" target="_blank">Blooket Session Monitor</a>
                    </div>
                </div>

                <div class="section">
                    <div class="sectionHeader">⚙️ General ▼</div>
                    <div class="sectionContent" id="generalSection">
                        <!-- Add your general scripts here -->
                        <a href="https://greasyfork.org/en/scripts/570857-auto-clicker-god-mode-adjustable-universal" class="scriptLink" target="_blank">Auto Clicker-God Mode</a>
                    </div>
                </div>

                <div class="section">
                    <div class="sectionHeader">📊 Performance ▼</div>
                    <div class="sectionContent" id="performanceSection">
                        <!-- Add your performance scripts here -->
                        <a href="https://greasyfork.org/en/scripts/570885-performance-hud-valhalla" class="scriptLink" target="_blank">Performance HUD Valhalla</a>
                    </div>
                </div>

                <div class="section">
                    <div class="sectionHeader">🗂 Other ▼</div>
                    <div class="sectionContent" id="otherSection">
                        <!-- Add your other scripts here -->
                        <a href="https://greasyfork.org/en/scripts/570888-script-hub" class="scriptLink" target="_blank">Script Hub</a>
                    </div>
                </div>

            </div>
        `;

        document.body.appendChild(hub);

        const style = document.createElement("style");
        style.textContent = `
            #scriptHubUI {
                position: fixed;
                width: 280px;
                font-family: monospace;
                background: #0a1b0a;
                border: 2px solid #660000;
                border-radius: 12px;
                color: #d9fff8;
                box-shadow: 0 0 15px #00ff5544, inset 0 0 10px #00ff5544;
                z-index: 999999;
            }
            #shHeader {
                padding: 10px;
                text-align: center;
                font-weight: bold;
                background: linear-gradient(90deg, #004d00, #002200);
                cursor: pointer;
                user-select: none;
            }
            #shContent { padding: 8px; font-size: 13px; }
            .section { margin-bottom: 8px; }
            .sectionHeader {
                font-weight: bold;
                cursor: pointer;
                padding: 4px;
                background: linear-gradient(90deg, #660000, #330000);
                border-radius: 6px;
            }
            .sectionContent { margin-left: 10px; margin-top: 4px; }
            .scriptLink {
                display: block;
                padding: 2px 0;
                color: #00ff88;
                text-decoration: none;
            }
            .scriptLink:hover { color: #aaffaa; }
        `;
        document.head.appendChild(style);

        // Collapse/expand the whole hub
        const header = hub.querySelector("#shHeader");
        const content = hub.querySelector("#shContent");
        content.style.display = "none"; // Start closed
        header.onclick = () => {
            content.style.display = content.style.display === "none" ? "block" : "none";
            header.textContent = content.style.display === "none" ? "💾 Script Hub ▼" : "💾 Script Hub ▲";
        };

        // Collapse/expand each section
        hub.querySelectorAll(".sectionHeader").forEach(secHeader => {
            const secContent = secHeader.nextElementSibling;
            secContent.style.display = "none"; // Start sections closed
            secHeader.onclick = () => {
                secContent.style.display = secContent.style.display === "none" ? "block" : "none";
                secHeader.textContent = secHeader.textContent.slice(0, -1) + (secContent.style.display === "none" ? "▼" : "▲");
            };
        });

        // Drag functionality
        let dragging = false, ox = 0, oy = 0;
        header.addEventListener("mousedown", e => {
            dragging = true;
            ox = e.clientX - hub.offsetLeft;
            oy = e.clientY - hub.offsetTop;
        });
        document.addEventListener("mousemove", e => {
            if (!dragging) return;
            hub.style.left = (e.clientX - ox) + "px";
            hub.style.top = (e.clientY - oy) + "px";
        });
        document.addEventListener("mouseup", () => dragging = false);
    }

    const wait = setInterval(() => {
        if (document.body) {
            clearInterval(wait);
            createHub();
        }
    }, 100);

})();