Try to take over the world!
当前为
// ==UserScript==
// @name DC_safe_zone
// @author Ladoria
// @version 0.1
// @namespace DC_custom
// @description Try to take over the world!
// @match http://www.dreadcast.net/Main
// @grant none
// ==/UserScript==
$(document).ready( function() {
$('body').append('<style> #dc_safe_zone { background: url("http://img4.hostingpics.net/pics/703237distancerats.png") no-repeat; top: 150px; left: 150px; width: 400px; height: 400px; float: left; z-index: 1000; display: none; }</style>'); // CSS de la zone.
$('#carte').append('<div id="dc_safe_zone"></div>'); // HTML de la zone.
});
function display_safezone() {
if (true == /SOUTERRAIN/gi.test($('#lieu_actuel .titre1').html())) // Pas de souseterrain ? Quitter.
return;
if ("GRATTE-CIEL D'HABITATION" !== $('#lieu_actuel .titre1').html()) // Pas de souseterrain ? Quitter.
return;
if(0 == $('#combat_barre_out').length) {// Pas de combat ? Cacher la zone, quitter.
$('#dc_safe_zone').hide();
return;
}
$('#dc_safe_zone').show(); // Sinon, afficher la zone.
}
$(document).ajaxComplete( function(a,b,c) { // A chaque refresh même invisible
if(/Check/.test(c.url)) { // Durant certains refresh
display_safezone();
}
});
console.log('DC - Save Zone started');