Greasy Fork is available in English.

KD Counter

This script shows your K/D (Kill/Death ratio). It calculates the ratio by dividing the number of players you have killed by the number of players you have been killed by. The K/D ratio is displayed only in the Profiles section.

// ==UserScript==
// @name         KD Counter
// @namespace    http://tampermonkey.net/
// @version      0.2
// @description  This script shows your K/D (Kill/Death ratio). It calculates the ratio by dividing the number of players you have killed by the number of players you have been killed by. The K/D ratio is displayed only in the Profiles section.
// @author       ilyax
// @match        https://sploop.io/
// @icon         https://www.google.com/s2/favicons?sz=64&domain=sploop.io
// @license      MIT
// @grant        none
// ==/UserScript==

function updateKD() {
  var Kill = parseFloat(document.getElementById("total-kill").textContent);
  var Death = parseFloat(document.getElementById("total-death").textContent);

  var K_D = Kill / Death;

  if (isNaN(K_D)) {
    K_D = "Cannot Get";
  } else {
    K_D = K_D.toFixed(2);
  }

  var targetElement = document.querySelector("#profile-container > div.middle-main.profile-scores");

  var existingKD = targetElement.querySelector(".kd-value");
  if (existingKD) {
    existingKD.textContent = K_D;
  } else {
    var text1 = "KD =";
    var text2 = K_D;

    var kdElement = document.createElement("span");
    kdElement.classList.add("text-shadowed-3", "profile-score", "yellow-text", "kd-value");
    kdElement.textContent = text2;

    targetElement.appendChild(document.createTextNode(text1));
    targetElement.appendChild(kdElement);
  }
}

(function myLoop() {
  window.addEventListener("load", function() {
    document.querySelector("#profile-container > div.middle-main.profile-scores").style.width = "600px";

    updateKD();

    document.getElementById("total-kill").addEventListener("DOMSubtreeModified", updateKD);
    document.getElementById("total-death").addEventListener("DOMSubtreeModified", updateKD);
  });

  setTimeout(myLoop, 100);
})();