Zavadovsky / AttackCheker

// ==UserScript==
// @name       AttackCheker
// @namespace  SHATL
// @version    V6
// @description  enter something useful
// @match    http://*.imperiaonline.org/imperia/game_v6/game/village.php
// @match    https://*.imperiaonline.org/imperia/game_v6/game/village.php
// @copyright  2015+, You
// ==/UserScript==

function addJQuery(callback) {
    var script = document.createElement("script");
    script.setAttribute("src", "//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js");
    script.addEventListener('load', function() {
        var script = document.createElement("script");
        script.textContent = "window.jQ=jQuery.noConflict(true);(" + callback.toString() + ")();";
        document.body.appendChild(script);
    }, false);
    document.body.appendChild(script);
}


document.body.style.background = 'aqua';
setInterval(
function checker(){
var sound = document.createElement('object');
sound.setAttribute('width', '5px');
sound.setAttribute('height', '5px');
sound.setAttribute('data', 'http://www.freesfx.co.uk/rx2/mp3s/10/12498_1432687399.mp3');
       if( $('.ui-missions').html() != null && $('.ui-missions .attack-me').html() != null){
 	document.body.appendChild(sound);
    document.body.style.background = 'red';
        }   
},5000);