geoGuessr Resolver Hack (NEW UPDATE!)

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

当前为 2023-05-29 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name geoGuessr Resolver Hack (NEW UPDATE!)
  3. // @namespace http://tampermonkey.net/
  4. // @version 8.3
  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.  
  12.  
  13. alert(` Thanks for using geoGuessr Resolver by 0x978.
  14. ============================================
  15. Please use the safer guess Option to avoid bans in competitive
  16. ============================================
  17. Controls (NEW!!!!!!!!):
  18. '1': Place marker on a "safe" guess (4500 - 5000)
  19. '2': Place marker on a "perfect" guess (5000)
  20. '3': Get a description of the correct location.
  21. '4': Open location in Google Maps (In a new tab)
  22. '5': See opponent's guess distance from correct answer.
  23. '6': See your distance from correct answer (replaces submit button text)
  24. ----------------------------------------------------------`)
  25. async function v(e, r){
  26. let q = await fetch(`https://nominatim.openstreetmap.org/reverse?lat=${e}&lon=${r}&format=json`)
  27. return await q.json();
  28. }
  29. function qq() {
  30. let [p,m] = oi()
  31. v(p,m).then(x => {
  32. console.log(x)
  33. alert(`
  34. Country: ${x.address.country}
  35. County: ${x.address.county}
  36. City: ${x.address.city}
  37. Road: ${x.address.road}
  38. State: ${x.address.state}
  39. Postcode: ${x.address.postcode}
  40. Village/Suburb: ${(x.address.village||x.address.suburb)}
  41.  
  42. Postal Address: ${x.display_name}
  43. `) } );
  44. }
  45. function km(h){
  46. let [qqw,th] = oi()
  47. if(document.getElementsByClassName("guess-map__canvas-container")[0] === undefined){mn([qqw,th]);return;}
  48. if(h){qqw += (Math.random() / 2);th += (Math.random() / 2);}
  49. let wc = document.getElementsByClassName("guess-map__canvas-container")[0]
  50. let vvr = Object.keys(wc)
  51. let er = vvr.find(b => b.startsWith("__reactFiber$"))
  52. let fp = wc[er].return.memoizedProps.onMarkerLocationChanged
  53. ed({lat:qqw,lng:th})
  54. vevd({lat:qqw,lng:th})
  55. fp({lat:qqw,lng:th})}
  56. function mn([e,g]){
  57. let f = document.getElementsByClassName("region-map_map__7jxcD")[0]
  58. let lllk = Object.keys(f)
  59. let u = lllk.find(key => key.startsWith("__reactFiber$"))
  60. let fg = f[u].return.memoizedProps.onRegionSelected
  61. v(e,g).then(cx => {let countryCode = cx.address.country_code
  62. fg(countryCode)})
  63. }
  64. function oi(){
  65. let ww = document.getElementsByClassName("styles_root__3xbKq")[0]
  66. let e = Object.keys(ww)
  67. let u = e.find(key => key.startsWith("__reactFiber$"))
  68. let w = ww[u]
  69. let qwqa = w.return.memoizedProps.panorama.position
  70. return([qwqa.lat(),qwqa.lng()])
  71. }
  72. function vn(){
  73. let [xz,bt] = oi()
  74. if(!xz||!bt){return;}
  75. window.open(`https://www.google.com/maps/place/${xz},${bt}`);
  76. }
  77. function hr(){
  78. const ecc = wer().distance
  79. if(ecc === null){return;}
  80. const lll = Math.round(ecc / 1000)
  81. const th = Math.round(lll * 0.621371)
  82. alert(`Enemy guess is ${lll} km (${th} miles) away.`)
  83. }
  84. function wer(){
  85. const jjh = document.getElementsByClassName("game_layout__TO_jf")[0]
  86. const hhj = Object.keys(jjh)
  87. const hjh = hhj.find(key => key.startsWith("__reactFiber$"))
  88. const jhjh = jjh[hjh]
  89. const jhj = jhjh.return.memoizedProps.gameState.teams
  90. const jjjh = mnbv(jhj,veec())
  91. const hhjh = jjjh.players[0].guesses
  92. const jhgj = hhjh[hhjh.length-1]
  93. if(!ILILILLI(jhjh.return.memoizedProps.gameState,hhjh)){
  94. alert("Error!: The user has not guessed this round.")
  95. return null;
  96. }
  97. return jhgj
  98. }
  99. function veec(){
  100. const vece = document.getElementsByClassName("user-nick_root__DUfvc")[0]
  101. const vcee = Object.keys(vece)
  102. const ecve = vcee.find(key => key.startsWith("__reactFiber$"))
  103. const ceev = vece[ecve]
  104. const eevc = ceev.return.memoizedProps.userId
  105. return eevc
  106. }
  107. function mnbv(mnmm, mnnb){
  108. const mn = mnmm[0].players[0].playerId
  109. if(mn !== mnnb){
  110. return mnmm[0]
  111. }
  112. else{
  113. return mnmm[1]
  114. }
  115. }
  116. function ILILILLI(ilil, lilil){
  117. const li = ilil.currentRoundNumber
  118. const il = lilil ? lilil.length : 0;
  119. return li === il
  120. }
  121. function ufsfj(h){
  122. const w = oi()
  123. const gf = w[0] * (Math.PI / 180)
  124. const fg = w[1] * (Math.PI / 180)
  125. const y = document.getElementsByClassName("guess-map__canvas-container")[0]
  126. const c = Object.keys(y)
  127. const x = c.find(key => key.startsWith("__reactFiber$"))
  128. const t = y[x]
  129. const b = h ?? t.return.memoizedProps.markers[0]
  130. if(!w || !b){
  131. return null
  132. }
  133. const ik = b.lat * (Math.PI / 180)
  134. const ki = b.lng * (Math.PI / 180)
  135. return Math.acos(Math.sin(gf)*Math.sin(ik) + Math.cos(gf) * Math.cos(ik) * Math.cos(ki - fg)) * 6371
  136. }
  137. function ed(r){
  138. let ii = Math.round(ufsfj(r))
  139. if(ii === null){
  140. alert("Unable to fetch coordinates. Perhaps you have not placed a marker this round?")
  141. return
  142. }
  143. let g = `${ii} km (${Math.round(ii * 0.621371)} miles)`
  144. frf(g)
  145. //alert(`Your marker is ${distance} km (${Math.round(distance * 0.621371)} miles) away from the correct guess`)
  146. }
  147. function frf(e){
  148. let x = document.getElementsByClassName("button_wrapper__NkcHZ")[1]
  149. x.innerText = e
  150. }
  151. function vevd(coords){
  152. const eed = ufsfj(coords)
  153. if(eed < 1 || isNaN(eed)){
  154. const xz = (e) => {
  155. if (e.keyCode === 32) {
  156. e.stopImmediatePropagation();
  157. zw()
  158. document.removeEventListener("keyup", xz);
  159. }
  160. };
  161. document.addEventListener("keyup", xz);
  162. setTimeout(() => {
  163. let z = document.getElementsByClassName("button_button__CnARx button_variantPrimary__xc8Hp")[0][Object.keys(document.getElementsByClassName("button_button__CnARx button_variantPrimary__xc8Hp")[0])[1]].onClick
  164. document.getElementsByClassName("button_button__CnARx button_variantPrimary__xc8Hp")[0][Object.keys(document.getElementsByClassName("button_button__CnARx button_variantPrimary__xc8Hp")[0])[1]].onClick = ( () => {
  165. zw()
  166. document.getElementsByClassName("button_button__CnARx button_variantPrimary__xc8Hp")[0][Object.keys(document.getElementsByClassName("button_button__CnARx button_variantPrimary__xc8Hp")[0])[1]].onClick = (() => z())
  167. })
  168. },500)
  169. }
  170. }
  171. function zw(){
  172. alert(`Geoguessr Resolver has prevented you from making a perfect guess.
  173. Making perfect guesses will very likely result in a ban from competitive.
  174. Press "guess" again to proceed anyway.`)
  175. }
  176.  
  177. let h = (e) => {
  178. if(e.keyCode === 49){km(true)}
  179. if(e.keyCode === 50){km(false)}
  180. if(e.keyCode === 51){qq()}
  181. if(e.keyCode === 52){vn()}
  182. if(e.keyCode === 53){hr()}
  183. if(e.keyCode === 54){ed()}
  184. }
  185. document.addEventListener("keydown", h);