Calculadora de Back y Snipe simple

  • Autor de hilo DeletedUser33427
  • Fecha de inicio

DeletedUser33427

Guest
A pesar que ya hay un script de calculadora de backs y snipeos simples, pero que es un poco extenso, yo pongo uno mas corto, y mas sencillo. Al inicio de los mundos todos necesitamos una herramienta sencilla para calcular backs o lanzar snipeos atacando a los babas, y algunos se confunden con el otro script por el horario GTM +2, etc.

Pues este es otro mas sencillo. Ya lo he testeado y funciona a la perfección.

Nombre de la Entrada: Calc. BT & Snipe
Texto al pasar el Mouse: Back Time y Snipeo Simple
URL de la imagen: La que gusten :)
Funcionamiento: Se puede ejecutar el Script en cualquier ventana, su ventaja es que se puede al identificar un ataque real con el TagTool, y copiar el tiempo de distancia y hora de llegada desde la misma ventana y ejecutar el script, para copiarlo, y calcular. Su desventaja para los snipeos, es que solo sirve para calcular un snipeo a un tren de nobles que viene en dos segundos diferentes, porque calculas la hora que debes atacar a un baba para snipear el tren.

Código:
javascript:if(game_data.player.premium == false) {
	UI.InfoMessage('Debes tener Cuenta Premium', 3000, true);
	end();
}

function calcular() {
	if(document.getElementById('bt1').value.match(/[0-9]{2}\:[0-9]{2}\:[0-9]{2}/) != null && document.getElementById('bt2').value.match(/[0-9]{2}\:[0-9]{2}\:[0-9]{2}/) != null) {
	var timeArray = document.getElementById('bt1').value.split(':');
	var travArray = document.getElementById('bt2').value.split(':');
	var result;
	
	//Back Time
	var h = parseInt(timeArray[0], 10) + parseInt(travArray[0], 10);
	var m = parseInt(timeArray[1], 10) + parseInt(travArray[1], 10);
	var s = parseInt(timeArray[2], 10) + parseInt(travArray[2], 10);

	if (s > 60) {
		m += 1;
		s -= 60;
	}
	if (m > 60) {
		h += 1;
		m -= 60;
	}
	if (h >= 24) {
		h -= 24;
	}
	if (s < 10) {
		s = '0' + s;
	}
	if (m < 10) {
		m = '0' + m;
	}
	if (h < 10) {
		h = '0' + h;
	}
	result = h + ':' + m + ':' + s;
	$("#resultado").html("Back:&nbsp; " + result + " (Tropas retornan)");
	
	//Snipe
	var H = parseInt(timeArray[0], 10) - parseInt(travArray[0], 10);
	var M = parseInt(timeArray[1], 10) - parseInt(travArray[1], 10);
	var S = parseInt(timeArray[2], 10) - parseInt(travArray[2], 10);
	
	if(S < 0) {S = 60 - (S * -1);M --;}
	if(M < 0) {M = 60 - (M * -1);H --;}
 	if(H < 0 ) {H = 24 - (H * -1);if(H>10) {H = 'Ontem às ' + H;}else if(H<10) {H = 'Ontem às ' + H;}}
 	if(S<10) {S = '0' + S;}
 	if(M<10) {M = '0' + M;}
 	if(H<10) {H = '0' + H;}	
	
	result = H + ':' + M + ':' + S;
	$("#resultado").html($("#resultado").html() + "<br />Snipe: " + result);
	$("#resultado").fadeIn("slow");
	} else {
		$("#resultado").html("<p style='color: red;'>Formato de horas incorreto!<br />Utilize: HH:MM:SS</p> ");
		$("#resultado").fadeIn("slow");
	}
}

var contenido = '<div style=max-width:600px;>' +
'<h2 class="popup_box_header">Calc. BT & Snipe</h2>' +
'<p><div style="text-align: center;">Hora de Llegada<br /><input type="text" id="bt1"><br />Duración<br /><input type="text" id="bt2"><br /><br /><input onClick="calcular()" style="padding-left: 28px; background: #6C4824 url(https://brtwscripts.com/calc-icon.png) no-repeat 10px" class="btn" type="submit" value="Calcular"></div></p>' +
'<div id="resultado" style="display: none;">Back:&nbsp; xx:xx:xx<br />Snipe: xx:xx:xx</div>' +
'</div>';

Dialog.show('bt_snipe_calc', contenido);

Esta herramienta es perfecta para los inicios de un mundo, espero que sea un buen aporte :)

AGREGO: Esta herramienta la saqué de un servidor con otro idioma, y traduje pequeñas variaciones, pero funciona a la perfección.
 
Última edición por un moderador:
Arriba