Geoguessr/Seterra cheat

N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         Geoguessr/Seterra cheat
// @namespace    geoguessr.com
// @version      0.0.0
// @description  N/A
// @author       Mooldool
// @match        http://*.geoguessr.com/*
// @match        https://*.geoguessr.com/*
// @match        http://geoguessr.com/*
// @match        https://geoguessr.com/*
// @icon         https://www.geoguessr.com/favicon.ico
// @grant        none
// ==/UserScript==

// Naming variables is the second hardest thing in computer programming.

(function() {
    'use strict';
    // The delay in ms to wait inbetween every loop.
    const delay = 10;
    // This element stores the ID (and name) of the current element they have to click.
    let game_map_header = document.querySelectorAll("[data-qa=game-map-header]");

    setInterval(() => {
        let current_question_id = game_map_header[0].getAttribute("data-current-question-id");
        let current_area = document.querySelectorAll("[data-qa=" + current_question_id + "]");

        // For the "click on the flag" games
        current_area[0].children[0].children[0].click();
        // For the "click on the country" games
        // SVG elements don't have the click function.
        current_area[0].dispatchEvent(new MouseEvent('click'));
        console.log("Clicked on " + current_question_id);
    }, delay)
})();