[HWM] countMonstersArts

Подсчёт количества наноартов

Du musst eine Erweiterung wie Tampermonkey, Greasemonkey oder Violentmonkey installieren, um dieses Skript zu installieren.

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 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.

Sie müssten eine Skript Manager Erweiterung installieren damit sie dieses Skript installieren können

(Ich habe schon ein Skript Manager, Lass mich es installieren!)

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         [HWM] countMonstersArts
// @version      0.10.0
// @description  Подсчёт количества наноартов
// @author       Komdosh
// @match        http*://*.heroeswm.ru/arts_for_monsters.php*
// @grant        none
// @namespace https://greasyfork.org/users/13829
// ==/UserScript==

var headers = Array.from(document.querySelectorAll("td>b, td>a")).slice(0,9);
var count = 0;

for (var header of headers){
   count+=parseInt(header.innerHTML.split('(')[1].split(')')[0]);
}

var center = document.querySelector("center > b");
center.innerHTML+="<br>Количество артефактов существ: "+count;


var lsName = 'KomdoshScript_ArtsForMonsterCount';
if(!localStorage.getItem(lsName)){
    localStorage.setItem(lsName, count);
}

if(localStorage.getItem(lsName) && localStorage.getItem(lsName)<count){
    var all = localStorage.getItem('HWMCMA');
    center.innerHTML+=" <font color='green' weight='bold'>+"+(count-all)+"</font>";
    localStorage.setItem('HWMCMA', count);
}