Auto Next Round (Geoguessr)

Takes you to the next round immediately after guessing.

当前为 2024-04-25 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Auto Next Round (Geoguessr)
  3. // @namespace alienperfect
  4. // @version 1.3
  5. // @description Takes you to the next round immediately after guessing.
  6. // @author Alien Perfect
  7. // @match https://www.geoguessr.com/*
  8. // @icon https://www.google.com/s2/favicons?sz=32&domain=geoguessr.com
  9. // @grant GM_getValue
  10. // @grant GM_setValue
  11. // ==/UserScript==
  12.  
  13. "use strict";
  14.  
  15. // Replace the value between the quotes if you want to use a different key.
  16. const HOTKEY = "`";
  17.  
  18. function toggleScript() {
  19. const enabled = GM_getValue("enabled");
  20.  
  21. if (enabled === false) {
  22. GM_setValue("enabled", true);
  23. return alert("Auto Next Round on");
  24. }
  25.  
  26. GM_setValue("enabled", false);
  27. return alert("Auto Next Round off");
  28. }
  29.  
  30. function onKey(e) {
  31. if (e.key === HOTKEY) toggleScript();
  32. }
  33.  
  34. function main() {
  35. window.addEventListener("keydown", onKey);
  36.  
  37. new MutationObserver(() => {
  38. if (
  39. !(
  40. location.pathname.includes("/game/") ||
  41. location.pathname.includes("/challenge/")
  42. )
  43. )
  44. return;
  45.  
  46. const enabled = GM_getValue("enabled", true);
  47. const nextButton = document.querySelector("[data-qa='close-round-result']");
  48.  
  49. if (enabled && nextButton) nextButton.click();
  50. }).observe(document.body, { childList: true, subtree: true });
  51. }
  52.  
  53. main();