您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Auto-complete flag game with TM menu toggle button
当前为
// ==UserScript== // @name world-geography-games.com | Flag quiz auto anwser // @namespace http://tampermonkey.net/ // @version 2.0 // @description Auto-complete flag game with TM menu toggle button // @author OmniSec // @match https://world-geography-games.com/en/* // @grant GM_registerMenuCommand // @grant GM_unregisterMenuCommand // @license MIT // ==/UserScript== (function() { 'use strict'; // --- Core Auto-Play --- window.autoPlayFlagQuiz = function() { if (typeof buttons !== "undefined" && typeof correct_answer !== "undefined") { buttons.forEach(function(btn){ if (btn.name === correct_answer && can_tap === true) { tap_country(btn); } }); if (button_next && button_next.inputEnabled) { next_flag(); } } } // --- Interval Control --- window.autoPlayIntervalTime = 500; window.autoPlayIntervalID = setInterval(window.autoPlayFlagQuiz, window.autoPlayIntervalTime); window.isAutoPlaying = true; // Track state window.startAutoPlay = function() { clearInterval(window.autoPlayIntervalID); window.autoPlayIntervalID = setInterval(window.autoPlayFlagQuiz, window.autoPlayIntervalTime); window.isAutoPlaying = true; updateToggleMenu(); console.log("Auto-play started with interval " + window.autoPlayIntervalTime + "ms"); } window.stopAutoPlay = function() { clearInterval(window.autoPlayIntervalID); window.isAutoPlaying = false; updateToggleMenu(); console.log("Auto-play stopped"); } window.toggleAutoPlay = function() { if (window.isAutoPlaying) { stopAutoPlay(); } else { startAutoPlay(); } } // --- Menu Commands --- const intervals = [100, 250, 500, 1000, 2000]; intervals.forEach(i => { GM_registerMenuCommand(`Set Interval ${i}ms`, function() { window.autoPlayIntervalTime = i; if (window.isAutoPlaying) startAutoPlay(); console.log("Interval set to " + i + "ms"); }); }); // Placeholder for the toggle command let toggleCommandID; function updateToggleMenu() { if (toggleCommandID) GM_unregisterMenuCommand(toggleCommandID); toggleCommandID = GM_registerMenuCommand( window.isAutoPlaying ? "Pause Auto-Play" : "Play Auto-Play", toggleAutoPlay ); } // Initialize toggle menu updateToggleMenu(); })();