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-02 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Geoguessr Resolver Hack (Updated!)
  3. // @namespace http://tampermonkey.net/
  4. // @version 9.0
  5. // @description Features: Automatically score 5000 Points | Score randomly between 4500 and 5000 points | Open in Google Maps | See enemy guess Distance
  6. // @author 0x978
  7. // @match https://www.geoguessr.com/*
  8. // @icon https://www.google.com/s2/favicons?sz=64&domain=geoguessr.com
  9. // @grant none
  10. // ==/UserScript==
  11. 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.
  12. nativeAlert(message)
  13. };
  14.  
  15. const originalFetch = window.fetch;
  16. window.fetch = function (url, options) {
  17. console.log('Intercepted fetch:', url, options);
  18. if(url === "https://www.geoguessr.com/api/v4/cd0d1298-a3aa-4bd0-be09-ccf513ad14b1"){ // devs using this endpoint for Anticheat. Block all calls to it.
  19. return
  20. }
  21. return originalFetch.call(this, url, options);
  22. };
  23. async function v(e, r){
  24. let q = await fetch(`https://nominatim.openstreetmap.org/reverse?lat=${e}&lon=${r}&format=json`)
  25. return await q.json();
  26. }
  27. function qq() {
  28. let [p,m] = oi()
  29. v(p,m).then(x => {
  30. console.log(x)
  31. alert(`
  32. Country: ${x.address.country}
  33. County: ${x.address.county}
  34. City: ${x.address.city}
  35. Road: ${x.address.road}
  36. State: ${x.address.state}
  37. Postcode: ${x.address.postcode}
  38. Village/Suburb: ${(x.address.village||x.address.suburb)}
  39.  
  40. Postal Address: ${x.display_name}
  41. `) } );
  42. }
  43. function km(h){
  44. let [qqw,th] = oi()
  45. if(document.getElementsByClassName("guess-map__canvas-container")[0] === undefined){mn([qqw,th]);return;}
  46. if(h){qqw += (Math.random() / 2);th += (Math.random() / 2);}
  47. let wc = document.getElementsByClassName("guess-map__canvas-container")[0]
  48. let vvr = Object.keys(wc)
  49. let er = vvr.find(b => b.startsWith("__reactFiber$"))
  50. let fp = wc[er].return.memoizedProps.onMarkerLocationChanged
  51. LILILI = false
  52. ed()
  53. vevd({lat:qqw,lng:th})
  54. fp({lat:qqw,lng:th})
  55. vod()
  56. }
  57.  
  58. function mn([e,g]){
  59. let f = document.getElementsByClassName("region-map_map__7jxcD")[0]
  60. let lllk = Object.keys(f)
  61. let u = lllk.find(key => key.startsWith("__reactFiber$"))
  62. let fg = f[u].return.memoizedProps.onRegionSelected
  63. v(e,g).then(cx => {let countryCode = cx.address.country_code
  64. fg(countryCode)})
  65. }
  66. function oi(){
  67. let ww = document.getElementsByClassName("styles_root__3xbKq")[0]
  68. let e = Object.keys(ww)
  69. let u = e.find(key => key.startsWith("__reactFiber$"))
  70. let w = ww[u]
  71. let qwqa = w.return.memoizedProps.panorama.position
  72. return([qwqa.lat(),qwqa.lng()])
  73. }
  74. function vn(){
  75. let [xz,bt] = oi()
  76. if(!xz||!bt){return;}
  77. window.open(`https://www.google.com/maps/place/${xz},${bt}`);
  78. }
  79. function hr(){
  80. const ecc = wer()
  81. if(ecc === null){return;}
  82. const lll = Math.round(ecc / 1000)
  83. const th = Math.round(lll * 0.621371)
  84. return [lll,th]
  85. }
  86. function wer(){
  87. const jjh = document.getElementsByClassName("game_layout__TO_jf")[0]
  88. if(!jjh){return null}
  89. const hhj = Object.keys(jjh)
  90. const hjh = hhj.find(key => key.startsWith("__reactFiber$"))
  91. const jhjh = jjh[hjh]
  92. const jhj = jhjh.return.memoizedProps.gameState.teams
  93. const jjjh = mnbv(jhj,veec())
  94. const hhjh = jjjh.players[0].guesses
  95. const jhgj = hhjh[hhjh.length-1]
  96. if(!ILILILLI(jhjh.return.memoizedProps.gameState,hhjh)){
  97. return null;
  98. }
  99. return jhgj.distance
  100. }
  101. function veec(){
  102. const vece = document.getElementsByClassName("user-nick_root__DUfvc")[0]
  103. const vcee = Object.keys(vece)
  104. const ecve = vcee.find(key => key.startsWith("__reactFiber$"))
  105. const ceev = vece[ecve]
  106. const eevc = ceev.return.memoizedProps.userId
  107. return eevc
  108. }
  109. function mnbv(mnmm, mnnb){
  110. const mn = mnmm[0].players[0].playerId
  111. if(mn !== mnnb){
  112. return mnmm[0]
  113. }
  114. else{
  115. return mnmm[1]
  116. }
  117. }
  118. function ILILILLI(ilil, lilil){
  119. const li = ilil.currentRoundNumber
  120. const il = lilil ? lilil.length : 0;
  121. return li === il
  122. }
  123. function ufsfj(h){
  124. const w = oi()
  125. const gf = w[0] * (Math.PI / 180)
  126. const fg = w[1] * (Math.PI / 180)
  127. const y = document.getElementsByClassName("guess-map__canvas-container")[0]
  128. const c = Object.keys(y)
  129. const x = c.find(key => key.startsWith("__reactFiber$"))
  130. const t = y[x]
  131. const b = h ?? t.return.memoizedProps.markers[0]
  132. if(!w || !b){
  133. return null
  134. }
  135. const ik = b.lat * (Math.PI / 180)
  136. const ki = b.lng * (Math.PI / 180)
  137. return Math.acos(Math.sin(gf)*Math.sin(ik) + Math.cos(gf) * Math.cos(ik) * Math.cos(ki - fg)) * 6371
  138. }
  139. function ed(r){
  140. let ii = Math.round(ufsfj(r))
  141. if(ii === null){
  142. return
  143. }
  144. let x = hr()
  145. let g = x ? `${ii} km || Enemy: ${x[0]} km` :`${ii} km (${Math.round(ii * 0.621371)} miles)`
  146. frf(g)
  147. //alert(`Your marker is ${distance} km (${Math.round(distance * 0.621371)} miles) away from the correct guess`)
  148. }
  149. function frf(e){
  150. let x = document.getElementsByClassName("button_wrapper__NkcHZ")[1]
  151. x.innerText = e
  152. }
  153.  
  154. function vevd(){
  155. const ILILI = (e) => {
  156. if (e.keyCode === 32) {
  157. const ILIII = ufsfj()
  158. if((ILIII < 1 || isNaN(ILIII)) && !LILILI){
  159. e.stopImmediatePropagation();
  160. adjdf()
  161. document.removeEventListener("keyup", ILILI);
  162. LILILI = true
  163. }
  164. }
  165. };
  166. document.addEventListener("keyup", ILILI);
  167. setTimeout(() => {
  168. const xexex = ufsfj()
  169. if((xexex < 1 || isNaN(xexex)) && !LILILI){
  170. let xexe = document.getElementsByClassName("button_button__CnARx button_variantPrimary__xc8Hp")[0][Object.keys(document.getElementsByClassName("button_button__CnARx button_variantPrimary__xc8Hp")[0])[1]].onClick
  171. document.getElementsByClassName("button_button__CnARx button_variantPrimary__xc8Hp")[0][Object.keys(document.getElementsByClassName("button_button__CnARx button_variantPrimary__xc8Hp")[0])[1]].onClick = ( () => {
  172. LILILI = true
  173. adjdf()
  174. document.getElementsByClassName("button_button__CnARx button_variantPrimary__xc8Hp")[0][Object.keys(document.getElementsByClassName("button_button__CnARx button_variantPrimary__xc8Hp")[0])[1]].onClick = (() => xexe())
  175. })
  176. }
  177. },500)
  178. }
  179.  
  180. function adjdf(){
  181. alert(`Geoguessr Resolver has prevented you from making a perfect guess.
  182.  
  183. Making perfect guesses will very likely result in a ban from competitive.
  184.  
  185. Press "guess" again to proceed anyway.`)
  186. }
  187.  
  188. function vod(){
  189. document.getElementsByClassName("guess-map__canvas-container")[0].onpointermove = (() =>{
  190. ed()
  191. })
  192. }
  193.  
  194. let h = (e) => {
  195. if(e.keyCode === 49){km(true)}
  196. if(e.keyCode === 50){km(false)}
  197. if(e.keyCode === 51){qq()}
  198. if(e.keyCode === 52){vn()}
  199. if(e.keyCode === 53){hr()}
  200. if(e.keyCode === 54){ed()}
  201. }
  202. document.addEventListener("keydown", h);
  203. let LILILI = false
  204.  
  205. document.getElementsByClassName("header_logo__vV0HK")[0].innerText = `
  206. Geoguessr Resolver Loaded Successfully
  207.  
  208. Controls (UPDATED!):
  209. '1': Place marker on a "safe" guess (4500 - 5000)
  210. '2': Place marker on a "perfect" guess (5000)
  211. '3': Get a description of the correct location.
  212. '4': Open location in Google Maps (In a new tab)
  213.  
  214. After pressing '1' or '2' Your guess distance and Enemy Guess distance
  215. is automatically calculated when ever you place a marker on the map`