Advertisement
7zgi

send resources /tw

Feb 11th, 2020
403
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*______________________________________________________________________________
  2. ********************************************************************************
  3. WriterScriptIs : Abu.Rajih                                                     *
  4. VersionScript  : 1.1                                                           *
  5. DateWroteScript: 11-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. window.jQuery(($)=>{
  24.  
  25.  
  26.         if(window.game_data.screen != 'info_player')
  27.         {
  28.           window.UI.InfoMessage('السكربت يعمل من بروفايل اللاعبين ...' , 3000 , 'error');
  29.         }
  30.         else{
  31. window.Developer = ["سيد الاساطير" , 'Abu.Rajih' , 'https://forum.tribalwars.ae/index.php?members/abu-rajih.40926'];
  32.  window.UI.InfoMessage('تم تشغيل السكربت <br> مبرمج السكربت: AbuRajih' , 3000 , 'success');
  33. $('#villages_list').before(`<div id="village_notes_popup" class="popup_style ui-draggable ui-draggable-dragging" style="width: 38%;height:50%; position: fixed; top: 155px; left: 250px; display: none;cursor: move;">
  34. <div id="village_notes_popup_menu" class="popup_menu"><a id="closelink_village_notes_popup" class='hide' href="#">X</a></div>
  35. <div id="village_notes_popup_content" class="popup_content" style="height: 300px; overflow-y: auto;">
  36. <div style="width:100%; overflow:hidden;">
  37.  
  38. <table align="center" id='CopyRight'>
  39. <thead>
  40. <tr>
  41. <th style='width:50px;text-align:center;'>المبرمج</th>
  42.   <th style='font-size:16px; font-weight:bold;'>:</th>
  43.   <th style='width:90px;text-align:center;'><a href=`+window.Developer[2]+` title=`+window.Developer[1]+` target='_blank'>`+window.Developer[0]+`</a></th>
  44. </tr>
  45.  
  46. </thead>
  47. </table>
  48.  
  49.   <style>
  50.   #CopyRight,#CopyRight th{border:1px solid black !important;background:#eee;}
  51.   #CopyRight th , #CopyRight th a{background: #eddab0 !important;font-family: 'times new roman', sans-serif;font-size:15px;}
  52.   </style><br>
  53.  
  54. <table align='center' class="vis overview_table" height="10">
  55. <thead>
  56. <tr>
  57. <th style='text-align:center'><b>أختر</b></th>
  58. <th style='text-align:center'><b>جميع قراك <b id='villageNumber'></b></b></th>
  59. <th style='text-align:center'><b>الموارد</b></th>
  60. <th style='text-align:center'><b>التجار</b></th>
  61.  
  62. </tr>
  63. </thead>
  64. <tbody id="TBODY"></tbody>
  65. </table></div>
  66. </div></div>
  67.  
  68. <script>
  69. dragElement(document.getElementById("village_notes_popup"));
  70.  
  71. function dragElement(elmnt) {
  72.   var pos1 = 0, pos2 = 0, pos3 = 0, pos4 = 0;
  73.   if (document.getElementById(elmnt.id + "header")) {
  74.     document.getElementById(elmnt.id + "header").onmousedown = dragMouseDown;
  75.   } else {
  76.     elmnt.onmousedown = dragMouseDown;
  77.   }
  78.  
  79.   function dragMouseDown(e) {
  80.     e = e || window.event;
  81.     e.preventDefault();
  82.     pos3 = e.clientX;
  83.     pos4 = e.clientY;
  84.     document.onmouseup = closeDragElement;
  85.     document.onmousemove = elementDrag;
  86.   }
  87.  
  88.   function elementDrag(e) {
  89.     e = e || window.event;
  90.     e.preventDefault();
  91.     pos1 = pos3 - e.clientX;
  92.     pos2 = pos4 - e.clientY;
  93.     pos3 = e.clientX;
  94.     pos4 = e.clientY;
  95.     elmnt.style.top = (elmnt.offsetTop - pos2) + "px";
  96.     elmnt.style.left = (elmnt.offsetLeft - pos1) + "px";
  97.   }
  98.  
  99.   function closeDragElement() {
  100.     document.onmouseup = null;
  101.     document.onmousemove = null;
  102.   }
  103. }
  104. </script>
  105. `);
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113. $('#villages_list > thead > tr > th:nth-child(3)').after('<th><span class="icon header ressources" title="إرسال موارد الى القريه"></span></th>');
  114.  
  115.  $.get('/game.php?village='+window.game_data.village.id+'&screen=overview_villages&mode=prod' ,
  116.      function(data){
  117.  
  118.      $(data).find('#production_table > tbody > tr').not(':eq(0)').each(function(id){
  119.          $(this).find('.rename-icon').remove();
  120.  
  121.          var villages = $(this).find('td:eq(1)').html();
  122.          var resources = $(this).find('td:eq(3)').html();
  123.          var dealer = $(this).find('td:eq(5)').html();
  124.  
  125.          $('#TBODY').append('<tr><td style="text-align:center;"><input type="radio" id="tr_'+id+'" name="choose" /></td><td style="text-align:center;">'+villages+'</td><td style="text-align:center;">'+resources+'</td><td style="text-align:center;">'+dealer+'</td></tr>');
  126.          $('#villageNumber').text('('+Number(id + 1)+')');
  127.    
  128.       });
  129.  
  130.  
  131.  
  132.       $('#TBODY > tr').each(function(id){
  133.          var ThisTr = $(this);
  134.           $(this).find('input').click(function(){
  135.               window.UI.InfoMessage('مبرمج السكربت: AbuRajih <br>سيتم فتح صفحة نقطة التجمع لتستطيع الهجوم <br> إنتظر لبضعة ثواي ...' , 2500 , 'success');
  136.          var getMyVillageHref = $(ThisTr).find('a').attr('href');
  137.               var getMyVillageId = getMyVillageHref.match(/\d+/);
  138.               var ThisOne = $.trim(getMyVillageId);
  139.              localStorage.setItem('MyVillage' , ThisOne);
  140.               setTimeout(()=>{
  141.               window.open('/game.php?village='+ localStorage.getItem('MyVillage') +'&screen=market&mode=send&target=' + localStorage.getItem('Target') , '_blank');
  142.               },2000);
  143.        });
  144.     });
  145.  });
  146.  
  147.  
  148.  
  149.     $('.hide').on('click',function(){
  150.       $('#village_notes_popup').remove();
  151.         $('#villages_list').find('th:nth-child(4) , td:nth-child(4)').remove();
  152.     });
  153.  
  154.  $('#villages_list > tbody > tr').each(function(ID){
  155.      $(this).append('<td><input type="radio" id="tr_'+ID+'" name="target" /></td>');
  156.  
  157.      $(this).click(function(){
  158.          window.UI.InfoMessage('تم إختيار الهدف .. إنتظر لبضعة الثواني', 1500 , 'success');
  159.  
  160. var getHref = $('#villages_list > tbody > tr:eq('+ID+')').find('a:nth-child(1)').attr('href');
  161. var getID = getHref.substring(getHref.lastIndexOf('=')+1);
  162. var ThisID = $.trim(getID);
  163. localStorage.setItem('Target', ThisID);
  164.  
  165.          setInterval(()=>{
  166.              $('#village_notes_popup').css('display','block');
  167.          },1500);
  168.      });
  169. });
  170.  
  171. }
  172. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement