Advertisement
7zgi

looting filter /tw

Feb 14th, 2020
640
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*______________________________________________________________________________
  2. ********************************************************************************
  3. WriterScriptIs : Abu.Rajih                                                     *
  4. VersionScript  : 1.6                                                           *
  5. DateWroteScript: 14-02-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. (function($) {
  24.     if(window.game_data.screen == 'am_farm'){
  25.         if($('#attacked_checkbox').is(':checked')){
  26. var sign = `
  27. <center>
  28. <table id = 'table'>
  29. <tr>
  30. <th id = 'th' colspan = '3'><b style='font-family:times new roman;font-size:16px;text-align:center;'>تم برمجة السكربت من قبل</b></th>
  31. </tr>
  32.  
  33. <tr>
  34. <td id = 'td' colspan = '3'><a id="Salim" title = 'Abu.Rajih'  href="https://forum.tribalwars.ae/index.php?members/abu-rajih.40926/" target="_blank">سيد الاساطير</a></td>
  35. </tr>
  36.  
  37. <tr>
  38. <th id = 'th' colspan="2" > شرح السكربت </th> <th id = 'th' ><a style='font-family:times new roman;font-size:16px;' href="#" target="_blank">اضغط هنا</a></th>
  39. </tr>
  40. <tr>
  41. <th id="th" > <img src="https://dsae.innogamescdn.com/asset/aea668f/graphic/command/attack.png" title="عدد الهجمات على كل قريه"></th>
  42. <th id="th"> <span title="الموارد" class="icon  header ressources"></span></th>
  43. <th id="th"> <img title="مستوى الحائط" src="https://dsae.innogamescdn.com/asset/aea668f/graphic/buildings/wall.png" class=""></th>
  44.  
  45.  
  46. </tr>
  47.  
  48. <tr>
  49. <td id="td"><input type="text" title="عرض القرى التي عدد الهجمات فيها اقل من او تساوي" id="Attacks" style="width:95%;text-align:center;font-weight:bold;" placeholder="0" maxlength="2" onclick="javascript:this.select();" /></td>
  50. <td id="td" ><input type="text" title="عرض القرى التي مستوى الموارد فيها اقل من او تساوي" id="Resources" style="width:95%;text-align:center;font-weight:bold;" placeholder="0" maxlength="7" onclick="javascript:this.select();" /></td>
  51. <td id="td"><input type="text" title="عرض القرى التي مستوى الحائط فيها اقل من او تساوي" id="LvWall" style="width:95%;text-align:center;font-weight:bold;" placeholder="0" maxlength="2" onclick="javascript:this.select();" /></td>
  52. </tr>
  53. <tr>
  54. <th id="td" colspan="3"><input type="button" class="btn" style="width:100%;"id="StartFilter" value="بـدأ الفـلـتـره"/></th>
  55. </tr>
  56. </table>
  57. </center>
  58.  
  59. <style>
  60. #table,#th,#td { border:1px solid black; font-family:times new roman; font-size:16px; text-align:center; width:300px; }
  61. #Salim { font-family:times new roman; font-size: 20px; animation: salim 2s linear infinite; }
  62. @keyframes salim {
  63. 0%  {text-shadow:0 0 3px #000;}
  64. 15% {text-shadow:0 0 9px #000;}
  65. 30% {text-shadow:0 0 3px #000;}
  66. 45% {color:rgba(80,80,80,.1);}
  67. 60% {text-shadow:0 0 3px #7d5d11;color:#222;}
  68. 80% {text-shadow:0 0 9px #000;}
  69. 100%{text-shadow:0 0 3px #000;}
  70. }
  71. </style>`;
  72.  
  73. $('body').on('input' , '#LvWall' , function(){
  74.    if($('#LvWall').val() > 20)
  75.    {
  76.        $('#LvWall').css({'color':'red'});
  77.    }else{
  78.    $('#LvWall').css({'color':'black'});
  79.    }
  80.  
  81. });
  82.  
  83.     $('#plunder_list').before(sign);
  84.     $( '#plunder_list tr').not('tr:eq(1)').each(function(){
  85.         $(this).find('th:eq(2)').attr('style','text-align:center');
  86.         $(this).find('th:eq(2)').append('<img src="https://dsae.innogamescdn.com/asset/aea668f/graphic/command/attack.png" title="عدد الهجمات على كل قريه">');
  87.         var NoOfAttack = $(this).find('td:nth-child(4) > img').prop('tooltipText');
  88.         var p = $(this).find('td:eq(2)').append ('<b id="NoAtt">' + NoOfAttack + '</b>' );
  89.         var x = $(this).find('#NoAtt').text().match(/\d+/);
  90.         var z = $(this).find('td:eq(2)').text(Number(x));
  91.         z.css({
  92.             'text-align':'center',
  93.             'font-weight':'bold'
  94.         });
  95.         if($(this).find('td:eq(2)').text() == 'null' || $(this).find('td:eq(2)').text() == 'undefined'){
  96.             var problem = '';
  97.             $(this).find('td:eq(2)').text(problem);
  98.         }
  99.         else if($(this).find('td:eq(2)').text() >= 1){
  100.             $(this).find('td:eq(2)').css({
  101.                 'color':'#eee',
  102.                 'text-decoration':'underline #eee',
  103.                 'border':'1.2px solid #111',
  104.                 'background':'#a00'
  105.             });
  106.         }
  107.  
  108. });
  109.  
  110. $('#StartFilter').on(`click`,function(){
  111.     window.Attacks = $('#Attacks').val();
  112.     window.ResourcesForFilter = $('#Resources').val();
  113.     window.wallLevelToShow = $('#LvWall').val();
  114.      $('#plunder_list > tbody > tr').not(`:first`).each(function(){
  115.        window.ThisTr = $(this);
  116.        window.NumberAttack = $(this).find('td:nth-child(3)').text();
  117.        var wood = $(this).find(`td:nth-child(6) > span:nth-child(1) > span`).text();
  118.        var stone = $(this).find(`td:nth-child(6) > span:nth-child(2) > span`).text();
  119.        var iron = $(this).find(`td:nth-child(6) > span:nth-child(3) > span`).text();
  120.        var Wood = wood.replace(/\./, '');
  121.        var Stone = stone.replace(/\./, '');
  122.        var Iron = iron.replace(/\./, '');
  123.        window.FindWallLevel = $(this).find(`td:nth-child(7)`).text();
  124.  
  125.  
  126.        var total = Number(Wood) + Number(Stone) + Number(Iron);
  127.  
  128.          if(window.FindWallLevel.match(/\?/g))
  129.         {
  130.           $(window.ThisTr).find(`td:nth-child(6) , td:nth-child(7) , td:nth-child(11)`).css({
  131.             'color':`#a00`,
  132.             'font-weight':`bold`
  133.           });
  134.             $(window.ThisTr).hide();
  135.         }
  136.  
  137.   else if(Number(window.NumberAttack) <= window.Attacks && Number(total) <= window.ResourcesForFilter && window.FindWallLevel <= window.wallLevelToShow)
  138.      {
  139.          window.UI.InfoMessage(`تمت عملية الفلترة وإخفاء القرى التي عدد الهجمات فيها اعلى من `+window.Attacks+`<br>++<br>تمت عملية الفلترة وإخفاء القرى التي مستوى الموارد فيها اعلى من `+window.ResourcesForFilter.replace(/\d(?=(?:\d{3})+$)/g , '$&.')+`<br>++<br>تمت عملية الفلتره واخفاء القرى التي مستوى الحائط فيها اعلى من`+window.wallLevelToShow , 7000, `success`);
  140.        $(window.ThisTr).show();
  141.        $(window.ThisTr).find(`td:nth-child(7)`).css({
  142.        'color':`#0a0`,
  143.        'font-weight':`bold`
  144.        });
  145.      }
  146.  
  147.         else{
  148.             $(window.ThisTr).hide();
  149.         }
  150.  
  151.    });
  152.  });
  153. }
  154.         else{
  155.             window.UI.InfoMessage('لم تقم بتفعيل خاصية (اظهر التقارير من القرى التي اهاجمها حاليا)' , 3000 , 'error');
  156.            setTimeout(()=>{
  157.             window.UI.InfoMessage('سيتم تفعيلها الان .. ثم سيقوم السكربت بتحديث الصفحه' , 500 , 'success');
  158.                 setTimeout(()=>{
  159.                     $('#attacked_checkbox').click();
  160.                         setTimeout(()=>{
  161.                             window.open('/game.php?village='+window.game_data.village.id+'&screen=am_farm' , '_self');
  162.                         },700);
  163.                 },1000);
  164.            },2000);
  165.         }
  166.     }
  167.     else{
  168.           window.UI.InfoMessage('السكربت يعمل من مساعد النهب' , 3000 , 'error');
  169.           return false;
  170.     }
  171.  
  172. })(window.jQuery);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement