Color Changer (NOT WORKING)

NOT WORKING ANY MORE!

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

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

(I already have a user script manager, let me install it!)

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.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         Color Changer (NOT WORKING)
// @namespace    Super Color Name Changer
// @version      1.0.6
// @description  NOT WORKING ANY MORE! 
// @author       Arimas
// @license      MIT
// @match        *://agma.io/
// @grant        none
// ==/UserScript==

(function() {
  'use strict';

   var message = function (message, isError) {
      var curser = document.querySelector('#curser');

      curser.textContent = message;
      curser.style.display = 'block';
      curser.style.color = isError ? 'rgb(255, 0, 0)' : 'rgb(0, 192, 0)';

      window.setTimeout(function () {
        curser.style.display = 'none';
      }, 5000);
    };


    var colorInterval;

    window.addEventListener('miracleCommand', function(commandEvent) {
        if (commandEvent.command === '/blink') {
           $('#chtbox').val('').focus();
          if (colorInterval) {
              clearInterval(colorInterval);
              colorInterval = null;
              message('Nickname color blinking off');
          } else {
              colorInterval = setInterval(function(){document.getElementById('cGoldName').dispatchEvent(new MouseEvent("click"));},250);
              message('Nickname color blinking on');
          }
        }
    });
})();