Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name test
- // @namespace http://tampermonkey.net/
- // @version 0.1
- // @description try to take over the world!
- // @author You
- // @match https://*/*
- // @grant none
- // ==/UserScript==
- (function() {
- 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("قوات المهاجم سترجع في: " + result + ".");
- //قنص
- 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 />قنص: " + result);
- $("#resultado").fadeIn("slow");
- } else {
- $("#resultado").html("<p style='color: Blue;'>قم بوضع التوقيت <br />بهذا الشكل: 01:23:45</p> ");
- $("#resultado").fadeIn("slow");
- }
- }
- var conteudo = $('#show_incoming_units').before('<center>'+
- '<br>'+
- '<b style="font-family:Times New Roman; font-size:18px;font-style:italic;">تم تعديل السكربت من قبل: <a id="Salim" href="https://forum.tribalwars.ae/index.php?members/abu-rajih.40926/" target="_blank" style="color:#111;font-family:Times New Roman;font-size:20px;font-style:italic;">سيد الاساطير</a>'+
- '</b></center>'+
- '<style>'+
- '#Salim{animation: salim 2s linear infinite;}'+
- '@keyframes salim{'+
- '0% {text-shadow:0 0 3px #0d0;}'+
- '20% {text-shadow:0 0 3px #d00;}'+
- '40% {text-shadow:0 0 3px #d0d;}'+
- '60% {text-shadow:0 0 3px #00d;}'+
- '75% {text-shadow:0 0 3px #000;}'+
- '90% {text-shadow:0 0 3px #f00;}'+
- '100%{text-shadow:0 0 3px #0d0;}}'+
- '</style></center>'+
- '<b style="font-family:times new roman"><div style="text-align: center;font-family:times new roman"> سرعة الوحده المتجهة للقرية:'+
- '<input placeholder=" 01:23:45" style="font-weight:bold;font-family:times new roman;text-align:center" type="text" id="bt2"> وقت وصول الهجمه:'+
- '<input placeholder="ادخل وقت وصول الهجمه" style="font-weight:bold;font-family:times new roman;text-align:center" type="text" id="bt1">'+
- '<input onClick="calcular()" style="padding-center: 28px; background: #6C4824 url(https://brtwscripts.com/calc-icon.png) no-repeat 10px" class="btn" type="submit" value="حساب وقت الباك تايم">'+
- '</div></b>');
- $('#show_incoming_units').before('<b id="resultado" style="display: none;">باك تايم: xx:xx:xx<br />قنص: xx:xx:xx</b>');
- var TimeForAttackWillBeInMyVillage;
- $('#commands_incomings > form > table > tbody > tr.command-row.no_ignored_command').each(
- function(){
- /* */
- TimeForAttackWillBeInMyVillage = $(this).find('td:nth-child(2) > span').parent().text().replace(/[ا-ي ; a-z ; A-Z]/g , '').replace(/:[0-9]{3}/g , '');
- });
- /* */
- $('#bt1').val(TimeForAttackWillBeInMyVillage);
- })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement