Trollbox Ping

Pings you when somones says your name on Trollbox.

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

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

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

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

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

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.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name         Trollbox Ping
// @namespace    trollboxping
// @version      1.1
// @description  Pings you when somones says your name on Trollbox.
// @author       1024x2
// @match        *://*.windows93.net/trollbox/
// @grant        none
// ==/UserScript==

function handleMsg(event) {
  if (event.target.parentNode.id == "trollbox_scroll") {
    if (event.target.children[2].innerText.includes(pseudo.replace(/​/g, "")) && event.target.children[1].innerText != "→" &&
        event.target.children[1].innerText != "←" && event.target.children[1].innerText != "~") {
      new Audio("https://canary.discordapp.com/assets/dd920c06a01e5bb8b09678581e29d56f.mp3").play();
      event.target.children[2].style.backgroundColor = "rgba(255, 255, 0, 0.25)";
    }
  }
}

document.getElementById("trollbox_scroll").addEventListener("DOMNodeInserted", handleMsg);