您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Counts your real total friend requests on Roblox
当前为
// ==UserScript== // @name Roblox Real Friend Requests Counter // @namespace http://tampermonkey.net/ // @version 1.0 // @description Counts your real total friend requests on Roblox // @author mopsfl // @match *://*.roblox.com/* // @grant GM_setValue // @grant GM_getValue // @license MIT // ==/UserScript== (async function() { 'use strict'; function waitForElm(selector) { return new Promise(resolve => { if (document.querySelector(selector)) { return resolve(document.querySelector(selector)); } const observer = new MutationObserver(mutations => { if (document.querySelector(selector)) { observer.disconnect(); resolve(document.querySelector(selector)); } }); observer.observe(document.body, { childList: true, subtree: true }); }); } async function fetchFriendRequests(cursor = "") { const url = `https://friends.roblox.com/v1/my/friends/requests?sortOrder=Desc&limit=100${cursor ? `&cursor=${cursor}` : ""}`; const response = await fetch(url, { method: "GET", credentials: "include", }); if (!response.ok) { throw new Error(`HTTP error! Status: ${response.status}`); } return response.json(); } async function main() { const cachedData = GM_getValue("friendRequestCount", null); const now = new Date().getTime(); if (cachedData && now - cachedData.t < 5 * 60 * 1000) { console.log(`Using cached value: ${cachedData.v}`); waitForElm("#nav-friends > div.dynamic-width-item.align-right > span").then(el => { el.innerText = cachedData.v; }); return; } console.log("Fetching all friend requests! This may take a few seconds...") let length = 0; let cursor = ""; try { do { const response = await fetchFriendRequests(cursor); length += response.data.length; cursor = response.nextPageCursor; } while (cursor); GM_setValue("friendRequestCount", { v: length, t: now }); waitForElm("#nav-friends > div.dynamic-width-item.align-right > span").then(el => { el.innerText = length; }); console.log(`Total friend requests: ${length}`); } catch (error) { console.error("Error fetching friend requests:", error); } } main(); })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址