Geoguessr Resolver Hack (Updated!)

Features: Automatically score 5000 Points | Score randomly between 4500 and 5000 points | Open in Google Maps | See enemy guess Distance

目前为 2023-06-17 提交的版本。查看 最新版本

// ==UserScript==
// @name         Geoguessr Resolver Hack (Updated!)
// @namespace    http://tampermonkey.net/
// @version      9.7
// @description  Features: Automatically score 5000 Points | Score randomly between 4500 and 5000 points | Open in Google Maps | See enemy guess Distance
// @author       0x978
// @match        https://www.geoguessr.com/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=geoguessr.com
// @grant        none
// ==/UserScript==
window.alert = function(message) { // Devs tried to overwrite alert to detect script. I had already stopped using alert, but i'd rather they didn't override this anyway.
    nativeAlert(message)
};

const originalFetch = window.fetch;
window.fetch = function (url, options) {
    //console.log('Intercepted fetch:', url, options);
    if(url === "https://www.geoguessr.com/api/v4/cd0d1298-a3aa-4bd0-be09-ccf513ad14b1"){ // devs using this endpoint for Anticheat. Block all calls to it.
        return
    }
    return originalFetch.call(this, url, options);
};
async function v(e, r){
    let q = await fetch(`https://nominatim.openstreetmap.org/reverse?lat=${e}&lon=${r}&format=json`)
    return await q.json();
}
function qq() {
    let [p,m] = oi()
    v(p,m).then(x => {
        console.log(x)
        alert(`
    Country: ${x.address.country}
    County: ${x.address.county}
    City: ${x.address.city}
    Road: ${x.address.road}
    State: ${x.address.state}
    Postcode: ${x.address.postcode}
    Village/Suburb: ${(x.address.village||x.address.suburb)}

   Postal Address: ${x.display_name}
    `) } );
}
function km(h){
    let [qqw,th] = oi()
    if(document.getElementsByClassName("guess-map__canvas-container")[0] === undefined){mn([qqw,th]);return;}
    if(h){qqw += (Math.random() / 2);th += (Math.random() / 2);}
    let wc = document.getElementsByClassName("guess-map__canvas-container")[0]
    let vvr = Object.keys(wc)
    let er = vvr.find(b => b.startsWith("__reactFiber$"))
    let fp = wc[er].return.memoizedProps.onMarkerLocationChanged
    LILILI = false
    ed()
    vevd({lat:qqw,lng:th})
    fp({lat:qqw,lng:th})
    vod()
}

function mn([e,g]){
    let f = document.getElementsByClassName("region-map_map__7jxcD")[0]
    let lllk = Object.keys(f)
    let u = lllk.find(key => key.startsWith("__reactFiber$"))
    let fg = f[u].return.memoizedProps.onRegionSelected
    v(e,g).then(cx => {let countryCode = cx.address.country_code
        fg(countryCode)})
}
function oi(){
    let ww = document.getElementsByClassName("styles_root__3xbKq")[0]
    let e = Object.keys(ww)
    let u = e.find(key => key.startsWith("__reactFiber$"))
    let w = ww[u]
    let qwqa = w.return.memoizedProps.panorama.position
    return([qwqa.lat(),qwqa.lng()])
}
function vn(){
    let [xz,bt] = oi()
    if(!xz||!bt){return;}
    window.open(`https://www.google.com/maps/place/${xz},${bt}`);
}
function hr(){
    const ecc = wer()
    if(ecc === null){return;}
    const lll = ecc / 1000
    const th = lll * 0.621371
    return [lll,th]
}
function wer(){
    const jjh = document.getElementsByClassName("game_layout__TO_jf")[0]
    if(!jjh){return null}
    const hhj = Object.keys(jjh)
    const hjh = hhj.find(key => key.startsWith("__reactFiber$"))
    const jhjh = jjh[hjh]
    const jhj = jhjh.return.memoizedProps.gameState.teams
    const jjjh = mnbv(jhj,veec())
    const hhjh = jjjh.players[0].guesses
    const jhgj = hhjh[hhjh.length-1]
    if(!ILILILLI(jhjh.return.memoizedProps.gameState,hhjh)){
        return null;
    }
    return jhgj.distance
}
function veec(){
    const vece = document.getElementsByClassName("user-nick_root__DUfvc")[0]
    const vcee = Object.keys(vece)
    const ecve = vcee.find(key => key.startsWith("__reactFiber$"))
    const ceev = vece[ecve]
    const eevc = ceev.return.memoizedProps.userId
    return eevc
}
function mnbv(mnmm, mnnb){
    const mn = mnmm[0].players[0].playerId
    if(mn !== mnnb){
        return mnmm[0]
    }
    else{
        return mnmm[1]
    }
}
function ILILILLI(ilil, lilil){
    const li = ilil.currentRoundNumber
    const il = lilil ? lilil.length : 0;
    return li === il
}
function ufsfj(h){
    const w = oi()
    const gf = w[0] * (Math.PI / 180)
    const fg = w[1] * (Math.PI / 180)
    const y = document.getElementsByClassName("guess-map__canvas-container")[0]
    const c = Object.keys(y)
    const x = c.find(key => key.startsWith("__reactFiber$"))
    const t = y[x]
    const b = h ?? t.return.memoizedProps.markers[0]
    if(!w || !b){
        return null
    }
    const ik = b.lat * (Math.PI / 180)
    const ki = b.lng * (Math.PI / 180)
    return Math.acos(Math.sin(gf)*Math.sin(ik) + Math.cos(gf) * Math.cos(ik) * Math.cos(ki - fg)) * 6371
}
function ed(r){
    let ur = ufsfj(r)
    let ii = Math.round(ur)
    if(ii === null){
        return
    }
    let x = hr()
    const xz = oij()
    let g = x ? `${ii} km  ||  Enemy: ${Math.round(x[0])} km || Damage: ${wxz(ur,x[0])}` : xz !== null ? `${ii} km || Best Enemy Guess: ${xz} km` : `${ii} km (${Math.round(ii * 0.621371)} miles)`
    frf(g)
    //alert(`Your marker is ${distance} km (${Math.round(distance * 0.621371)} miles) away from the correct guess`)
}
function frf(e){
    let x = Array.from(document.getElementsByClassName("button_wrapper__NkcHZ"))
    if(!x){
        console.log("ERROR: Failed to calculate distance, unable to locate button.")
        return null}
    if((x[x.length-1].innerText).includes("PRO")){
        return
    }
    x[x.length-1].innerText = e
}

function vevd(){
    const ILILI = (e) => {
        if (e.keyCode === 32) {
            const ILIII = ufsfj()
            if((ILIII < 1 || isNaN(ILIII)) && !LILILI){
                e.stopImmediatePropagation();
                adjdf()
                document.removeEventListener("keyup", ILILI);
                LILILI = true
            }
        }
    };
    document.addEventListener("keyup", ILILI);
    setTimeout(() => {
        const xexex = ufsfj()
        if((xexex < 1 || isNaN(xexex)) && !LILILI){
            let xexe = document.getElementsByClassName("button_button__CnARx button_variantPrimary__xc8Hp")[0][Object.keys(document.getElementsByClassName("button_button__CnARx button_variantPrimary__xc8Hp")[0])[1]].onClick
            document.getElementsByClassName("button_button__CnARx button_variantPrimary__xc8Hp")[0][Object.keys(document.getElementsByClassName("button_button__CnARx button_variantPrimary__xc8Hp")[0])[1]].onClick = ( () => {
                LILILI = true
                adjdf()
                document.getElementsByClassName("button_button__CnARx button_variantPrimary__xc8Hp")[0][Object.keys(document.getElementsByClassName("button_button__CnARx button_variantPrimary__xc8Hp")[0])[1]].onClick = (() => xexe())
            })
        }
    },500)
}

function wxz(wxc, wcz){
    let wvb = Math.round(5000*Math.exp((-10*wxc/14916.862)))
    let wxx = Math.round(5000*Math.exp((-10*wcz/14916.862)))
    let wcc = (wvb - wxx) * waz()
    return wcc
}

function waz(){
    let wcx = document.getElementsByClassName("round-icon_container__bNbtn")[0]
    if(!wcx){return 1}
    let wbb = wcx[Object?.keys(document.getElementsByClassName("round-icon_container__bNbtn")[0])[0]]?.return?.memoizedProps
    return wbb?.multiplier ?? 1
}

function oij() {
    let l = document.getElementsByClassName("game_root__2vV1H")[0]
    if(!l){
        return null
    }
    let z = l[Object.keys(document.getElementsByClassName("game_root__2vV1H")[0])[0]]
    let r = z.return.memoizedProps.gameState
    let f = r.players
    let b = Number.MAX_SAFE_INTEGER
    f.forEach(player => {
        let k = player.coordinateGuesses[player.coordinateGuesses.length - 1]
        if(k){
            let e = k.distance
            if ((e < b) && k.roundNumber === r.currentRoundNumber && player.playerId !== l.return.memoizedProps.currentPlayer.playerId) {
                b = e
            }
        }
    })
    if (b === Number.MAX_SAFE_INTEGER) {
        return null;
    }
    return Math.round(b / 1000)
}

function jn(){
    const m = oij()
    if (m === null) {
        alert("There have been no guesses this round")
        return;
    }
    alert(`The best guess this round is ${m} km from the correct location. (Not including your guess)`)
}

function adjdf(){
    alert(`Geoguessr Resolver has prevented you from making a perfect guess.

Making perfect guesses will very likely result in a ban from competitive.

Press "guess" again to proceed anyway.`)
}

function vod(){
    document.getElementsByClassName("guess-map__canvas-container")[0].onpointermove = (() =>{
        ed()
    })
}

let h = (e) => {
    if(e.keyCode === 49){km(true)}
    if(e.keyCode === 50){km(false)}
    if(e.keyCode === 51){qq()}
    if(e.keyCode === 52){vn()}
    if (e.keyCode === 53) {jn()()}

}
document.addEventListener("keydown", h);
let LILILI = false

document.getElementsByClassName("header_logo__vV0HK")[0].innerText = `
            Geoguessr Resolver Loaded Successfully

                Controls (UPDATED!):
            '1': Place marker on a "safe" guess (4500 - 5000)
            '2': Place marker on a "perfect" guess (5000)
            '3': Get a description of the correct location.
            '4': Open location in Google Maps (In a new tab)

            After pressing '1' or '2' Your guess distance and Enemy Guess distance
            is automatically calculated when ever you place a marker on the map`

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址