您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Extract UIDs from Discord avatars and display them
当前为
// ==UserScript== // @name Discord UID Extractor // @namespace http://tampermonkey.net/ // @version 1.9 // @description Extract UIDs from Discord avatars and display them // @author Your Name // @match https://discord.com/* // @grant none // @license You can modify as long as you credit me // ==/UserScript== (function() { 'use strict'; function makeElementDraggable(el) { el.onmousedown = function(event) { event.preventDefault(); let shiftX = event.clientX - el.getBoundingClientRect().left; let shiftY = event.clientY - el.getBoundingClientRect().top; function moveAt(pageX, pageY) { el.style.left = Math.min(Math.max(0, pageX - shiftX), window.innerWidth - el.offsetWidth) + 'px'; el.style.top = Math.min(Math.max(0, pageY - shiftY), window.innerHeight - el.offsetHeight) + 'px'; } function onMouseMove(event) { moveAt(event.pageX, event.pageY); } document.addEventListener('mousemove', onMouseMove); el.onmouseup = function() { document.removeEventListener('mousemove', onMouseMove); el.onmouseup = null; }; }; el.ondragstart = function() { return false; }; } function addResizeButtons(el, initialWidth, initialHeight) { const buttonContainer = document.createElement('div'); buttonContainer.style.position = 'absolute'; buttonContainer.style.right = '10px'; buttonContainer.style.top = '10px'; buttonContainer.style.display = 'flex'; buttonContainer.style.flexDirection = 'column'; buttonContainer.style.gap = '10px'; el.appendChild(buttonContainer); const enlargeButton = document.createElement('button'); enlargeButton.textContent = '🔍+'; enlargeButton.style.padding = '5px 10px'; enlargeButton.style.backgroundColor = '#4CAF50'; enlargeButton.style.color = '#ffffff'; enlargeButton.style.border = 'none'; enlargeButton.style.borderRadius = '3px'; enlargeButton.style.cursor = 'pointer'; buttonContainer.appendChild(enlargeButton); const shrinkButton = document.createElement('button'); shrinkButton.textContent = '🔍-'; shrinkButton.style.padding = '5px 10px'; shrinkButton.style.backgroundColor = '#f44336'; shrinkButton.style.color = '#ffffff'; shrinkButton.style.border = 'none'; shrinkButton.style.borderRadius = '3px'; shrinkButton.style.cursor = 'pointer'; buttonContainer.appendChild(shrinkButton); enlargeButton.addEventListener('click', () => { el.style.height = (el.clientHeight + 20) + 'px'; }); shrinkButton.addEventListener('click', () => { el.style.width = initialWidth; el.style.height = initialHeight; }); } const initialWidth = '280px'; const initialHeight = '80px'; const container = document.createElement('div'); container.id = 'uidContainer'; container.style.position = 'fixed'; container.style.top = '10px'; container.style.left = '10px'; container.style.backgroundColor = '#2f3136'; container.style.color = '#ffffff'; container.style.padding = '10px'; container.style.borderRadius = '5px'; container.style.zIndex = '1000'; container.style.width = initialWidth; container.style.height = initialHeight; container.style.overflowY = 'scroll'; document.body.appendChild(container); makeElementDraggable(container); addResizeButtons(container, initialWidth, initialHeight); const title = document.createElement('h2'); title.textContent = 'Extracted UIDs'; title.style.margin = '0 0 10px 0'; title.style.fontSize = '16px'; container.appendChild(title); const uidList = document.createElement('ul'); uidList.style.listStyleType = 'none'; uidList.style.padding = '0'; container.appendChild(uidList); const startButton = document.createElement('button'); startButton.textContent = 'Start Extraction'; startButton.style.marginTop = '10px'; startButton.style.padding = '5px 10px'; startButton.style.backgroundColor = '#7289da'; startButton.style.color = '#ffffff'; startButton.style.border = 'none'; startButton.style.borderRadius = '3px'; startButton.style.cursor = 'pointer'; container.appendChild(startButton); const copyButton = document.createElement('button'); copyButton.textContent = 'Copy UIDs'; copyButton.style.marginTop = '10px'; copyButton.style.padding = '5px 10px'; copyButton.style.backgroundColor = '#7289da'; copyButton.style.color = '#ffffff'; copyButton.style.border = 'none'; copyButton.style.borderRadius = '3px'; copyButton.style.cursor = 'pointer'; container.appendChild(copyButton); function extractUIDs() { const avatarElements = document.querySelectorAll('img[src*="cdn.discordapp.com/avatars/"]'); const uids = new Set(); avatarElements.forEach(img => { const url = img.src; const match = url.match(/avatars\/(\d+)\//); if (match) { uids.add(match[1]); } }); return Array.from(uids); } function updateUIDList() { const uids = extractUIDs(); uids.forEach(uid => { if (!Array.from(uidList.children).some(li => li.textContent === uid)) { const listItem = document.createElement('li'); listItem.textContent = uid; uidList.appendChild(listItem); } }); } function copyUIDsToClipboard() { const uids = Array.from(uidList.children).map(li => li.textContent).join('\n'); navigator.clipboard.writeText(uids).then(() => { }).catch(err => { console.error('Failed to copy UIDs: ', err); }); } startButton.addEventListener('click', () => { updateUIDList(); const observer = new MutationObserver(() => { setTimeout(updateUIDList, 1000); }); observer.observe(document.body, { childList: true, subtree: true }); }); copyButton.addEventListener('click', copyUIDsToClipboard); })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址