Advertisement
7zgi

request resources /tw

Feb 12th, 2020
1,297
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*______________________________________________________________________________
  2. ********************************************************************************
  3. WriterScriptIs  : Salim Fadhil                                                 *
  4. VersionScript   : 1.4                                                          *
  5. DateWroteScript : 12-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. javascript:
  24. (function($) {
  25.  
  26.     if(!window.location.href.match(/&screen=market&mode=call/)){
  27.         window.UI.InfoMessage('السكربت يعمل من السوق --> طلب' , 1500 , 'error');
  28.         setTimeout(()=>{
  29.         window.UI.InfoMessage('سيتم نقلك الى مكان عمل السكربت ...' , 3000 , 'success');
  30.        window.location.href = '/game.php?village='+window.game_data.village.id+'&screen=market&mode=call';
  31.         },1500);
  32.        }
  33.  
  34. window.Developer = ["SalimFadhil" , 'Abu.Rajih' ,'https://forum.tribalwars.ae/index.php?members/abu-rajih.40926'];
  35. $('#village_list').before(`
  36. <center>
  37. <table align="center" id='CopyRight'>
  38. <thead>
  39. <tr>
  40. <th style='width:50px;text-align:center;'>المبرمج</th>
  41.   <th style='font-size:16px; font-weight:bold;'>:</th>
  42.   <th style='width:90px;text-align:center;'><a href=`+window.Developer[3]+` title=`+window.Developer[0]+` target='_blank'>`+window.Developer[1]+`</a></th>
  43. </tr>
  44. </thead>
  45. </table>
  46.  
  47.  
  48. <table id="res_sum" class="vis overview_table" width="250px">
  49. <thead>
  50. <tr>
  51. <th colspan="3" style="text-align:center"><b>طلـب مـوارد</b></th>
  52. </tr>
  53. </thead>
  54.  
  55. <tbody>
  56. <tr>
  57. <td style="text-align:center" id="total_wood"><span class="res wood"></span><br/><input placeholder="0" type="text" style="text-align:center;font-weight:bold;font-style:times new roman;width:70%;" maxlength="6" id="WOD" /></td>
  58. <td style="text-align:center" id="total_stone"><span class="res stone"></span><br/><input placeholder="0" type="text" style="text-align:center;font-weight:bold;font-style:times new roman;width:70%;" maxlength="6" id="STN" /></td>
  59. <td style="text-align:center" id="total_iron"><span class="res iron"></span><br/><input placeholder="0" type="text" style="text-align:center;font-weight:bold;font-style:times new roman;width:70%;" maxlength="6" id="IRN" /></td>
  60. </tr>
  61.  
  62. <tr><th colspan="3" style="text-align:center;">سحب من القرى حسب مسافة السفر</th></tr>
  63. <tr>
  64. <td style="text-align:center" colspan="3">
  65. <input placeholder="0" type="text" style="text-align:center;font-weight:bold;font-style:times new roman;width:15%;" maxlength="2" title="ثواني" value="59" id="Seconds" disabled/> :
  66. <input placeholder="0" type="text" style="text-align:center;font-weight:bold;font-style:times new roman;width:15%;" maxlength="2" title="دقائق" value="59" id="Minutes" disabled/> :
  67. <input placeholder="0" type="text" style="text-align:center;font-weight:bold;font-style:times new roman;width:15%;" maxlength="2" title="ساعات" id="Hours" />
  68. </td>
  69. </tr>
  70.  
  71. <tr>
  72. <th colspan="3" style="text-align:center;"><input type="button" style="width:100%" title="ادخل الموارد ثم اضغط هذا الزر لسحب موارد" class="btn" id="GetResources" value="سحب موارد" /></th>
  73. </tr>
  74.  
  75. </tbody>
  76. </table>
  77.  
  78. </center>
  79.   <style>
  80.  #CopyRight,#CopyRight th{border:1px solid black !important;background:#eee;}
  81.   #CopyRight th , #CopyRight th a{background: #eddab0 !important;font-family: 'times new roman', sans-serif;font-size:15px;}
  82.  #CopyRight{background:white}
  83. </style>`);
  84.  
  85.     $('#GetResources').on('click' , function(WOD , STN , IRN){
  86.        WOD = $('#WOD').val(); STN = $('#STN').val(); IRN = $('#IRN').val();
  87.         $('#village_list > tbody > tr').each(function(){
  88.          window.time = $.trim($(this).find('td:nth-child(2)').text());
  89.  
  90.             if(parseInt(window.time.split(':')[0]) <= parseInt($('#Hours').val()))
  91.             {
  92.                 $(this).find('input[type=checkbox]').click();
  93.                 if(parseInt(WOD) <= parseInt($(this).find('td.wood > input').val())){
  94.                  $(this).find('td.wood > input').val($('#WOD').val());
  95.                 }
  96.                 else{$(this).find('td.wood > input').val($(this).find('td.wood > input').val());}
  97.  
  98.                 if(parseInt(STN) <= parseInt($(this).find('td.stone > input').val())){
  99.                  $(this).find('td.stone > input').val($('#STN').val());
  100.                 }
  101.                 else{$(this).find('td.stone > input').val($(this).find('td.stone > input').val());}
  102.  
  103.                 if(parseInt(IRN) <= parseInt($(this).find('td.iron > input').val())){
  104.                  $(this).find('td.iron > input').val($('#IRN').val());
  105.                 }
  106.                 else{$(this).find('td.iron > input').val($(this).find('td.iron > input').val());}
  107.  
  108.  
  109.             }
  110.             else{
  111.                 $(this).find('input[type=checkbox]').remove();
  112.                 $(this).attr('disabled')
  113.             }
  114.  
  115.         });
  116.         setTimeout(()=>{
  117.              $('input[type=submit]').eq(0).click();
  118.         },250);
  119.     });
  120.  
  121.  
  122. })(window.jQuery);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement