GeoGuessr Ultimate Script

GeoGuessr Ultimate Script - One Script to rule them all

Verzia zo dňa 01.07.2020. Pozri najnovšiu verziu.

Na nainštalovanie skriptu si budete musieť nainštalovať rozšírenie, ako napríklad Tampermonkey, Greasemonkey alebo Violentmonkey.

Na nainštalovanie skriptu si budete musieť nainštalovať rozšírenie, ako napríklad Tampermonkey, % alebo Violentmonkey.

Na nainštalovanie skriptu si budete musieť nainštalovať rozšírenie, ako napríklad Tampermonkey, % alebo Violentmonkey.

Na nainštalovanie skriptu si budete musieť nainštalovať rozšírenie, ako napríklad Tampermonkey alebo Userscripts.

Na inštaláciu tohto skriptu je potrebné nainštalovať rozšírenie, ako napríklad Tampermonkey.

Na inštaláciu tohto skriptu je potrebné nainštalovať rozšírenie správcu používateľských skriptov.

(Už mám správcu používateľských skriptov, nechajte ma ho nainštalovať!)

Na inštaláciu tohto štýlu je potrebné nainštalovať rozšírenie, ako napríklad Stylus.

Na inštaláciu tohto štýlu je potrebné nainštalovať rozšírenie, ako napríklad Stylus.

Na inštaláciu tohto štýlu je potrebné nainštalovať rozšírenie, ako napríklad Stylus.

Na inštaláciu tohto štýlu je potrebné nainštalovať rozšírenie správcu používateľských štýlov.

Na inštaláciu tohto štýlu je potrebné nainštalovať rozšírenie správcu používateľských štýlov.

Na inštaláciu tohto štýlu je potrebné nainštalovať rozšírenie správcu používateľských štýlov.

(Už mám správcu používateľských štýlov, nechajte ma ho nainštalovať!)

// ==UserScript==
// @name             GeoGuessr Ultimate Script
// @version          0.3
// @description      GeoGuessr Ultimate Script - One Script to rule them all
// @author           MrAmericanMike
// @include          /^(https?)?(\:)?(\/\/)?([^\/]*\.)?geoguessr\.com($|\/.*)/
// @grant            none
// @run-at           document-start
// @namespace        https://greasyfork.org/en/scripts/406060-geoguessr-ultimate-script
// ==/UserScript==

console.log("GeoGuessr Ultimate Script");

// MODULES // Set from 'true' to 'false' any module that you don't need. Example: removeTopBar = false;

// REMOVE BOTTOM WHITE BAR WHILE PLAYING A MAP
removeBottomBar = true;

// REMOVE RIGHT WHITE BAR ON ROUND RESULTS SCREEN
removeRightBar = true;

// MAKE A CLEANER STREETVIEW BY REMOVING TOP BAR
removeTopBar = true;

// REPLACE FLAGS AT THE END OF A GAME WITH NUMBERED FLAGS
replaceFlags = true;





// NO NEED TO EDIT BELOW THIS LINE



//IMAGES
const IMAGES = [
  'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAACXBIWXMAAC4jAAAuIwF4pT92AAACjUlEQVR4nO2aT4hNURzHf1cTMVn4GzWUkoWUhVIsxIYVg7KwEaYGpZCkKItBzZQkSixkMjUkCxaKrSxYyv8/G2IhiiQl8XyOc5n7NPPc7n3nfa/mfOrTu2+65/1+9/vuPfe9M6+tVqvZaKZN3YCaGIC6ATUxAHUDamIA6gbUxADUDaiJAagbUBMDUDegJnQAy3ErLsYJ+Biv4wB+CFw7F6UC4Kv0dh5WpU/PJklyI92e6Z7j6r+GzMKVeARPY5+Jgyh7BizEten2zfRxGV7BaQ3GTcT92I3H8CR+LlB/DP4oMO4PIS6Bfmt88Fkm4VHchcfNnzUfc46dj+vNn02FCRFAUmDMdOzFg3jRfIh3bfh3dzxuw8M4WKzFIap2F3CXRnfqe7yFT/Cd+Ul0gfk5Z3KzClYtgCxTzZ/iQalyAC0hBqBuQE0MQN2AmhiAugE1MQB1A2piAIFf/ymexzv4FefhGvPrBGMD185FqAA+4T48h98zf3dBXMAO3Is7cFygHnIRIoCHuBtfNNjnNe7BE3gINwXq5Z+EKLoOv+Xc9yV2mV8aO4AbLf+l8cb8SlIpQgSQ9+CzPMPN5hdEutLtOSPs6xZJLps/y94WqFVH1e4C7l3tSXWLHytwLs7AL/gIr5kPrClULYAsD1KDUuUAWkJVAmjHTlyKO1tZWBmAm+3dP0nczO8O3oXwvNVNKAJYYv6+vwGnCOrXoQjgFC4S1B2WqswBMlQBuI/Cl/A2XhX18AtFAFvMf19wn+hmC+rXoQjgvqDmiMQ5QN2Amhh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x8JDOJ1pKZc4Zn1WHeAohrJJkhLqo8B+BFIQBtA9oKAWgb0FYIQNuAtkIA2ga0FQIQ/vwWcBbcAx1gClhMpk7QT7hvJ0kF8BVsA2fA79jrHMR5MA5sBRtAfyEPTpII4AnYDF6WafMabAFHQSNYLeSloiQ6XQp+OrZ9BerIlMZ2gpXkfmq8IVNJqkoSAbgefFwvwBoyBZE6+3xiibZcJLlKZpS9T9FXD+XtKsDf6h4LFz/mgclgDGgHT8F1MoFlorwFENdji6jyHIAXaQTAw9ql1HUYFGSt6ATA9w02OrQ7IW2EpRGAa0X3k6gLK40ARiS2eWZvL9LOyy2zPATAP5wyu6z9r/IQQKuChy5pzwH8R8n1XqCItEcAL1W/QuZy9xDcBN98mvEdAPc3NLG9IrbNt8j5HyLf8e3wZcinePiXu3s8GDSQWVGyEPySNuQ7gB9gOWiz27yOYDqZRRa1sXa8ioSLJcelDVUbwCnqXhnyyKE9n9/NRV5vtOyOvbaK8h5AFEV80C4HXkk8GfJKkYaYpwkZfG5F+T4FeCXIhxLv8SkQ99NWol2m8h0Az/BTySyiegDekpn4ZoMdibZ3fBjyHQCv+phpKSeeK5rk7fgPIPkzuJj4XyD/NijIWjHyHQBPdLzCi2sCAxLvvQMXwSEqPU9kLt8BNFv6gklkRgRXefngC569/JNWTZBL5y1KffdQKIpqG9BWCEDbgLZ6fQB/AYF2gh8Ua2M5AAAAAElFTkSuQmCC'
];


//LISTENER
document.addEventListener('DOMContentLoaded', () => {
  console.log("DOMContentLoaded");
		setTimeout(() => {
  		executeRealTime();
    }, 500);
    setTimeout(() => {
      executeRealTime();
    }, 1000);
    setTimeout(() => {
      executeRealTime();
    }, 1500);
  
  //IF FLAG REPLACE
  if(replaceFlags){
		tryThrice();
  
    document.addEventListener('mouseup', tryThrice);
    document.addEventListener('mousedown', tryThrice);      
  }
});

//CLICK
document.addEventListener('click', () => {
  console.log("Click");
		setTimeout(() => {
  		executeRealTime();
    }, 500);
    setTimeout(() => {
      executeRealTime();
    }, 1000);
    setTimeout(() => {
      executeRealTime();
    }, 1500);

});

//REAL TIME
function executeRealTime(){
  console.log("Real time");
  if(removeBottomBar){
    doRemoveBottomBar();
  }
  if(removeRightBar){
    doRemoveRightBar();
  }
	if(removeTopBar){
    doRemoveTopBar();
  }
}

//BOTTOM BAR
function doRemoveBottomBar(){
	addGlobalStyle(`
	  .game-layout__in-game-ad {
	  	display: none;
	  }
  `);
}

//RIGHT BAR
function doRemoveRightBar(){
  addGlobalStyle(`
    .result__right {
      display: none;
    }
  `);
}

//TOP BAR
function doRemoveTopBar(){
  if(window.location.pathname.includes("game") || window.location.pathname.includes("challenge")){
    addGlobalStyle(`
			.layout {
				--layout-header-height: 0;
			}
      .header__right{
				display: none;
      }
		`);
  }
  else{
    addGlobalStyle(`
			.layout {
				--layout-header-height: 3rem;
			}
      .header__right{
				display: block;
      }
		`);
  }
}

//CHANGE FLAGS
function changeFlags(){
  let flags = document.getElementsByClassName("pin__image");

  if (flags.length === 5) {
    Array.prototype.forEach.call(flags, (flag, index) => {
        flag.src = IMAGES[index];
    });
  }
}

function tryThrice(){
  setTimeout(changeFlags, 0);
  setTimeout(changeFlags, 500);
  setTimeout(changeFlags, 1000);
}

// GLOBAL STYLES INJECTOR
function addGlobalStyle(css) {
  let head;
  let style;
  head = document.getElementsByTagName('head')[0];
  if (!head) { return; }
  style = document.createElement('style');
  style.type = 'text/css';
  style.innerHTML = css.replace(/;/g, ' !important;');
  head.appendChild(style);
}

//END