diebos6972 / TravianAllarm

// ==UserScript==
// @name           TravianAllarm
// @namespace      https://github.com/diebos6972/Trv
// @author         DiegoB
// @description    Allarme per traviati
// @date           29.09.2015
// @version        2.4.2
// @include 	http://*.travian*.*/dorf1.php*
// @exclude 	http://www.travian*.*
// @exclude 	http://forum.travian*.*
// @exclude 	http://board.travian*.*
// @exclude 	http://shop.travian*.*
// @exclude 	http://*.travian*.*/hilfe.php*
// @exclude 	http://*.travian*.*/dorf2.php*
// @exclude 	http://*.travian*.*/tutorial.php*
// @exclude 	http://*.travian*.*/manual.php*
// @exclude 	http://*.travian*.*/ajax.php*
// @exclude 	http://*.travian*.*/ad/*
// @exclude 	http://*.travian*.*/chat/*
// @exclude 	http://*.travian*.*/activate.php*
// @exclude 	http://*.travian*.*/support.php*
// @exclude  	http://help.travian*.*/*log
// @exclude 	*.css
// @exclude 	*.js
// ==/UserScript==

//***********************************************************************************************************



/* getElementByClass
/**********************/

b=1
t=setTimeout("attack()",4000);	     

var main, newElement,t;
main = document.getElementById('movements');

var player = document.createElement('audio');
player.src = 'https://dl.dropbox.com/u/7079101/coin.mp3';
player.preload = 'auto';


if (main) {
	var infobar = document.createElement("div");

	infobar.innerHTML = '<div id="status" align="center" style="margin: 0 auto 0 auto; ' +
    'border-bottom: 1px solid #000000; margin-bottom: 5px; ' +
    'font-size: small; ' +
    'color: red;"> ' +
    '<b></b></div> ';
	if(b==1)
	{
infobar.innerHTML=infobar.innerHTML + '<span style="color:red">     Sound Monitor  -  Attivo</span></marquee>';
	}
    main.parentNode.insertBefore(infobar, main);
}
var logo = document.createElement("div");

var allHTMLTags = new Array();
function attack(){
allHTMLTags=document.getElementsByTagName("*");
for (i=0; i<allHTMLTags.length; i++) {
if (allHTMLTags[i].className==" attack") {
   player.play();
   clearTimeout(t);
break;     
}
if (allHTMLTags[i].className=="att1") {
   player.play();
   clearTimeout(t);
break;     
}
}
}
setTimeout("location.reload(true);",60000);
attack();