Advertisement
Tikabum

COMMANDER (TAMPER)

Dec 17th, 2017
417
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 27.66 KB | None | 0 0
  1. // ==UserScript==
  2. // @name COMMANDER
  3. // @include https://*&screen=place*
  4. // ==/UserScript==
  5.  
  6. //⭐ PRESSIONE A TECLA "T" APÓS ATIVAR O SCRIPT PARA ABRIR A TELA DE AJUDA COM INFORMAÇÕES DETALHADAS SOBRE CADA FUNÇÃO
  7. //⭐ CONFIGURAÇÕES ACERCA DO ENVIO DE COMANDO AO FINAL DO SCRIPT
  8. //⭐ O SCRIPT RODA AS COORDENADAS DE FORMA ALEATÓRIA!
  9. //⭐ LEGENDA ABAIXO:
  10.  
  11. //⛔ = NÃO ENCOSTE, IGNORE!
  12. //⚫ = COSTUMIZAÇÃO LIBERADA
  13. //⚪ = MEXER APENAS SE TIVER CONSCIÊNCIA
  14. //⭕ = CONFIGURAÇÕES DE NOTIFICAÇÃO (MENSAGENS DE ERROR)
  15. //⚡ = INFORMAÇÃO ADICIONAL SOBRE CADA SEÇÃO COSTUMIZÁVEL
  16.  
  17.  
  18. /* ⚫⚫⚫⚫⚫ INÍCIO DA SEÇÃO DE CONFIGURAÇÕES INICIAIS ⚫⚫⚫⚫⚫ */
  19.  
  20.  
  21. /*⚡ DEFINA SE O SCRIPT IRÁ TROCAR DE ALDEIA AUTOMATICAMENTE ⚡*/ var altAldeia = 0;
  22.  
  23. /*⚡ SELECIONAR TIPO DO COMANDO (TRUE=ATAQUE)|(FALSE=APOIO) ⚡*/ var Ataque = false;
  24.  
  25. /*⚡ DEFINIR NÚMERO DE EXPLORADORES ENVIADOS POR ATAQUE ⚡*/ var Tsalkapone_scouts=0;
  26.  
  27. /*⚡ DEFINIR ORDEM PRIORITÁRIA E TROPAS (0=IGNORAR) ⚡*/ var Tsalkapone_units_order={ram:0,catapult:0,sword:0,spear:0,axe:0,light:0,archer:0,marcher:0,heavy:0}; // Altere a Ordem das undiades para definir a ordem prioritária, em seguida selecione a quantidade de unidades a ser enviada a cada Fake!
  28.  
  29. /*⚡ DEFINIR AS COORDENADAS A SEREM ATACADAS ⚡*/ var Tsalkapone_coords='397|467';
  30.  
  31. /*⚫ SEÇÃO PARA CONFIGURAÇÃO DE NOMES DOS COOKIES ⚫*/
  32. var config={
  33. /*⚡ DEFINIR NOME DA LISTA DE ALVOS ⚡*/ Tsalkapone_target:'Topa', // Colocar o Nick dos Jogadores Alvo
  34. /*⚡ DEFINIR QUANTAS VEZES CADA COORDENADA DEVERÁ SER ATACADA ⚡*/ Tsalkapone_repeat:1,
  35. /*⚡ COOKIE DOS SCRIPTS (SALVA SEQUÊNCIA ATUAL DE ALDEIAS) ⚡*/ Tsalkapone_cookieID:'ApoioTopa'}; //Sempre utilize Nomes diferentes para cada Scipt. Caso contrário a sequencia das coordenadas atacadas em um irá interferir na outra!
  36.  
  37. /*⚫ SEÇÃO PARA PREENCHIMENTO DE TROPAS TOTAIS, SEJA POR UNIDADE OU SELECIONANDO TODAS AS TROPAS DISPONÍVEIS ⚫*/
  38. /*⚡ TRUE = SELECIONA TODOS OS LANCEIROS DISPONÍVEIS ⚡*/ var spear1 = false;
  39. /*⚡ TRUE = SELECIONA TODOS OS ESPADACHINS DISPONÍVEIS ⚡*/ var sword1 = false;
  40. /*⚡ TRUE = SELECIONA TODOS OS BÁRBAROS DISPONÍVEIS ⚡*/ var axe1 = false;
  41. /*⚡ TRUE = SELECIONA TODOS OS ARQUEIROS DISPONÍVEIS ⚡*/ var archer1 = true;
  42. /*⚡ TRUE = SELECIONA TODOS OS EXPLORADORES DISPONÍVEIS ⚡*/ var spy1 = false;
  43. /*⚡ TRUE = SELECIONA TODAS AS CAVALARIAS LEVES DISPONÍVEIS ⚡*/ var light1 = false;
  44. /*⚡ TRUE = SELECIONA TODOS OS ARQUEIROS À CAVALO DISPONÍVEIS ⚡*/ var marcher1 = false;
  45. /*⚡ TRUE = SELECIONA TODAS AS CAVALARIAS PESADAS DISPONÍVEIS ⚡*/ var heavy1 = true;
  46. /*⚡ TRUE = SELECIONA TODOS OS ARÍETES DISPONÍVEIS ⚡*/ var ram1 = false;
  47. /*⚡ TRUE = SELECIONA TODAS AS CATAPULTAS DISPONÍVEIS ⚡*/ var catapult1 = false;
  48. /*⚡ TRUE = SELECIONA TODOS OS NOBRES DISPONÍVEIS ⚡*/ var snob1 = false;
  49.  
  50. /*⚡ TRUE = SELECIONA TODAS AS TROPAS DISPONÍVEIS NA ALDEIA ⚡*/ var selectAllUnits = false;
  51.  
  52.  
  53. /* ⚫⚫⚫⚫⚫ FIM DA SEÇÃO DE CONFIGURAÇÕES INICIAIS ⚫⚫⚫⚫⚫ */
  54.  
  55.  
  56. /* ⚪⚪⚪ INÍCIO DAS CONFIGURAÇÕES DE TRADUÇÃO ⚪⚪⚪ */
  57. var get_lang = localStorage.getItem("rally_point_script_lang");
  58. var lang="";
  59. if (get_lang === null) {lang = "brazilian";}
  60. else { lang = ""+get_lang+"";}
  61. var supported_languages =["greek","english","brazilian"];
  62. var lang_check = supported_languages.indexOf(lang);
  63. /*⭕⭕⭕*/ if (lang_check < 0) {UI.ErrorMessage('<font color=gold><b><center><u>'+tsalkapone_trans.general.notification+' Tsalkapone</u></center></b></font> <br><br> The selected language is not supported. Please select one of the supported languages.',/*⭕TEMPO*/ 50);} /* ⚡ DEFINE TEMPO EM QUE A MENSAGEM DE "IDIOMA NÃO SUPORTADO" PERMANECERÁ NA TELA ⚡ */
  64. else {
  65. var tsalkapone_trans = (function() {
  66. var tsalkapone_trans = {};
  67. tsalkapone_trans.brazilian= {
  68. general:{
  69. script:"FAKE ALETATÓRIO (Script Nº2)",
  70. notification:"Notificação",
  71. message_no:"Não",
  72. message_yes:"Sim",
  73. message_1:"O Script deve ser Ativado na Praça de Reunião",
  74. message_2:"Você gostaria de ser Redirecionado à Praça?",
  75. comm:"Sinta-se livre para Relatar qualquer BUG do Script ou Enviar Sugestões de Melhoria.",
  76. units:"Método de Inserção de Unidades",
  77. coords:"Método de Inserção de Coordenadas",
  78. variables:"Variáveis Costumizáveis",
  79. fake_lang:"Idioma",
  80. info1:"O Script usará Apenas UM Tipo de unidade, Baseado na Ordem Prioritária. Se o Valor de QUALQUER Unidade for Igual a 0(ZERO) o script irá Ignorar.",
  81. info2:"O Script Coordena os Ataques de forma ALEATÓRIA, você também pode Selecionar QUALQUER Coordenada da Lista de Alvos",
  82. info3:"Defina o Número de Exploradores a ser Enviado em cada FAKE",
  83. info4:"Defina a Ordem Prioritária Alterando a Ordem das Unidades, e a Quantidade a ser Enviada de cada uma.",
  84. info5:"Escolha as Coordenadas de seus Alvos Desejados. Adicione quantas Desejar, sempre Separando-as com um Espaço",
  85. info6:"O Idioma de TODOS os scripts da Praça de Reunião é Definido pelo Idioma Selecionado no Script de Comando",
  86. info7:"Escolha a Palavra que será Utilizada como Nome da Lista de Alvos",
  87. info8:"Defina quantas vezes o Script irá Atacar cada Coordenada antes de passar à Próxima.",
  88. info9:"Escolha a Palavra que será Utilizada como o Nome do Cookie nas Configurações do Script",
  89. },
  90. notes:{
  91. coords:"Nenhuma Coordenada Detectada. Definal Alguns Alvos e Tente Novamente.",
  92. target:"Alvo Atual",
  93. list:"Lista de Alvos",
  94. creator:"Criado Por",
  95. last:"Essas foram as Últimas Coordenadas Selecionadas, Ative o Script Novamente para Reiniciar!",
  96. no_units:"Não Existem Unidades Disponíveis. Troque de Aldeia ou Modifique as Configurações e tente Novamente.",
  97. },
  98. };
  99. tsalkapone_trans.english= {
  100. general:{
  101. script:"Fake Script No2",
  102. notification:"Notification from",
  103. message_no:"No",
  104. message_yes:"Yes",
  105. message_1:"This script is activated on Rally Point.",
  106. message_2:" Do you want to automatically assign your location to this page?",
  107. comm:"Feel free to send any message regarding script bugs or proposing ideas to",
  108. units:"Units' Inserting Method",
  109. coords:"Coords' Inserting Method",
  110. variables:"Customizable Variables",
  111. fake_lang:"Language",
  112. info1:"The script will only use one type of unit, based on a customizable priority-order, to insert in the rally point. If the available units of a unit-type are equal to zero or below the selected value the script will skip this unit-type. The scouts are an exception to this rule and their value will be inserted regardless. You may re-order the priority of the units' choice by changing the units' order in the variable",
  113. info2:"The script chooses a coordinate out of the selected targets to insert in the rally point in a consecutive order. You may select a specific target from the targets' list which is displayed in the rally point",
  114. info3:"Define the value of the scouts to be inserted",
  115. info4:"Define the priority-order by changing the units' order and also define the value of each unit-type. The names of the units are the ones used as each unit's id in every server",
  116. info5:"Enter the coordinates of the desired targets. Add as many as you like separating them with space i.e.",
  117. info6:"The language of every rally point's script that doesn't display a settings menu is defined by the language selection in the script",
  118. info7:"Enter a value that will be used as the name of the targets' list",
  119. info8:"Define how many times the script will use a coordinate before changing to the next one in the list",
  120. info9:"Enter a value that will be used as cookie name for the script's settings",
  121. },
  122. notes:{
  123. coords:"No selected coords were detected. Define some targets and try again.",
  124. target:"Current target",
  125. list:"Target list",
  126. creator:"Created by",
  127. last:"These were the last selected coords. Activate the script again to restart.",
  128. no_units:"There were found no available units. Change village or settings and try again.",
  129. },
  130. };
  131. tsalkapone_trans.greek= {
  132. general:{
  133. script:"Fake Script No2",
  134. notification:"Ειδοποίηση από τον",
  135. message_no:"Όχι",
  136. message_yes:"Ναι",
  137. message_1:"Το συγκεκριμένο script ενεργοποιείται από το Μέρος Συγκέντρωσης.",
  138. message_2:"Επιθυμείτε αυτόματη ανακατεύθυνση;",
  139. comm:"Επικοινωνήστε ανά πάσα στιγμή για οποιαδήποτε ιδέα ή πρόταση σχετικά με τα scripts με τον",
  140. units:"Μέθοδος Εισαγωγής Μονάδων",
  141. coords:"Μέθοδος Εισαγωγής Συντεταγμένων",
  142. variables:"Προσαρμόσιμες Μεταβλητές",
  143. fake_lang:"Επιλογή Γλώσσας",
  144. info1:"Το script θα επιλέξει μόνο ένα είδος μονάδας για να εισάγει στο Μέρος Συγκέντρωσης. Η επιλογή βασίζεται σε μια σειρά προτεραιότητας που μπορεί να ρυθμιστεί. Αν η τιμή μιας μονάδας εντός του μέρους συγκέντρωσης είναι μικρότερη από την επιλεγμένη τιμή ή ίση με το μηδέν τότε θα αγνοηθεί από το script. Οι ανιχνευτές αποτελούν εξαίρεση του κανόνα και η τιμή τους εισάγεται ανεξάρτητα από τις υπόλοιπες τιμές. Η σειρά προτεραιότητας των μονάδων καθορίζεται στη μεταβλητή",
  145. info2:"Το script επιλέγει συντεταγμένες, από τη λίστα των επιλεγμένων στόχων, με διαδοχική ακολουθία. Δύναται να επιλέξετε συγκεκριμένο στόχο από τη λίστα στόχων που εμφανίζεται στο Μέρος Συγκέντρωσης. Κάθε φορά που η ακολουθία ολοκληρώνεται θα λαμβάνετε σχετική ενημέρωση",
  146. info3:"Ορίστε τη τιμή των ανιχνευτών",
  147. info4:"Ορίστε τη σειρά προτεραιότητας των μονάδων και την τιμή τους. Τα ονόματα των μονάδων είναι αντίστοιχα των id κάθε είδους μονάδας που χρησιμοποιούνται από όλους τους servers",
  148. info5:"Εισάγετε τις συντεταγμένες των στόχων προσθέτοντας όσες επιθυμείτε διαχωρίζοντας τες με κενό π.χ.",
  149. info6:"Η γλώσσα κάθε script που λειτουργεί από το Μέρος Συγκέντρωσης και δεν διαθέτει ενσωματωμένο μενού ρυθμίσεων καθορίζεται από την επιλογή γλώσσας στο script",
  150. info7:"Εισάγετε μια τιμή που θα χρησιμοποιηθεί ως ονομασία της λίστας στόχων",
  151. info8:"Ορίστε πόσες φορές θα εισαχθεί μια συντεταγμένη πριν επιλεχθεί η επόμενη",
  152. info9:"Εισάγετε μια τιμή που θα χρησιμοποιηθεί ως ονομασία cookie για τις ρυθμίσεις του script",
  153. },
  154. notes:{
  155. coords:"Δεν εντοπίστηκαν αποθηκευμένες συντεταγμένες. Ορίστε μερικούς στόχους και ενεργοποιήστε εκ νέου το script.",
  156. target:"Τρέχων στόχος",
  157. list:"Λίστα στόχων",
  158. creator:"Δημιουργήθηκε από τον",
  159. last:"Αυτές ήταν οι τελευταίες αποθηκευμένες συντεταγμένες. Ενεργοποιήστε εκ νέου το script για επανεκκίνηση της ακολουθίας.",
  160. no_units:"Δεν βρέθηκαν διαθέσιμες μονάδες. Αλλάξτε χωριό ή ρυθμίσεις και δοκιμάστε ξανά.",
  161. },
  162. };
  163. return tsalkapone_trans[lang];
  164. }());
  165. }
  166.  
  167. var Dialog1;(function(){'use strict';Dialog1={MAX_WIDTH:1200,closeCallback:null,show:function(id,content,closeCallback,options){options=$.extend({class_name:'',close_from_fader:true},options);this.closeCallback=closeCallback;var fullscreenElement=document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement,container=fullscreenElement||'body',$container=$('.popup_box_container'),$box,$fader,$content,show_anim=false;if(!$container.length){show_anim=true;$container=$('<div class="popup_box_container" />');$box=$('<div class="popup_box" />').attr('id','popup_box_'+id).addClass(options.class_name).data('name',id).appendTo($container);$fader=$('<div class="fader" />').appendTo($container);$content=$('<div class="popup_box_content" />').appendTo($box);$container.appendTo($(container))}else{$box=$container.find('.popup_box');if($box.data('name')!==id){Dialog1.close();Dialog1.show(id,content,closeCallback,options);return};$content=$container.find('.popup_box_content');$box.css('width','auto')};$content.html(content);var height_buffer=125;if($(window).width()<500||$(window).height()<$content.height()+height_buffer){$box.addClass('mobile');$('.popup_box_content').css({'max-height':$(window).height()-(height_buffer/2)+'px'})};var border_width;if(typeof window.getComputedStyle==='function'){border_width=parseInt(getComputedStyle($box[0],null).borderLeftWidth)}else border_width=parseInt($box.css('border-left-width'));var min_width=200,width=Math.min(this.MAX_WIDTH,$content.width(),$(window).width()-border_width);if(width<min_width)width=min_width;if(!Modernizr.borderimage)width+=20;$box.css('width',width+'px');var hotkey_hint=(!mobile&&!mobiledevice&&HotKeys.enabled)?' :: ΟƒΟ…Ξ½Ο„ΟŒΞΌΞ΅Ο…ΟƒΞ· πληκτρολογίου: <b>Esc</b>':'',tooltip_class=(!mobile&&!mobiledevice)?'tooltip-delayed':'',$close=$('<a class="popup_box_close '+tooltip_class+'" title="ΞšΞ»Ξ΅Ξ―ΟƒΞ΅'+hotkey_hint+'" href="#">&nbsp;</a>').prependTo($content);UI.ToolTip($close,{delay:400});var close_elements=options.close_from_fader?'.fader, .popup_box_close, .popup_closer':'.popup_box_close, .popup_closer';$container.on('click',close_elements,function(){Dialog1.close(true);return false});if(show_anim)setTimeout(function(){$box.addClass('show')},50);UI.init();UnitPopup.init();setTimeout(QuestArrows.init,500)},close:function(by_user){$('.popup_box_container').remove();if(Dialog1.closeCallback)Dialog1.closeCallback(by_user);inlinePopupClose();$('.popup_style').hide();QuestArrows.init();return false},fetch:function(name,screen,get_params,callback,Dialog1_options,closeCallback){TribalWars.get(screen,get_params,function(data){Dialog1.show(name,data.Dialog1,closeCallback,Dialog1_options);if(callback)callback()})}}})();
  168.  
  169. window.addEventListener("keydown", tsalentoleskeyboard, false);
  170. function tsalentoleskeyboard(e) {
  171.  
  172. if (e.keyCode == "84") {
  173. var contact_url = "https://forum.tribalwars.net/member.php?114063-Tsalkapone";
  174. var content = '<div style=max-width:1000px;>' +
  175. '<h2 class="popup_box_header"><center><u><font color="darkgreen">Tsalkapone. '+tsalkapone_trans.general.script+'</font></u></center></h2>' +
  176. '<hr><p><font color=maroon><b><u>1. '+tsalkapone_trans.general.units+'</u></b></font></p>' +
  177. '<p>'+tsalkapone_trans.general.info1+' <font color="red"><b>Tsalkapone_units_order</b></font>.</p>'+
  178. '<p><hr><font color=maroon><b><u>2. '+tsalkapone_trans.general.coords+'</u></b></font></p>' +
  179. '<p>'+tsalkapone_trans.general.info2+'.</p>'+
  180. '<p><hr><font color=maroon><b><u>3. '+tsalkapone_trans.general.variables+'</u></b></font></p>' +
  181. '<font color="red"><b>Tsalkapone_scouts:</b></font> '+tsalkapone_trans.general.info3+'.'+
  182. '<br><br><font color="red"><b>Tsalkapone_units_order:</b></font> '+tsalkapone_trans.general.info4+'.'+
  183. '<br><br><font color="red"><b>Tsalkapone_coords:</b></font> '+tsalkapone_trans.general.info5+' <i>532|516 451|450 430|420</i>.'+
  184. '<br><br><font color="red"><b>Tsalkapone_target:</b></font> '+tsalkapone_trans.general.info7+'.'+
  185. '<br><br><font color="red"><b>Tsalkapone_repeat:</b></font> '+tsalkapone_trans.general.info8+'.'+
  186. '<br><br><font color="red"><b>Tsalkapone_cookieID:</b></font> '+tsalkapone_trans.general.info9+'.'+
  187. '<p><hr><font color=maroon><b><u>4. '+tsalkapone_trans.general.fake_lang+'</u></b></font></p>' +
  188. '<p>'+tsalkapone_trans.general.info6+' <b><font color="blue">Commander Script</font></b>.</p>'+
  189. '<center><img class="tooltip-delayed" title="<font color=darkgreen>Tsalkapone. '+tsalkapone_trans.general.script+'</font>" src="https://dl.dropboxusercontent.com/s/dt6t7jl1dqkjja9/Tsalkapone_joker.jpg" style="cursor:help; position: relative"></center><br><center>'+tsalkapone_trans.general.comm+' <a href="'+contact_url+'" title="Tsalkapone profile" target="_blank">Tsalkapone</a>.</center>' +
  190. '</div>';
  191. Dialog1.show('fakescript1_info', content);
  192. $("#go_man").click(function () { window.location.assign(game_data.link_base_pure+"place");});
  193. $("#close_this").click(function () { var close_this = document.getElementsByClassName('popup_box_close'); close_this[0].click(); });
  194. }
  195. }
  196.  
  197. var doc=document;
  198. //if(window.frames.length>0)doc=window.main.document;url=document.URL;
  199.  
  200. var Tsalactivepage = location.href.indexOf('screen=place') > -1;
  201. if (!Tsalactivepage) {
  202. var contact_url = "https://forum.tribalwars.net/member.php?114063-Tsalkapone";
  203. var content = '<div style=max-width:1000px;>' +
  204. '<h2 class="popup_box_header"><center><u><font color="darkgreen">Tsalkapone. '+tsalkapone_trans.general.script+'</font></u></center></h2>' +
  205. '<hr><p><center><font color=maroon><b>'+tsalkapone_trans.general.message_1+'</b></font></center></p>' +
  206. '<p><center><font color=maroon><b>'+tsalkapone_trans.general.message_2+'</b></font></center></p>' +
  207. '<br><br><center><input type="button" class="btn evt-confirm-btn btn-confirm-yes" id="go_man" value="'+tsalkapone_trans.general.message_yes+'">&emsp;<input type="button" class="btn evt-cancel-btn btn-confirm-no" id="close_this" value="'+tsalkapone_trans.general.message_no+'"></center>'+
  208. '<br><br><hr><center><img class="tooltip-delayed" title="<font color=darkgreen>Tsalkapone. '+tsalkapone_trans.general.script+'</font>" src="https://dl.dropboxusercontent.com/s/dt6t7jl1dqkjja9/Tsalkapone_joker.jpg" style="cursor:help; position: relative"></center><br><center><p>'+tsalkapone_trans.general.comm+' <a href="'+contact_url+'" title="Tsalkapone profile" target="_blank">Tsalkapone</a>.</p></center>' +
  209. '</div>';
  210. Dialog.show('fakescript2_info_intro', content);
  211. $("#go_man").click(function () { window.location.assign(game_data.link_base_pure+"place");});
  212. $("#close_this").click(function () { var close_this = document.getElementsByClassName('popup_box_close'); close_this[0].click(); });
  213. }
  214. else if(Tsalkapone_coords.replace(/^\s\s*/,'').replace(/\s\s*$/,'')==='')
  215. /*⭕⭕⭕*/ {UI.ErrorMessage('<font color=gold><b><center><u>'+tsalkapone_trans.general.notification+' Tsalkapone</u></center></b></font> <br><br> '+tsalkapone_trans.notes.coords+'',/*⭕TEMPO*/ 50);} /* ⚡ DEFINE TEMPO EM QUE A MENSAGEM DE "NENHUMA COORDENADA DETECTADA" PERMANECERÁ NA TELA ⚡ */
  216. else { /* ⚪⚪⚪ FIM DAS CONFIGURAÇÕES DE TRADUÇÃO ⚪⚪⚪ */
  217.  
  218.  
  219. /* ⛔⛔⛔⛔⛔ INICIO DO SCRIPT DO TSALKAPONE ⛔⛔⛔⛔⛔ */
  220.  
  221. /*==== register ====*/
  222. var script = {
  223. scriptname: 'Fake Script No2',
  224. version: '1.0',
  225. author: 'Tsalkapone',
  226. email: 'tsalkapone@hotmail.com',
  227. broken: false
  228. };
  229. $.post(ScriptAPI.url,script);
  230.  
  231. var coords=Tsalkapone_coords.split(' ');
  232. function escapeStr(text)
  233. {var specials=['/','.',',','~','`','@','#','%','-','_','*','+','?','|','$','=',':','!','^','<','>','(',')','[',']','{','}','\\'];
  234. var sRE=new RegExp('(\\'+specials.join('|\\')+')','g');
  235. return text.replace(sRE,'\\$1');}
  236. function zeroPad(number,length)
  237. {var n=number.toString();while(n.length<length){n='0'+n;}return n;}
  238. function fnWriteCookie(index)
  239. {var cookie_date=new Date(2099,11,11);
  240. eleDoc.cookie=vWorld+'$'+config.Tsalkapone_target+'$'+config.Tsalkapone_cookieID+'='+(index+1)+';expires='+cookie_date.toGMTString();}
  241. function fnAssignTsalkapone_μονάδες(index,isManualReset)
  242. {if((index<0)||(index>=coords.length))
  243. {index=0;
  244. /*⭕⭕⭕*/ if(eleDoc.fakeSequence==1){UI.ErrorMessage('<span id=tsalkaponelastsyn><b><font color=gold><u>'+tsalkapone_trans.general.notification+' Tsalkapone</u></font></b></span><br><br>'+tsalkapone_trans.notes.last+'',/*⭕TEMPO*/ 50);}} /* ⚡ DEFINE TEMPO EM QUE A MENSAGEM DE "ÚLTIMA COORDENADA" PERMANECERÁ NA TELA ⚡ */
  245. eleDoc.getElementById('fakescript2_Tsalkapone').selectedIndex=index;
  246. var villa=coords[index].split('|');
  247. if(!isManualReset&&(eleDoc.fakeSequence<config.Tsalkapone_repeat))
  248. {eleDoc.fakeSequence++;}
  249. else{eleDoc.fakeSequence=(isManualReset?2:1);
  250. fnWriteCookie(isManualReset?index-1:index);}
  251. var eleForm=document.forms[0];eleForm.x.value=villa[0];eleForm.y.value=villa[1];
  252. var count;
  253. if(Tsalkapone_scouts>0)
  254. {count=parseInt(eleForm.spy.nextSibling.nextSibling.innerHTML.match(/\d+/));
  255. if(count>0&&Tsalkapone_scouts<count){
  256. eleForm.spy.value=Math.min(Tsalkapone_scouts,count);}}
  257. for(var Tsalkapone in Tsalkapone_units_order){
  258. if(Tsalkapone_units_order.hasOwnProperty(Tsalkapone)){
  259. if((Tsalkapone_units_order[Tsalkapone]>0)&&(typeof(eleForm[Tsalkapone])!="undefined"))
  260. {count=parseInt(eleForm[Tsalkapone].nextSibling.nextSibling.innerHTML.match(/\d+/));
  261. if(count>0&&Tsalkapone_units_order[Tsalkapone]<count)
  262. {eleForm[Tsalkapone].value=Math.min(Tsalkapone_units_order[Tsalkapone],count);break;}
  263. }}}}
  264. // var eleDoc=(window.frames.length>0)?window.main.document:document;
  265. var eleDoc=document;
  266. if(typeof(eleDoc.fakeSequence)=='undefined'){eleDoc.fakeSequence=1;}
  267. var scrape,vScreen=(scrape=eleDoc.URL.match(/\&screen=(\w+)/i))?scrape[1]:null;
  268. var vWorld=(scrape=eleDoc.URL.match(/\/\/(\w+)\./i))?scrape[1]:null;
  269. var village=eleDoc.getElementsByTagName('title')[0].innerHTML.match(/\(\d+\|\d+\)/);
  270. if(vScreen=='place'){
  271. var index=0;var twCookie=eleDoc.cookie.match('[^|;]s?'+escapeStr(vWorld+'$'+config.Tsalkapone_target+'$'+config.Tsalkapone_cookieID+'=')+'([^;]*)[;|$]');
  272. if(twCookie){index=parseInt(twCookie[1],10);}
  273. if(!eleDoc.getElementById('fakescript2_Tsalkapone'))
  274. {var eleInputs=eleDoc.getElementsByTagName('input');
  275. if(eleInputs){for(var ii=0;ii<eleInputs.length;ii++)
  276. {if(eleInputs[ii].name=='support')
  277. {var optionList='';
  278. for(var jj=0;jj<coords.length;jj++){optionList+='<option>'+zeroPad(jj+1,4)+':'+coords[jj]+'</option>';}
  279. var fakeonoma = config.Tsalkapone_target;
  280. var tsalkapone_div='<TD rowspan="2"><div id="fakes"><table class="main"><tr><td id="tsalkapone_fake_script2"><span style="font-weight:bold">';
  281. tsalkapone_div+='<font color=darkgreen>'+tsalkapone_trans.notes.list+' ~ <font color=red>'+fakeonoma+'</font> :</font>';
  282. tsalkapone_div+='</span><select id="fakescript2_Tsalkapone" name="fakescript2_Tsalkapone" size="1" onchange="fnAssignTsalkapone_μονάδες(this.selectedIndex,true);">';
  283. tsalkapone_div+=''+optionList+'</select><span style="font-weight:100;font-style:italic;text-decoration:none;font-size:x-normal;">';
  284. tsalkapone_div+='<a href="https://forum.tribalwars.net/member.php?114063-Tsalkapone" target="_blank"> '+tsalkapone_trans.notes.creator+' Tsalkapone</a></span></td></tr></table></div></TD>';
  285.  
  286. eleInputs[ii].parentNode.parentNode.innerHTML+=tsalkapone_div;
  287. break;}
  288.  
  289. }}}}
  290. fnAssignTsalkapone_μονάδες(index,false);
  291.  
  292. /* ⛔⛔⛔⛔⛔ FIM DO SCRIPT DO TSALKAPONE ⛔⛔⛔⛔⛔ */
  293.  
  294. /* ⚪⚪⚪ CONFIGURAÇÕES DE SELEÇÃO DE UNIDADES ⚪⚪⚪ */
  295.  
  296. var allUnits = ['spear1','axe1','sword1','light1','spy1','heavy1','ram1','catapult1','snob1','archer1','marcher1'];
  297. if(spear1)document.getElementById('units_entry_all_spear').click();
  298. if(axe1)document.getElementById('units_entry_all_axe').click();
  299. if(sword1)document.getElementById('units_entry_all_sword').click();
  300. if(light1)document.getElementById('units_entry_all_light').click();
  301. if(spy1)document.getElementById('units_entry_all_spy').click();
  302. if(heavy1)document.getElementById('units_entry_all_heavy').click();
  303. if(ram1)document.getElementById('units_entry_all_ram').click();
  304. if(catapult1)document.getElementById('units_entry_all_catapult').click();
  305. if(snob1)document.getElementById('units_entry_all_snob').click();
  306. if(archer1)document.getElementById('units_entry_all_archer').click();
  307. if(marcher1)document.getElementById('units_entry_all_marcher').click();
  308. if(selectAllUnits)document.getElementById('selectAllUnits').click();
  309.  
  310. if (document.getElementById('units_entry_all_spear')) { var spear1 = parseInt( $('#units_entry_all_spear').text().replace(/[^0-9]/gi, ''));} else { spear1 = 0;}
  311. if (document.getElementById('units_entry_all_axe')) { var axe1 = parseInt( $('#units_entry_all_axe').text().replace(/[^0-9]/gi, ''));} else { axe1 = 0;}
  312. if (document.getElementById('units_entry_all_sword')) { var sword1 = parseInt( $('#units_entry_all_sword').text().replace(/[^0-9]/gi, ''));} else { sword1= 0;}
  313. if (document.getElementById('units_entry_all_light')) { var light1 = parseInt( $('#units_entry_all_light').text().replace(/[^0-9]/gi, ''));} else { light1 = 0;}
  314. if (document.getElementById('units_entry_all_spy')) { var spy1 = parseInt( $('#units_entry_all_spy').text().replace(/[^0-9]/gi, ''));} else { spy1 = 0;}
  315. if (document.getElementById('units_entry_all_heavy')) { var heavy1 = parseInt( $('#units_entry_all_heavy').text().replace(/[^0-9]/gi, ''));} else { heavy1 = 0;}
  316. if (document.getElementById('units_entry_all_ram')) { var ram1 = parseInt( $('#units_entry_all_ram').text().replace(/[^0-9]/gi, ''));} else { ram1 = 0;}
  317. if (document.getElementById('units_entry_all_catapult')) { var catapult1 = parseInt( $('#units_entry_all_catapult').text().replace(/[^0-9]/gi, ''));} else { catapult1 = 0;}
  318. if (document.getElementById('units_entry_all_snob')) { var snob1 = parseInt( $('#units_entry_all_snob').text().replace(/[^0-9]/gi, ''));} else { snob1 = 0;}
  319. if (document.getElementById('unit_input_archer')) {
  320. if (document.getElementById('units_entry_all_archer')) { var archer1 = parseInt( $('#units_entry_all_archer').text().replace(/[^0-9]/gi, '')); }else { archer1 = 0;}
  321. if (document.getElementById('units_entry_all_marcher')) { var marcher1 = parseInt( $('#units_entry_all_marcher').text().replace(/[^0-9]/gi, ''));} else { marcher1 = 0;}
  322. } /* ⚪⚪⚪ FIM DAS CONFIGURAÇÕES DE SELEÇÃO DE UNIDADES ⚪⚪⚪ */
  323.  
  324.  
  325. /* ⚫⚫⚫⚫⚫ CONFIGURAÇÕES EXTRAS ACERCA DO ENVIO DE COMANDO ⚫⚫⚫⚫⚫ */
  326.  
  327. setTimeout(function() {
  328. if(Ataque === true) {
  329. if(mobile === false) $("#target_attack").click(); else $("button[name = 'attack']").click();
  330. } else {
  331. if(mobile === false) $("#target_support").click(); else $("button[name = 'support']").click();
  332. }
  333. }, 1200,600); /*⚡ SELECIONAR TEMPO PARA CLICAR EM ATAQUE OU APOIO (1000 = 1 SEG) | TEMPO ALEATÓRIO ENTRE OS DOIS SELECIONADOS ⚡*/
  334. console.log("DEBUG: Done!");
  335.  
  336. setTimeout(function() {
  337. if(altAldeia === 1) {
  338. console.log("DEBUG: altAldeia: " + altAldeia);
  339. if(mobile === false)document.getElementByClassName('groupRight').click();
  340. }
  341. }, 600,300);
  342. console.log("DEBUG: Trocar Aldeia!");
  343.  
  344. }void (0);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement