Transum

transum fa

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

You will need to install an extension such as Tampermonkey to install this script.

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         Transum
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  transum fa
// @author       You
// @match        *://*.transum.org/*
// @grant        none
// @license MIT
// ==/UserScript==

(function () {
    'use strict';

    const correctAnswers = 999;
    const trophyText = 'Completed';

    function fakeCorrectAnswers(count, trophyMessage) {
        window.score = count;

        for (let i = 1; i <= count; i++) {
            const tick = document.getElementById(`tick${i}`);
            const cross = document.getElementById(`cross${i}`);
            if (tick && cross) {
                tick.style.display = 'inline';
                cross.style.display = 'none';
            }

            const guessInput = document.querySelector(`input[name="Guess${i}"]`);
            if (guessInput) {
                guessInput.value = `1F1`;
            }
        }

        const checkButton = document.getElementById('Checkbutton');
        if (checkButton) {
            checkButton.innerText = trophyMessage.includes('again') ? 'Check again' : 'Check';
            checkButton.style.width = '150px';
        }

        const trophyButton = document.getElementById('Trophybutton');
        if (trophyButton) {
            trophyButton.style.display = 'inline-block';
            trophyButton.value = trophyMessage;
        }
    }

    function submitForm(trophyMessage) {
        const form = document.forms['TrophyForm'];
        if (form) {
            form.Other_Text.value = trophyMessage;
            form.submit();
        }
    }

    fakeCorrectAnswers(correctAnswers, trophyText);

    if (typeof PreCheck === 'function') {
        PreCheck(document.MainForm);
    }

    submitForm(trophyText);
})();