Advertisement
7zgi

سكربت نهب المزارع

Apr 21st, 2020
1,341
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*______________________________________________________________________________
  2. ********************************************************************************
  3. WriterScriptIs  : Salim Fadhil                                                 *
  4. VersionScript   : 1.0                                                          *
  5. DateWroteScript : 22-04-2020                                                   *
  6. URL            : https://forum.tribalwars.ae/index.php?members/abu-rajih.40926/*
  7. _______________________________________________________________________________*
  8. ********************************************************************************
  9.        ########   ##                    #########             $$  $$  ##       *
  10.       ##      ##  ##                    ##      ##   ######   $$  $$  ##       *
  11.       ##      ##  ##                    ##      ##         #          ##       *
  12.       ##########  ## ####  ##    ##     ##     ##   ########  ##  ##  #######  *
  13.       ##      ##  ###   ## ##    ##     ########    ##    ##  ##  ##  ##    ## *
  14.       ##      ##  ##    ## ##    ##     ##     ##   ##    ##  ##  ##  ##    ## *
  15.       ##      ##  ##   ##  ##    ## $$  ##      ##  ##    ##  ##  ##  ##    ## *
  16.       ##      ##  ######    #####   $$  ##       ## ###### #  ##  ##  ##    ## *
  17.                                                               ##               *
  18.                                                          ##  ##                *
  19.                                                           ####                 *
  20. _______________________________________________________________________________*
  21. *******************************************************************************/
  22.  
  23. javascript:
  24.  if (format === undefined) { var format = " {coord}"; }
  25. var win = (window.frames.length > 0) ? window.main : window;
  26. var index = 0;
  27. var outputID = 'villageList';
  28. let $ = window.jQuery;
  29. $(document).ready(function () {
  30.     if ($('#' + outputID).length <= 0) {
  31.         if (window.game_data.screen == 'map') {
  32.             var srcHTML = `<center> <link href="https://fonts.googleapis.com/css2?family=Comic+Neue&display=swap" rel="stylesheet"> <table id = 'table'> <tr> <th id = 'th' colspan= '3'><b style='font-family: "Comic Neue", cursive;font-size:16px;text-align:center;'>Developed by</b></th> </tr> <tr> <td id = 'td'  colspan= '3'><a id="Salim" title = 'Abu.Rajih'  href="https://forum.tribalwars.ae/index.php?members/abu-rajih.40926/" target="_blank">Abu.Rajih</a></td> </tr> <tr> <th id = 'th'  colspan= '3'> <textarea id='` + outputID + `' cols='50' rows='8' style='text-align:center;background:#111;color:#9f9;font-weight:bold;font-family: "Comic Neue", cursive; font-size:11px;' disabled></textarea> </th> </tr> <tr> <th id='th'><img src="https://dsae.innogamescdn.com/asset/2ed32c7/graphic/unit/unit_axe.png" title="مقاتل الفأس" alt="" class=""></th> <th id='th'><img src="https://dsae.innogamescdn.com/asset/2ed32c7/graphic/unit/unit_spy.png" title="كشافة" alt="" class=""></th> <th id='th'><img src="https://dsae.innogamescdn.com/asset/2ed32c7/graphic/unit/unit_light.png" title="فارس خفيف" alt="" class=""></th> </tr> <tr> <td id='td'><input type='text' value='0' onclick='this.select()' style='text-align:center;background:#111;color:#9f9;border:none;font-weight:bold;font-family: "Comic Neue", cursive; font-size:11px;width:80px;height:20px;font-size:14px;' id='Axe'/></th> <td id='td'><input type='text' value='0' onclick='this.select()' style='text-align:center;background:#111;color:#99f;border:none;font-weight:bold;font-family: "Comic Neue", cursive; font-size:11px;width:80px;height:20px;font-size:14px;' id='Spy'/></th> <td id='td'><input type='text' value='0' onclick='this.select()' style='text-align:center;background:#111;color:#f99;border:none;font-weight:bold;font-family: "Comic Neue", cursive; font-size:11px;width:80px;height:20px;font-size:14px;' id='Light'/></th> </tr> <tr> <th id = 'th'  colspan= '2'> <input type = 'button' value = ' حفظ المزارع المحدده' id = 'saveFarm' style = 'width:100%;' class = 'btn btn-confirm-yes' /> </th> <th id = 'th'> <input type = 'button' value = 'نقطة التجمع' id = 'GoToPlace' style = 'width:100%;' class = 'btn btn-confirm-no' /> </th> </tr> <tr><td id='td' colspan='3'><input type='button'  id='reset' value='اعادة ضبط السكربت' class='btn btn-confirm-no' style='width:99%;' /></td></tr>  </table> </center> <style> #table,#th,#td { border:1px solid black; font-family:times new roman; font-size:16px; text-align:center; width:300px; } #Salim { font-family: "Comic Neue", cursive; font-size: 20px; animation: salim 2s linear infinite; } @keyframes salim { 0%  {text-shadow:0 0 3px #000;} 15% {text-shadow:0 0 9px #000;} 30% {text-shadow:0 0 3px #000;} 45% {color:rgba(80,80,80,.1);} 60% {text-shadow:0 0 3px #7d5d11;color:#222;} 80% {text-shadow:0 0 9px #000;} 100%{text-shadow:0 0 3px #000;} } </style>`;
  33.             var ele = win.$('#map_whole').after(win.$(srcHTML));
  34.             win.TWMap.map._handleClick = function (e) {
  35.                 index++;
  36.                 var pos = this.coordByEvent(e);
  37.                 var x = pos[0];
  38.                 var y = pos[1];
  39.                 var coord = pos.join("|");
  40.                 var ID = x * 1000 + y;
  41.                 var village = window.TWMap.villages[ID];
  42.                 var ownername, ownerpoints, tribetag, tribename, tribepoints, ownerally;
  43.                 if (village.owner === 0) {
  44.                     ownername = "";
  45.                     ownerpoints = 0;
  46.                 }
  47.                 else {
  48.                     var owner = window.TWMap.players[village.owner];
  49.  
  50.                     if (window.TWMap.allies[window.TWMap.players[village.owner]] > 0) {
  51.                         tribetag = window.TWMap.allies[window.TWMap.players[village.owner].ally].tag;
  52.                         tribename = window.TWMap.allies[window.TWMap.players[village.owner].ally].name;
  53.                         tribepoints = window.TWMap.allies[window.TWMap.players[village.owner].ally].points;
  54.                         ownerally = owner.ally;
  55.                         var tribe = window.TWMap.allies[window.TWMap.players[village.owner].ally];
  56.                     }
  57.                     else {
  58.                         tribe = "";
  59.                         tribetag = "";
  60.                         tribename = "";
  61.                         tribepoints = "";
  62.                         ownerally = 0;
  63.                     }
  64.                 }
  65.                 var image = "";
  66.                 if (village.bonus) {
  67.                     image = village.bonus[1];
  68.                 }
  69.  
  70.                 var data = format.replace("{coord\}", coord)
  71.                 .replace("{player\}", ownername)
  72.                 .replace("{playerpoints\}", ownerpoints)
  73.                 .replace("{playerid\}", village.owner)
  74.                 .replace("{villageid\}", village.id)
  75.                 .replace("{points\}", village.points.replace(".", ""))
  76.                 .replace("{tag\}", tribetag)
  77.                 .replace("{tribename\}", tribename)
  78.                 .replace("{tribepoints\}", tribepoints)
  79.                 .replace("{tribeid\}", ownerally)
  80.                 .replace("{x\}", x)
  81.                 .replace("{y\}", y)
  82.                 .replace("{kk\}", window.TWMap.con.continentByXY(x, y))
  83.                 .replace("{image\}", 'http://' + document.URL.split('/')[2] + '/graphic/' + image)
  84.                 .replace("{index\}", index)
  85.                 .replace("{NL\}", "\n");
  86.  
  87.                 document.getElementById(outputID).innerHTML += data;
  88.                 /* $('#' + outputID).value += data + "\n";*/
  89.                 return false;
  90.             };
  91.  
  92.             $('#saveFarm').on('click' , function(){
  93.                 var coords = $('#villageList').val() , axe = $('#Axe').val() , spy = $('#Spy').val() , light = $('#Light').val();
  94.                 var ls = localStorage;
  95.                 ls.setItem('index' , 0);
  96.                 ls.setItem('farmCoord' , coords);
  97.                 ls.setItem('AxE' , axe);
  98.                 ls.setItem('SpY' , spy);
  99.                 ls.setItem('LighT' , light);
  100.                 window.UI.InfoMessage('تم حفظ الاعدادات.' , 1000 , 'success');
  101.             });
  102.  
  103.             $('#GoToPlace').on('click' , function(){
  104.                 window.UI.InfoMessage('سيتم نقلك الى نقطة التجمع.' , 1000 , 'success');
  105.                 setTimeout(()=>{
  106.                     window.location.href = '/game.php?village='+ window.game_data.village.id +'&screen=place';
  107.                 },1000);
  108.             });
  109.             if(!localStorage.AxE && !localStorage.SpY && !localStorage.LighT){
  110.                 $('#Axe').val(0); $('#Spy').val(0); $('#LighT').val(0);
  111.             }else{
  112.                 $('#Axe').val(localStorage.AxE); $('#Spy').val(localStorage.SpY); $('#LighT').val(localStorage.LighT);
  113.             }
  114.  
  115.             $('#reset').on('click' , function(){
  116.                 localStorage.removeItem('farmCoord');
  117.                 localStorage.removeItem('AxE');
  118.                 localStorage.removeItem('SpY');
  119.                 localStorage.removeItem('LighT');
  120.                 $('#villageList').val(null); $('#Axe').val(0); $('#Spy').val(0); $('#LighT').val(0);
  121.                 window.UI.InfoMessage('تم اعادة الضبط بنجاح.' , 1000 , 'success');
  122.                 setTimeout(()=>{
  123.                     window.location.reload();
  124.                 },1000);
  125.             });
  126.         }
  127.         else if(window.game_data.screen == 'place'){
  128.             if(window.game_data.screen == 'place' && !window.location.href.match(/&screen=place&try=confirm/)){
  129.                 if(localStorage.index >= localStorage.farmCoord.split(' ').length - 1){
  130.                     localStorage.index = 0;
  131.                     window.UI.InfoMessage('انتهى السكربت من الهجوم على جميع القرى وسيبدا بالاحداثيات من جديد.' , 1500 , 'error');
  132.                     setTimeout(()=>{window.location.reload();},1500);
  133.                 }else{
  134.                     var i = localStorage.index;
  135.                     localStorage.setItem('index' , ++i);
  136.                     var COORD = localStorage.farmCoord.split(' ')[localStorage.index];
  137.                     var x = COORD.split('|')[0];
  138.                     var y = COORD.split('|')[1];
  139.                     document.forms[0].x.value = x;
  140.                     document.forms[0].y.value = y;
  141.                     document.querySelector('#unit_input_axe').value = localStorage.AxE;
  142.                     document.querySelector('#unit_input_spy').value = localStorage.SpY;
  143.                     document.querySelector('#unit_input_light').value = localStorage.LighT;
  144.                     setTimeout(()=>{document.querySelector('#target_attack').click();},300);
  145.                 }
  146.             }
  147.             else if(window.game_data.screen == 'place' && window.location.href.match(/&screen=place&try=confirm/)){
  148.                 document.querySelector("#default_name_span > a > img").click();
  149.                 setTimeout(()=>{document.querySelector("#new_attack_name").value = ' هجمة رقم '+localStorage.index+' بواسطة سكربت نهب المزارع';},10);
  150.                 setTimeout(()=>{document.querySelector("#attack_name_btn").click();},15);
  151.                 setTimeout(()=>{document.querySelector("#troop_confirm_go").click();},20);
  152.             }
  153.         }
  154.         else {
  155.             window.UI.InfoMessage('السكربت يعمل من الخريطة سيتم نقلك الى الخريطة..' , 1500 , 'error');
  156.             setTimeout(()=>{window.location.href = '/game.php?village='+ window.game_data.village.id +'&screen=map';},1500);
  157.         }
  158.     }
  159. });
  160. void (0);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement