Advertisement
7zgi

سكربت الدعم التقطيري

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