LA_tracking

Lord_Antichrist battle tracking

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.

(У мене вже є менеджер скриптів, дайте мені встановити його!)

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 LA_tracking
// @homepage        https://greasyfork.org/ru/scripts/375288-la-tracking
// @namespace       https://greasyfork.org/ru/scripts/375288-la-tracking
// @description     Lord_Antichrist battle tracking
// @author          Kleshnerukiy
// @version         1.0
// @include         *//gray-coven.clan.su*
// @grant           GM_getValue
// @grant           GM_setValue
// @grant           GM_xmlhttpRequest
// ==/UserScript==

(function () {
    var id_battle = false;
    var LA_alert = document.createElement('a');
    var div_LA_alert = document.createElement('div');
    div_LA_alert.style.position = 'absolute';
    div_LA_alert.style.top = '0px';
    div_LA_alert.style.right = '0px';

    function reloadStatus() {
        GM_xmlhttpRequest({
            method: 'GET',
            url: 'http://hwmfamily.ru/coven/la_tracking.txt',
            overrideMimeType: 'text/html; charset=windows-1251',
            onload: function(resp) {

                if (resp.responseText != 'false') {
                    LA_alert.innerHTML = '<a href="https://www.heroeswm.ru/war.php?warid='+resp.responseText+'"><span style="color: #00ff00;">LA в бою!</span></a>&nbsp;';
                } else {
                    LA_alert.innerHTML = '<a href="#"><span style="color: #ff0000;">LA не в бою!</span></a>&nbsp';
                }

                document.body.appendChild(div_LA_alert);
                div_LA_alert.appendChild(LA_alert);
            }
        });
    }

    reloadStatus();
    setInterval(function() {reloadStatus();}, 30000);
})();