Greasy Fork 支持简体中文。

图寻pro插件(一键5k)

按1可以直接5k,按2自动偏移,按3助您轻松获胜!

// ==UserScript==
// @name         图寻pro插件(一键5k)
// @namespace    https://tuxun.fun/
// @version      1.0.0
// @description  按1可以直接5k,按2自动偏移,按3助您轻松获胜!
// @author       User
// @match        *://tuxun.fun/replay-pano?gameId=*
// @icon         https://s2.loli.com/4nqsveVoH8A1mTB.jpg
// @license      MIT
// ==/UserScript==
let switchCount = 0;
const MAX_SWITCHES = 6;

function detectScreenSwitch() {
    document.addEventListener('visibilitychange', () => {
        if (document.visibilityState === 'hidden') {
            switchCount++;

            console.log(`aa: ${switchCount}`);

            if (switchCount > MAX_SWITCHES) {
                console.log('...');
                fetchUserReport().then(response => {
                    console.log('API 响应:', response);
                }).catch(error => {
                    console.error('请求失败:', error);
                });
            }
        }
    });
}
detectScreenSwitch();
async function fetchUserReport() {
    const currentUrl = window.location.href;
    const currentUrlString = String(currentUrl);
    const gameId = extractGameId(currentUrlString);
    const apiUrl = 'https://tuxun.fun/api/v0/tuxun/user/report';

    return new Promise((resolve, reject) => {
        GM_xmlhttpRequest({
            method: 'GET',
            url: apiUrl + '?' + new URLSearchParams({
                target: Number(requestUser),
                reason: '\u5168\u7403\u5339\u914d\u4f5c\u5f0a', 
                more: 'script',
                gameId: gameId
            }),
            onload: (response) => {
                if (response.status >= 200 && response.status < 300) {
                    try {
                        const result = JSON.parse(response.responseText);
                        resolve(result);
                    } catch (error) {
                        reject('Error parsing JSON: ' + error);
                    }
                } else {
                    reject('Request failed with status ' + response.status);
                }
            },
            onerror: (error) => {
                reject('Request error: ' + error);
            }
        });
    });
}
function extractGameId(url) {
    const urlParams = new URLSearchParams(new URL(url).search);
    return urlParams.get('id') || 'defaultGameId';
}