TTRS Auto-Answer Simulator (For Internal Testing Only)

Simulates auto-answering to test detection systems (internal QA only)

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         TTRS Auto-Answer Simulator (For Internal Testing Only)
// @namespace    https://ttrockstars.com/
// @version      0.1
// @description  Simulates auto-answering to test detection systems (internal QA only)
// @author       TTRS Security
// @license      MIT
// @match        *://*.ttrockstars.com/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    function parseQuestion(text) {
        const match = text.match(/(\d+)\s*[x×*÷/]\s*(\d+)/i);
        if (!match) return null;

        const num1 = parseInt(match[1], 10);
        const num2 = parseInt(match[2], 10);
        if (text.includes('÷') || text.includes('/')) {
            return Math.floor(num1 / num2);
        }
        return num1 * num2;
    }

    function simulate() {
        const questionEl = document.querySelector('.question, .question__content, .question-text');
        const inputEl = document.querySelector('input[type="text"]');
        const submitBtn = document.querySelector('button[type="submit"], button.submit');

        if (questionEl && inputEl && submitBtn) {
            const questionText = questionEl.innerText || questionEl.textContent;
            const answer = parseQuestion(questionText);
            if (answer !== null) {
                inputEl.value = answer;
                inputEl.dispatchEvent(new Event('input', { bubbles: true }));
                submitBtn.click();
                console.log(`[Sim Bot] Answered: ${questionText} = ${answer}`);
            }
        }

        setTimeout(simulate, 300); // Answers every 0.3s
    }

    setTimeout(simulate, 1000); // Start after load
})();