GMify

Pretend to be GM

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

You will need to install an extension such as Tampermonkey to install this script.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği indirebilmeniz için ayrıca Tampermonkey gibi bir eklenti kurmanız gerekmektedir.

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Zateb bir user-style yöneticim var, yükleyeyim!)

// ==UserScript==
// @name         GMify
// @version      20231020-3
// @description  Pretend to be GM
// @author       soup_steward
// @match        https://www.chess.com/*
// @match        https://chess.com/*
// @require http://code.jquery.com/jquery-latest.js
// @grant        none
// @license        MIT
// @inject-into content
// @namespace https://greatest.deepsurf.us/users/964951
// ==/UserScript==

function waitForElm(selector) {
    return new Promise(resolve => {
        if (document.querySelector(selector)) {
            return resolve(document.querySelector(selector));
        }

        const observer = new MutationObserver(mutations => {
            if (document.querySelector(selector)) {
                resolve(document.querySelector(selector));
                observer.disconnect();
            }
        });

        observer.observe(document.body, {
            childList: true,
            subtree: true
        });
    });
}

function setGmStatus(){



    $('#board-layout-player-bottom > div > div.player-tagline > div.player-game-over-component > div > span.rating-score-rating').html(
  parseInt($('#board-layout-player-bottom > div > div.player-tagline > div.player-game-over-component > div > span.rating-score-rating').html()) +2000
    );


    $('.user-tagline-rating').html(
  parseInt($('.user-tagline-rating').html().replace("(","").replace(")","")) +2000
    );

  $('#board-layout-player-bottom > div > div.player-tagline > div.user-tagline-component').prepend('<a href="/members/titled-players" target="_blank" class="user-chess-title-component" data-tooltip-target="10">GM</a>');



};

waitForElm('.rating-score-rating').then((elm) => {

setGmStatus();
  setElo();

});


waitForElm('#board-layout-player-bottom > div > div.player-tagline > div > span').then((elm) => {

setGmStatus();
  setElo();

});



$('#board-layout-player-bottom > div > div.player-tagline > div.player-game-over-component > div > span.rating-score-rating').bind('DOMSubtreeModified', function(e) {
  setGmStatus();
  //setElo();
});