Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2019
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.86 KB | None | 0 0
  1. Farma
  2.  
  3.  
  4. // ==UserScript==
  5. // @name Farma1
  6. // @namespace Violentmonkey Scripts
  7. // @grant none
  8. // @version 1.9.12
  9. // @description by Ferss
  10. // ==/UserScript==
  11. javascript_:var arr=$("a.farm_icon_a"),i=0,t=setInterval(function(){$(arr[i++]).click();if(i>arr.length)clearInterval(t);},257);
  12.  
  13.  
  14. Przeskakiwanie wiosek
  15.  
  16.  
  17. // ==UserScript==
  18. // @name przeskakiwanie wiosek
  19. // @namespace Violentmonkey Scripts
  20. // @match https://*.plemiona.pl/game.php*screen=am_farm
  21. // @grant none
  22. // ==/UserScript==
  23. function nextVillage(){
  24. if ($(document).find("#village_switch_right").get()["0"]){
  25. jQuery.event.trigger({ type: 'keydown', which: 68 });
  26. }else{
  27. location.reload();
  28. }
  29. }
  30.  
  31. setTimeout(nextVillage, 210000);
  32.  
  33.  
  34.  
  35. Wysyłanie ataków
  36.  
  37. // ==UserScript==
  38. // @name Wysyłanie ataków
  39. // @version 0.1c
  40. // @author ktoś
  41. // @match *://*.plemiona.pl/*&screen=place*&try=confirm*
  42. // @grant none
  43. // @run-at document-start
  44. // @updateURL https://raw.githubusercontent.com/Couiz/TribalWars/master/CommandSender/CommandSender.js
  45. // @downloadURL https://raw.githubusercontent.com/Couiz/TribalWars/master/CommandSender/CommandSender.js
  46. // ==/UserScript==
  47.  
  48. CommandSender = {
  49. confirmButton: null,
  50. duration: null,
  51. dateNow: null,
  52. offset: null,
  53. init: function() {
  54. $($('#command-data-form').find('tbody')[0]).append('<tr><td>Przybycie:</td><td> <input type="datetime-local" id="CStime" step=".001"> </td></tr><tr> <td>Offset:</td><td> <input type="number" id="CSoffset"> <button type="button" id="CSbutton" class="btn">Potwierdź</button> </td></tr>');
  55. this.confirmButton = $('#troop_confirm_go');
  56. this.duration = $('#command-data-form').find('td:contains("Trwanie:")').next().text().split(':').map(Number);
  57. this.offset = localStorage.getItem('CS.offset') || -250;
  58. this.dateNow = this.convertToInput(new Date());
  59. $('#CSoffset').val(this.offset);
  60. $('#CStime').val(this.dateNow);
  61. $('#CSbutton').click(function() {
  62. var offset = Number($('#CSoffset').val());
  63. var attackTime = CommandSender.getAttackTime();
  64. localStorage.setItem('CS.offset', offset);
  65. CommandSender.confirmButton.addClass('btn-disabled');
  66. setTimeout(function() {
  67. CommandSender.confirmButton.click();
  68. },attackTime-Timing.getCurrentServerTime()+offset);
  69. this.disabled = true;
  70. });
  71. },
  72. getAttackTime: function() {
  73. var d = new Date($('#CStime').val().replace('T',' '));
  74. d.setHours(d.getHours()-this.duration[0]);
  75. d.setMinutes(d.getMinutes()-this.duration[1]);
  76. d.setSeconds(d.getSeconds()-this.duration[2]);
  77. return d;
  78. },
  79. convertToInput: function(t) {
  80. t.setHours(t.getHours()+this.duration[0]);
  81. t.setMinutes(t.getMinutes()+this.duration[1]);
  82. t.setSeconds(t.getSeconds()+this.duration[2]);
  83. var a = {
  84. y: t.getFullYear(),
  85. m: t.getMonth() + 1,
  86. d: t.getDate(),
  87. time: t.toTimeString().split(' ')[0],
  88. ms: t.getMilliseconds()
  89. };
  90. if (a.m < 10) {
  91. a.m = '0' + a.m;
  92. }
  93. if (a.d < 10) {
  94. a.d = '0' + a.d;
  95. }
  96. if (a.ms < 100) {
  97. a.ms = '0' + a.ms;
  98. if (a.ms < 10) {
  99. a.ms = '0' + a.ms;
  100. }
  101. }
  102. return a.y + '-' + a.m + '-' + a.d + 'T' + a.time + '.' + a.ms;
  103. },
  104. addGlobalStyle: function(css) {
  105. var head, style;
  106. head = document.getElementsByTagName('head')[0];
  107. if (!head) { return; }
  108. style = document.createElement('style');
  109. style.type = 'text/css';
  110. style.innerHTML = css;
  111. head.appendChild(style);
  112. }
  113. };
  114. CommandSender.addGlobalStyle('#CStime, #CSoffset {font-size: 9pt;font-family: Verdana,Arial;}#CSbutton {float:right;}');
  115. var a = setInterval(function(){
  116. if (document.getElementById('command-data-form') && jQuery) {
  117. CommandSender.init();
  118. clearInterval(a);
  119. }
  120. },1); // faster load
  121. document.addEventListener('DOMContentLoaded', function(){
  122. $('.server_info').prepend('<span style="float:left" >AvE KoBra</span>');
  123. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement