Advertisement
7zgi

TEST

Apr 29th, 2020
779
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*______________________________________________________________________________
  2. ********************************************************************************
  3. WriterScriptIs  : Salim Fadhil                                                 *
  4. VersionScript   : 1.2                                                          *
  5. DateWroteScript : 20-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.  javascript:
  23. (function($){
  24.     if(window.premium == true){
  25.     if(window.game_data.screen == 'info_player' || window.game_data.screen == 'overview_villages' && window.location.href.match(/&mode=combined/) || window.game_data.screen == 'place'){
  26.         if(window.location.href.match(/&screen=overview_villages/) && window.location.href.match(/&mode=combined/)){
  27.             window.UI.InfoMessage('تم تشغيل السكربت',1000, 'success');
  28.             var ls = localStorage;
  29.             $('body').append('<link href="https://fonts.googleapis.com/css2?family=Comic+Neue&display=swap" rel="stylesheet">');
  30.             var sign = `
  31. <center>
  32. <table id = 'table'>
  33. <tr><th id = 'th' colspan = '5'><b style='font-family:times new roman;font-size:16px;text-align:center;'>تم برمجة السكربت من قبل</b></th></tr>
  34. <tr><td id = 'td' colspan = '5'><a id="Salim" title = 'Abu.Rajih'  href="https://forum.tribalwars.ae/index.php?members/abu-rajih.40926/" target="_blank">سيد الاساطير</a></td></tr>
  35. <tr><th id = 'th' colspan="4" > شرح للسكربت </th> <th id = 'th' ><a style='font-family:times new roman;font-size:16px;' href="https://forum.tribalwars.ae/index.php?threads/%D8%B3%D9%83%D8%B1%D8%A8%D8%AA-%D8%A7%D9%84%D8%AA%D9%84%D8%BA%D9%8A%D9%85-%D8%A7%D9%84%D8%AA%D9%82%D8%B7%D9%8A%D8%B1%D9%8A-%D9%84%D8%AF%D8%B9%D9%85-%D8%A7%D9%84%D8%B2%D9%85%D9%84%D8%A7%D8%A1.97087/" target="_blank">اضغط هنا</a></th></tr>
  36. <tr>
  37. <th id = 'th'>اسم القرية</th>
  38. <th id = 'th'>id</th>
  39. <th id = 'th'><img src="https://dsae.innogamescdn.com/asset/2ed32c7/graphic/unit/unit_spear.png" alt="" title="مقاتل الرمح"></th>
  40. <th id = 'th'><img src="https://dsae.innogamescdn.com/asset/2ed32c7/graphic/unit/unit_sword.png" alt="" title="مقاتل السيف"></th>
  41. <th id = 'th'><img src="https://dsae.innogamescdn.com/asset/2ed32c7/graphic/unit/unit_heavy.png" alt="" title="فارس ثقيل"></th>
  42. </tr>
  43. <tr>
  44. <th id = 'th'><textarea id = 'Name' rows = '8' cols = '20' style="text-align:center;background:#111;color:#9f9;font-weight:bold;font-family: 'Comic Neue', cursive;" disabled></textarea></th>
  45. <th id = 'th'><textarea id = 'GetId' rows = '8' cols = '6' style="text-align:center;background:#111;color:#f55;font-weight:bold;font-family: 'Comic Neue', cursive;" disabled></textarea></th>
  46. <th id = 'th'><textarea id = 'Spear' rows = '8' cols = '6' style="text-align:center;background:#111;color:#fcf;font-weight:bold;font-family: 'Comic Neue', cursive;" disabled></textarea></th>
  47. <th id = 'th'><textarea id = 'Sword' rows = '8' cols = '6' style="text-align:center;background:#111;color:#0cf;font-weight:bold;font-family: 'Comic Neue', cursive;" disabled></textarea></th>
  48. <th id = 'th'><textarea id = 'Heavy' rows = '8' cols = '8' style="text-align:center;background:#111;color:#fc5;font-weight:bold;font-family: 'Comic Neue', cursive;" disabled></textarea></th>
  49. </tr>
  50. <tr><th id = 'th' colspan= '4'>
  51. <input type="button" class="btn btn-confirm-yes btn-larger" style="width:100%;" value="حفظ احداثيات القرى المختاره للتلغيم" id="SaveData"/>
  52. </th>
  53. <th id = 'th'>
  54. <input type="button" class="btn btn-confirm-no btn-larger" style="width:100%;" value="مسح الاعدادت" id="RemoveData"/>
  55. </th></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.             $("#combined_table").before('<center>'+ sign +'</center>');
  74.             if(!ls.Name && !ls.ID && !ls.Spear && !ls.Sword && !ls.Heavy){
  75.                 window.UI.InfoMessage('قم بتحديد القرى التي تود تلغيم زميلك منها واضغط على زر حفظ لتخزين القرى في ذاكرة المتصفح.' , 5500 , 'success');
  76.  
  77.             }else{
  78.                 window.UI.InfoMessage('يتم عرض اخر بيانات قمت بتخزينها.' , 3000 , 'success');
  79.                 $('#Name').val(ls.Name); $('#GetId').val(ls.ID); $('#Spear').val(ls.Spear); $('#Sword').val(ls.Sword); $('#Heavy').val(ls.Heavy);
  80.                 $('#combined_table > tbody > tr').not(':eq(0)').each(function(item){
  81.                     item = $(this);
  82.                     for(var i = 0; i <= localStorage.ID.length; i++){
  83.                         if($(this).find('td:nth-child(2) > span').attr('data-id') == localStorage.getItem('ID').split('\n')[i])
  84.                         {
  85.                             $(item).find('td:nth-child(2) > span > span > a:nth-child(1) , td:nth-child(9) , td:nth-child(10) , td:nth-child(16)').css({'color':'#0c0','font-weight':'bold'});
  86.                         }
  87.                     }
  88.                 });
  89.             }
  90.  
  91.             $('#combined_table > tbody > tr > td:nth-child(2) > span > span > a:nth-child(1)').removeAttr('href');
  92.             $('#combined_table > tbody > tr:nth-child(1) > th:nth-child(2)').append('<input type="checkbox" id="selectAll" title="تحديد كل القرى" />');
  93.             $('#combined_table > tbody > tr').not(':eq(0)').find('td:nth-child(2)').append('<input type ="checkbox" class="checkBox" />');
  94.  
  95.             $('#selectAll').click(function(selectAll){
  96.                 if(this.checked){
  97.                     $('.checkBox').each(function(){
  98.                         this.checked = true;
  99.                     });
  100.                 }else{
  101.                     $('.checkBox').each(function(){
  102.                         this.checked = false;
  103.                     });
  104.                 }
  105.             });
  106.  
  107.             $('.checkBox').on('click',function(){
  108.                 if($('.checkBox:checked').length == $('.checkBox').length){
  109.                     $('#selectAll').prop('checked',true);
  110.                 }else{
  111.                     $('#selectAll').prop('checked',false);
  112.                 }
  113.             });
  114.  
  115.             $('#combined_table > tbody > tr').not(':eq(0)').each(function(I , e){
  116.                 e = $(this);
  117.                 for(var i = 0; i <= $('#GetId').val().split('\n').length - 1; i++){
  118.                     if($('#GetId').val().split('\n')[i] == $(this).find('td:nth-child(2) > span').attr('data-id')){
  119.                         e.find('td:nth-child(2) > input[type=checkbox]').prop('checked' , true)
  120.                     }
  121.                 }
  122.             });
  123.             /*-------------------------- here --------------------------------------------------------------------------*/
  124.             $('#combined_table > tbody > tr').not(':eq(0)').each(function(i,e){
  125.                 e = $(this);
  126.                 $(e).find('input:checkbox').click(function(){
  127.                     if($(e).find('input:checkbox')[0].checked == true){
  128.                         var villageName = $.trim($(e).find("td:nth-child(2) > span").text());
  129.                         var dataID = $(e).find("td:nth-child(2) > span").attr('data-id');
  130.                         var Spear , Sword , Heavy;
  131.                         if(window.game_data.units.length == 11){
  132.                             Spear = $.trim($(e).find("td:nth-child(9)").text());
  133.                             Sword = $.trim($(e).find("td:nth-child(10)").text());
  134.                             Heavy = $.trim($(e).find("td:nth-child(14)").text());
  135.                         }
  136.                         else{
  137.                             Spear = $.trim($(e).find("td:nth-child(9)").text());
  138.                             Sword = $.trim($(e).find("td:nth-child(10)").text());
  139.                             Heavy = $.trim($(e).find("td:nth-child(16)").text());
  140.                         }
  141.                         $('#Name').val($('#Name').val() + villageName + '\n');
  142.                         $('#GetId').val($('#GetId').val() + dataID + '\n');
  143.                         $('#Spear').val($('#Spear').val() + Spear + '\n');
  144.                         $('#Sword').val($('#Sword').val() + Sword + '\n');
  145.                         $('#Heavy').val($('#Heavy').val() + Heavy + '\n');
  146.                     }
  147.                     else{
  148.  
  149.                         $('#Name').val($('#Name').val().replace($.trim($(e).find("td:nth-child(2) > span").text())+'\n' , ''));
  150.                         $('#GetId').val($('#GetId').val().replace($(e).find("td:nth-child(2) > span").attr('data-id')+'\n' , ''));
  151.                         $('#Spear').val($('#Spear').val().replace($.trim($(e).find("td:nth-child(9)").text())+'\n' , ''));
  152.                         $('#Sword').val($('#Sword').val().replace($.trim($(e).find("td:nth-child(10)").text())+'\n' , ''));
  153.                         if(window.game_data.units.length == 11){
  154.                             $('#Heavy').val($('#Heavy').val().replace($.trim($(e).find("td:nth-child(14)").text())+'\n' , ''));
  155.                         }else{
  156.                             $('#Heavy').val($('#Heavy').val().replace($.trim($(e).find("td:nth-child(16)").text())+'\n' , ''));
  157.                         }
  158.                     }
  159.                 });
  160.  
  161.                 $('#selectAll').click(function(){
  162.                     if($(e).find('input:checkbox')[0].checked == true){
  163.                         var villageName = $.trim($(e).find("td:nth-child(2) > span").text());
  164.                         var dataID = $(e).find("td:nth-child(2) > span").attr('data-id');
  165.                         var Spear , Sword , Heavy;
  166.                         if(window.game_data.units.length == 11){
  167.                             Spear = $.trim($(e).find("td:nth-child(9)").text());
  168.                             Sword = $.trim($(e).find("td:nth-child(10)").text());
  169.                             Heavy = $.trim($(e).find("td:nth-child(14)").text());
  170.                         }
  171.                         else{
  172.                             Spear = $.trim($(e).find("td:nth-child(9)").text());
  173.                             Sword = $.trim($(e).find("td:nth-child(10)").text());
  174.                             Heavy = $.trim($(e).find("td:nth-child(16)").text());
  175.                         }
  176.                         $('#Name').val($('#Name').val() + villageName + '\n');
  177.                         $('#GetId').val($('#GetId').val() + dataID + '\n');
  178.                         $('#Spear').val($('#Spear').val() + Spear + '\n');
  179.                         $('#Sword').val($('#Sword').val() + Sword + '\n');
  180.                         $('#Heavy').val($('#Heavy').val() + Heavy + '\n');
  181.                     }
  182.                     else{
  183.  
  184.                         $('#Name').val($('#Name').val().replace($.trim($(e).find("td:nth-child(2) > span").text())+'\n' , ''));
  185.                         $('#GetId').val($('#GetId').val().replace($(e).find("td:nth-child(2) > span").attr('data-id')+'\n' , ''));
  186.                         $('#Spear').val($('#Spear').val().replace($.trim($(e).find("td:nth-child(9)").text())+'\n' , ''));
  187.                         $('#Sword').val($('#Sword').val().replace($.trim($(e).find("td:nth-child(10)").text())+'\n' , ''));
  188.                         if(window.game_data.units.length == 11){
  189.                             $('#Heavy').val($('#Heavy').val().replace($.trim($(e).find("td:nth-child(14)").text())+'\n' , ''));
  190.                         }else{
  191.                             $('#Heavy').val($('#Heavy').val().replace($.trim($(e).find("td:nth-child(16)").text())+'\n' , ''));
  192.                         }
  193.                     }
  194.                 });
  195.             });
  196.             /*-------------------------- here --------------------------------------------------------------------------*/
  197.  
  198.             $('#SaveData').on('click',function(){
  199.                 var countVillageSelected = $('#GetId').val().split('\n').length - 1;
  200.                 window.UI.InfoMessage('تم اختيار '+countVillageSelected+' قرى لأرسال التلغيم منها.', 3000 , 'success');
  201.                 ls.setItem('Name' , $('#Name').val());
  202.                 ls.setItem('ID' , $('#GetId').val());
  203.                 ls.setItem('Spear' , $('#Spear').val());
  204.                 ls.setItem('Sword' , $('#Sword').val());
  205.                 ls.setItem('Heavy' , $('#Heavy').val());
  206.                 ls.setItem('Index' , 0);
  207.             });
  208.  
  209.             $('#RemoveData').on('click' , function(){
  210.                 window.UI.InfoMessage('يتم حذف القرى.' , 1000 , 'success');
  211.                 setTimeout(()=>{
  212.                     ls.removeItem('Name');
  213.                     ls.removeItem('ID');
  214.                     ls.removeItem('Spear');
  215.                     ls.removeItem('Sword');
  216.                     ls.removeItem('Heavy');
  217.                     ls.removeItem('Index');
  218.                     window.UI.InfoMessage('تم اعادة ضبط القرى.' , 1500 , 'error');
  219.                     $('#Name').val(null); $('#GetId').val(null); $('#Spear').val(null); $('#Sword').val(null); $('#Heavy').val(null);
  220.                     $('#combined_table > tbody > tr').not(':eq(0)').each(function(){
  221.                         $(this).find('td:nth-child(2) > span > span > a:nth-child(1) , td:nth-child(9) , td:nth-child(10) , td:nth-child(16)').removeAttr('style');
  222.                         window.location.reload();
  223.                     });
  224.                 },1500);
  225.  
  226.             });
  227.  
  228.         }
  229.         else if(window.game_data.screen == 'info_player'){
  230.             $('#villages_list').before(`
  231. <link href="https://fonts.googleapis.com/css2?family=Comic+Neue&display=swap" rel="stylesheet">
  232. <center>
  233. <table id = 'table'>
  234. <tr><th id = 'th' colspan = '3'><b style='font-family:times new roman;font-size:16px;text-align:center;'>تم برمجة السكربت من قبل</b></th></tr>
  235. <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">سيد الاساطير</a></td></tr>
  236. <tr><th id = 'th' colspan="2" > شرح للسكربت </th> <th id = 'th' ><a style='font-family:times new roman;font-size:16px;' href="https://forum.tribalwars.ae/index.php?threads/%D8%B3%D9%83%D8%B1%D8%A8%D8%AA-%D8%A7%D9%84%D8%AA%D9%84%D8%BA%D9%8A%D9%85-%D8%A7%D9%84%D8%AA%D9%82%D8%B7%D9%8A%D8%B1%D9%8A-%D9%84%D8%AF%D8%B9%D9%85-%D8%A7%D9%84%D8%B2%D9%85%D9%84%D8%A7%D8%A1.97087/" target="_blank">اضغط هنا</a></th></tr>
  237. <tr>
  238. <th id = 'th' colspan = '3'>الاحداثيات <span id='CountCoords'></span></th>
  239. </tr>
  240. <tr>
  241. <th id = 'th' colspan = '3'><textarea id = 'CoordS' rows = '8' cols = '50' style="text-align:center;background:#111;color:#9f9;font-weight:bold;font-family: 'Comic Neue', cursive;" disabled></textarea></th>
  242. </tr>
  243. <tr>
  244. <th id = 'th' colspan= '2'><input type="button" class="btn" style="width:100%;" value="إستخراج كل الاحداثيات" id="getAllCoords"/></th>
  245. <th id = 'th'><input type="button" class="btn" style="width:100%;" value="إختياري" id="getSomeCoords"/></th>
  246. </tr>
  247. <tr>
  248. <th id = 'th'><img src="https://dsae.innogamescdn.com/asset/2ed32c7/graphic/unit/unit_spear.png" alt="" title="مقاتل الرمح"></th>
  249. <th id = 'th'><img src="https://dsae.innogamescdn.com/asset/2ed32c7/graphic/unit/unit_sword.png" alt="" title="مقاتل السيف"></th>
  250. <th id = 'th'><img src="https://dsae.innogamescdn.com/asset/2ed32c7/graphic/unit/unit_heavy.png" alt="" title="فارس ثقيل"></th>
  251. </tr>
  252. <tr>
  253. <th id = 'th'><input onclick="this.select();" id = 'SpeaR' style="text-align:center;background:#111;color:#fcf;font-weight:bold;font-family: 'Comic Neue', cursive;height:20px;border:none;font-size:16px;width:65px;box-shadow: 0 0 3px 2px black;" ></th>
  254. <th id = 'th'><input onclick="this.select();" id = 'SworD' style="text-align:center;background:#111;color:#0cf;font-weight:bold;font-family: 'Comic Neue', cursive;height:20px;border:none;font-size:16px;width:65px;box-shadow: 0 0 3px 2px black;" ></th>
  255. <th id = 'th'><input onclick="this.select();" id = 'HeavY' style="text-align:center;background:#111;color:#fc5;font-weight:bold;font-family: 'Comic Neue', cursive;height:20px;border:none;font-size:16px;width:65px;box-shadow: 0 0 3px 2px black;" ></th>
  256. </tr>
  257. <tr><th id = 'th' colspan= '2'>
  258. <input type="button" class="btn btn-confirm-yes btn-larger" style="width:100%;" value="حفظ الاعدادات" id="SaveDataPlayer"/>
  259. </th>
  260. <th id = 'th'>
  261. <input type="button" class="btn btn-confirm-no btn-larger" style="width:100%;" value="إعادة تعين" id="RemoveDataPlayer"/>
  262. </th></tr>
  263. </table>
  264. </center>
  265.  
  266. <style>
  267. #table,#th,#td { border:1px solid black; font-family:times new roman; font-size:16px; text-align:center; width:300px; }
  268. #Salim { font-family:times new roman; font-size: 20px; animation: salim 2s linear infinite; }
  269. @keyframes salim {
  270. 0%  {text-shadow:0 0 3px #000;}
  271. 15% {text-shadow:0 0 9px #000;}
  272. 30% {text-shadow:0 0 3px #000;}
  273. 45% {color:rgba(80,80,80,.1);}
  274. 60% {text-shadow:0 0 3px #7d5d11;color:#222;}
  275. 80% {text-shadow:0 0 9px #000;}
  276. 100%{text-shadow:0 0 3px #000;}
  277. }
  278. </style>`);
  279.  
  280.             /*---------------------------------------------------------------------------------------------------*/
  281.             $('#getAllCoords').on('click' , function(){
  282.                 $('#CoordS').val(null);
  283.                 $('#villages_list > tbody > tr').each(function(index , e){
  284.                     e = $(this);
  285.                     if($(e)[0].cells.length == 4){
  286.                         $(e)[0].cells[1].remove();
  287.                         $("#villages_list > thead > tr > th:nth-child(1)").attr('colspan' , 1);
  288.                         $('#CoordS').val($('#CoordS').val() + $.trim($(e).find('td:nth-child(2)').text()) + ' ');
  289.                         $('#CountCoords').text('('+ ($('#CoordS').val().split(' ').length - 1) +')');
  290.                     }else{
  291.                         $('#CoordS').val($('#CoordS').val() + $.trim($(e).find('td:nth-child(2)').text()) + ' ');
  292.                         $('#CountCoords').text('('+ ($('#CoordS').val().split(' ').length - 1) +')');
  293.                     }
  294.             /*---------------------------------------------------------------------------------------------------*/
  295.  
  296.                 });
  297.             });
  298.  
  299.             $('#getSomeCoords').on('click' , function(){
  300.                 $('#villages_list > thead > tr').append('<th style="text-align:center;">اختر</th>');
  301.                 $('#villages_list > tbody > tr').each(function(i , e){
  302.                     e = $(this);
  303.                     if($(e)[0].cells.length == 4){
  304.                         $(e)[0].cells[1].remove();
  305.                         $("#villages_list > thead > tr > th:nth-child(1)").attr('colspan' , 1);
  306.                         var NA = $.trim($(this).find('td:nth-child(1) > table > tbody > tr > td:nth-child(1) > span > a:nth-child(1)').text());
  307.                         var ID = $(this).find('td:nth-child(1) > table > tbody > tr > td:nth-child(1) > span').attr('data-id');
  308.                         var CO = $.trim($(this).find('td:nth-child(2)').text());
  309.                         $(this).append('<td style="text-align:center;"><input title="'+NA+'" type="checkbox" id="Noor_'+i+'" data-id="'+ID+'" XMC="'+CO+'" /></td>');
  310.                         if($(e).attr('style')){
  311.                             $(e).find('input[type=checkbox]').click();
  312.                         }
  313.                     }else{
  314.                         var Na = $.trim($(this).find('td:nth-child(1) > table > tbody > tr > td:nth-child(1) > span > a:nth-child(1)').text());
  315.                         var Id = $(this).find('td:nth-child(1) > table > tbody > tr > td:nth-child(1) > span').attr('data-id');
  316.                         var Co = $.trim($(this).find('td:nth-child(2)').text());
  317.                         $(this).append('<td style="text-align:center;"><input title="'+Na+'" type="checkbox" id="Noor_'+i+'" data-id="'+Id+'" XMC="'+Co+'" /></td>');
  318.                         if($(e).attr('style')){
  319.                             $(e).find('input[type=checkbox]').click();
  320.                         }
  321.                     }
  322.                 });
  323.             });
  324.  
  325.             if(!localStorage.SPEAR && !localStorage.SWORD && !localStorage.HEAVY){
  326.                 $('#SpeaR').val(0); $('#SworD').val(0); $('#HeavY').val(0);
  327.             }else{
  328.                 $('#SpeaR').val(localStorage.SPEAR);
  329.                 $('#SworD').val(localStorage.SWORD);
  330.                 $('#HeavY').val(localStorage.HEAVY);
  331.             }
  332.  
  333.             $('#SaveDataPlayer').on('click' , function(){
  334.                     if($('#villages_list > tbody > tr:nth-child(1)').find('td').length == 5){
  335.                 setTimeout(()=>{
  336.                     localStorage.setItem('CoordS' , $('#CoordS').val());
  337.                     localStorage.setItem('SPEAR' , $('#SpeaR').val());
  338.                     localStorage.setItem('SWORD' , $('#SworD').val());
  339.                     localStorage.setItem('HEAVY' , $('#HeavY').val());
  340.                 },1500);
  341.                 window.UI.InfoMessage('تم حفظ البيانات.' , 1000 , 'success');
  342.                 }
  343.                     else{
  344.                     $('#CoordS').val(null);
  345.                     $('#villages_list > tbody > tr').each(function(i , e){
  346.                         if($(this).find('td:nth-child(4) > input[type=checkbox]').is(':checked')){
  347.                             var coord = $(this).find('td:nth-child(4) > input[type=checkbox]').attr('XMC');
  348.                             $('#CoordS').val($('#CoordS').val() + coord + ' ');
  349.                             $(e).css({'color':'#0c0','font-weight':'bold'});
  350.                         }
  351.                     });
  352.  
  353.                     setTimeout(()=>{
  354.                         localStorage.setItem('CoordS' , $('#CoordS').val());
  355.                         localStorage.setItem('SPEAR' , $('#SpeaR').val());
  356.                         localStorage.setItem('SWORD' , $('#SworD').val());
  357.                         localStorage.setItem('HEAVY' , $('#HeavY').val());
  358.                     },1500);
  359.                     window.UI.InfoMessage('تم حفظ البيانات.' , 1000 , 'success');
  360.  
  361.                     $('#villages_list > tbody > tr').each(function(item){
  362.                         item = $(this);
  363.                         for(var i = 0; i <= localStorage.CoordS.length; i++){
  364.                             if($(item).find('input[type=checkbox]').is(':checked')){
  365.                                 if($.trim($(this).find('td:nth-child(2)').text()) != localStorage.getItem('CoordS').split(' ')[i])
  366.                                 {
  367.                                     $(item).css({'color':'#0c0','font-weight':'bold'});
  368.                                 }
  369.                             }else{
  370.                                 $(item).css({'color':'black','font-weight':'200'});
  371.                             }
  372.                         }
  373.                     });
  374.                 }
  375.                 $('body').append(`
  376. <link href='https://fonts.googleapis.com/css2?family=Comic+Neue&display=swap' rel='stylesheet'>
  377. <div id="group_popup" class="popup_style ui-draggable" style="width: 470px; position: fixed; top: 1px; left: 1px; display: block;">
  378. <div id="group_popup_menu" class="popup_menu ui-draggable-handle"><b style="font-size:16px;">سكربت التلغيم التقطيري</b><a id="closelink_group_popup" href="javascript:$('#group_popup').remove()">X</a></div>
  379. <div id="group_popup_content" class="popup_content" style="height: 380px; overflow-y: auto;">
  380. <div id="group_list_content" style="overflow: auto; height: 340px;">
  381. <div id="group_popup_content_container">
  382.  
  383. <center>
  384. <table id='Table'>
  385. <tbody>
  386. <tr id='tr'>
  387. <th colspan='4' id='th'><b> Developed by </b></th>
  388. </tr>
  389. <tr id='tr'>
  390. <td colspan='4' id='td'><a href="https://forum.tribalwars.ae/index.php?members/abu-rajih.40926/" id="SalimFadhil" target="_blank" title="سيد الاساطير">Abu.Rajih</a></td>
  391. </tr>
  392. <tr id='tr'>
  393. <th id='th'><b>القرى الخاصة بي</b></td>
  394. <th id='th'><img src='https://dsae.innogamescdn.com/asset/2ed32c7/graphic/unit/unit_spear.png' alt='' title='مقاتل الرمح'></th>
  395. <th id='th'><img src='https://dsae.innogamescdn.com/asset/2ed32c7/graphic/unit/unit_sword.png' alt='' title='مقاتل السيف'></th>
  396. <th id='th'><img src='https://dsae.innogamescdn.com/asset/2ed32c7/graphic/unit/unit_heavy.png' alt='' title='فارس ثقيل'></th>
  397. </tr>
  398. </tbody>
  399. </table>
  400. </center>
  401.  
  402. <style>
  403. b,i,span,h1,h2,h3,h4,h5,h6,p,a{ font-family: 'Comic Neue', cursive; }
  404. #Table,#tr,#td,#th{ text-align:center; border: 1px solid black; }
  405. #group_popup_menu{text-align:center;}
  406. #closelink_group_popup{text-align:center;color:#c00;font-weight:bold;border:1.2px solid black;background:white;width:18px;}
  407. #SalimFadhil{font-size:16px;animation: salim 1.5s linear infinite;}
  408. @keyframes salim {
  409. 0%  {text-shadow:0 0 3px #000;}
  410. 15% {text-shadow:0 0 9px #000;}
  411. 30% {text-shadow:0 0 3px #000;}
  412. 45% {color:rgba(80,80,80,.1);}
  413. 60% {text-shadow:0 0 3px #7d5d11;color:#222;}
  414. 80% {text-shadow:0 0 9px #000;}
  415. 100%{text-shadow:0 0 3px #000;}
  416. </style>
  417. </div></div>
  418. </div></div>
  419. `);
  420.  
  421. for(var i = 0; i < localStorage.Name.split('\n').length - 1; i++){
  422.     $('#Table').append('<tr id="tr"><th id="th"><a href="/game.php?village='+localStorage.ID.split('\n')[i]+'&screen=place" target="_blank">'+localStorage.Name.split('\n')[i]+'</a></th><td id="td">'+localStorage.Spear.split('\n')[i]+'</td><td id="td">'+localStorage.Sword.split('\n')[i]+'</td><td id="td">'+localStorage.Heavy.split('\n')[i]+'</td></tr>');
  423. }
  424.  
  425. $('#closelink_group_popup').on('click' , function(){
  426.     $('#group_popup').remove();
  427. });
  428.             });
  429.  
  430.             $('#RemoveDataPlayer').on('click' , function(){
  431.                 setTimeout(()=>{
  432.                     localStorage.removeItem('CoordS');
  433.                     localStorage.removeItem('SPEAR');
  434.                     localStorage.removeItem('SWORD');
  435.                     localStorage.removeItem('HEAVY');
  436.                     $('#CoordS').val(null); $('#SpeaR').val(0); $('#SworD').val(0); $('#HeavY').val(0);
  437.                 },500);
  438.                 setTimeout(()=>{
  439.                     window.UI.InfoMessage('تم إعادة ضبط البيانات وحذفها من ذاكرة المتصفحز' , 1500 , 'error');
  440.                 },510);
  441.                 setTimeout(()=>{
  442.                 window.location.reload();
  443.                 },800);
  444.             });
  445.  
  446.             if(!localStorage.CoordS){
  447.                 return false;
  448.             }else{
  449.                 window.UI.InfoMessage('يتم عرض البيانات المخزنة في المتصفح.' , 1500 , 'success');
  450.                 document.querySelector('#CoordS').value = localStorage.CoordS;
  451.                 $('#villages_list > tbody > tr').each(function(item){
  452.                     item = $(this);
  453.                     for(var i = 0; i <= localStorage.CoordS.length; i++){
  454.                         if($(this).find('td:nth-child(2)').text() == localStorage.getItem('CoordS').split(' ')[i])
  455.                         {
  456.                             $(item).css({'color':'#0c0','font-weight':'bold'});
  457.                         }
  458.                     }
  459.                 });
  460.             }
  461.         }
  462.         else if(window.game_data.screen == 'place'){
  463.             if(window.game_data.screen == 'place' && !window.location.href.match(/&screen=place&try=confirm/)){
  464.                 if(localStorage.Index >= localStorage.CoordS.split(' ').length - 2){
  465.                     localStorage.Index = -1;
  466.                     window.UI.InfoMessage('انتهي السكربت من جميع قرى صاحبك وسيبداً من اول احداثية.' , 2000 , 'error');
  467.                 }else{
  468.                     var i = localStorage.Index;
  469.                     localStorage.setItem('Index' , ++i);
  470.                     var COORD = localStorage.CoordS.split(' ')[localStorage.Index];
  471.                     var x = COORD.split('|')[0];
  472.                     var y = COORD.split('|')[1];
  473.                     document.forms[0].x.value = x;
  474.                     document.forms[0].y.value = y;
  475.                     document.querySelector('#unit_input_spear').value = localStorage.SPEAR;
  476.                     document.querySelector('#unit_input_sword').value = localStorage.SWORD;
  477.                     document.querySelector('#unit_input_heavy').value = localStorage.HEAVY;
  478.                     setTimeout(()=>{
  479.                         document.querySelector('#target_support').click();
  480.                     },300);
  481.                 }
  482.             }
  483.             else if(window.game_data.screen == 'place' && window.location.href.match(/&screen=place&try=confirm/)){
  484.                 document.querySelector("#default_name_span > a > img").click();
  485.                 setTimeout(()=>{
  486.                     document.querySelector("#new_attack_name").value = 'دعم بإستخدام سكربت التلغيم';
  487.                 },10);
  488.                 setTimeout(()=>{
  489.                     document.querySelector("#attack_name_btn").click();
  490.                 },15);
  491.                 setTimeout(()=>{
  492.                     document.querySelector("#troop_confirm_go").click();
  493.                 },20);
  494.             }
  495.         }
  496.     }
  497.     else{
  498.         window.UI.InfoMessage('السكربت يعمل من 3 اماكن<br>1. الشكل العام لتحديد القرى التي تود ان ترسل الدعم منها <br> 2. بروفايل اللاعب لتحديد القرى التي تريد ان ترسل الدعم لها<br> 3. نقطة التجمع لبدا بإرسال الدعم',3000, 'error');
  499.         setTimeout(()=>{
  500.             var Confirm = confirm('هل تريد الانتقال الى مكان عمل السكربت');
  501.             if(Confirm === true){
  502.                 window.location.href = '/game.php?village='+ window.game_data.village.id +'&screen=overview_villages&mode=combined';
  503.             }else{
  504.                 return false;
  505.             }
  506.         },3000);
  507.     }
  508.    }
  509.  else{
  510. window.UI.InfoMessage('السكربت يحتاج الى عضوية خاصة', 2500 , 'error');
  511. }
  512. })(window.jQuery);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement