hwm_add_diamond

Отображает 100500 бриллиантов (скрипт-шутка) (by Demin)

Dovrai installare un'estensione come Tampermonkey, Greasemonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Userscripts per installare questo script.

Dovrai installare un'estensione come ad esempio Tampermonkey per installare questo script.

Dovrai installare un gestore di script utente per installare questo script.

(Ho già un gestore di script utente, lasciamelo installare!)

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

(Ho già un gestore di stile utente, lasciamelo installare!)

// ==UserScript==
// @name           hwm_add_diamond
// @author         Demin
// @namespace      Demin
// @description    Отображает 100500 бриллиантов (скрипт-шутка) (by Demin)
// @homepage       https://greasyfork.org/users/1602-demin
// @icon           http://i.imgur.com/LZJFLgt.png
// @version        2.0
// @encoding 	   utf-8
// @include        http://www.heroeswm.ru/*
// @include        http://qrator.heroeswm.ru/*
// @include        http://178.248.235.15/*
// @include        http://www.lordswm.com/*
// @exclude        */rightcol.php*
// @exclude        */ch_box.php*
// @exclude        */chat*
// @exclude        */ticker.html*
// @exclude        */frames*
// @exclude        */brd.php*
// ==/UserScript==

// (c) 2012-2015, demin  ( http://www.heroeswm.ru/pl_info.php?id=15091 )

(function() {

var version = '2.0';


var diamonds = "100,500";


if ( !document.querySelector("body") ) return;

// polychenie nika
var flash_heart = document.querySelector("object > param[value*='heart.swf']");
if ( flash_heart ) flash_heart = flash_heart.parentNode.querySelector("param[name='FlashVars']");
if ( flash_heart ) {
	flash_heart = flash_heart.value.split('|');
	if ( flash_heart[3] ) { var nick = flash_heart[3]; }
}

if ( !nick ) return;

var parent = document.querySelector("img[src*='i/diamond.gif']");
if ( !parent ) return;
while ( parent.tagName != 'TD' ) { parent = parent.parentNode; }
var previous = parent.previousSibling;
while ( previous.tagName != 'TD' ) { previous = previous.previousSibling; }
previous = previous.previousSibling;
var next = parent.nextSibling;
if ( previous && previous.tagName == 'TD' && previous.querySelector("img[src*='i/gem.gif']") && next && next.tagName == 'TD' ) {
	next.innerHTML = diamonds;
}

})();