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

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