Advertisement
Guest User

Untitled

a guest
Dec 6th, 2019
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.07 KB | None | 0 0
  1. // ==UserScript==
  2. // @name farm a
  3. // @description Só alegria.
  4. // @author ####.
  5. // @include https://br*screen=am_farm*
  6. // @version 1.0
  7. // ==/UserScript==
  8.  
  9. var atualizarPagina = 1;
  10. var tempo = 500;
  11. var x = 0;
  12. var minhaVar = "";
  13. var remove_atacadas = 1;
  14. var menu = $('#am_widget_Farm a.farm_icon_a');
  15. var remove_atacadas = 0;
  16. var remove_sem_recursos = 0;
  17.  
  18. if (remove_atacadas != 0 && remove_atacadas != 1 ) {
  19. alert("A variavel remove_atacadas precisa ser 0 ou 1");
  20. end();
  21. }
  22. if (remove_sem_recursos != 0 && remove_sem_recursos != 1 ) {
  23. alert("A variavel remove_sem_recursos precisa ser 0 ou 1");
  24. end();
  25. }
  26. (function() {
  27. $("a.farm_icon_a, a.farm_icon_b, a.farm_icon_c").click(function() {
  28. $(this).closest("tr").remove();
  29. });
  30. if (remove_atacadas == 1) {
  31. $('img').each(function() {
  32. var tempStr = $(this).attr('src');
  33. if (tempStr.indexOf('attack') != -1) {
  34. $(this).closest("tr").remove();
  35. }
  36. });
  37. }
  38.  
  39. if (remove_sem_recursos == 1) {
  40. $('img').each(function() {
  41. var tempStr = $(this).attr('src');
  42. if (tempStr.indexOf('max_loot/0') != -1) {
  43. $(this).closest("tr").remove();
  44. }
  45. });
  46.  
  47. }
  48.  
  49. })();
  50.  
  51. var jaEnviados = $(menu).parent().parent().find('img.tooltip').length+"000";
  52.  
  53. if (remove_atacadas == 1) {
  54. $('img').each(function() {
  55. var tempStr = $(this).attr('src');
  56. if (tempStr.indexOf('attack') != -1) {
  57. $(this).addClass('tooltip')
  58. }
  59. });
  60. }
  61. if(atualizarPagina == 1) {
  62. setInterval(
  63. function() {
  64. window.location.reload();
  65. }, 600000);
  66. }
  67.  
  68. console.log("Ja existe " + jaEnviados.substring(0,(jaEnviados.length - 3)) + " aldeia com ataque.");
  69.  
  70. var altAldTempo = parseInt($('#am_widget_Farm a.farm_icon_a').length+"000") - parseInt(jaEnviados);
  71. console.log("Resta " + altAldTempo + " aldeias para Atacar.");
  72.  
  73. if (altAldTempo == "0") {
  74. var altAldTempo = aleatorio(240000,420000);
  75. } else {
  76. // var altAldTempo = parseInt(altAldTempo) + parseInt(aleatorio(35000,45000));
  77. var altAldTempo = parseInt(aleatorio(130000,180000));
  78. }
  79. console.log("Resta " + altAldTempo + " milesegundos para alternar a aldeia.");
  80.  
  81. function aleatorio(inferior, superior) {
  82. numPosibilidades = superior - inferior
  83. aleat = Math.random() * numPosibilidades
  84. return Math.round(parseInt(inferior) + aleat)
  85. }
  86.  
  87.  
  88.  
  89. for (i = 0; i < 100; i++) {
  90. $(menu).eq(i).each(function() {
  91. if (!($(this).parent().parent().find('img.tooltip').length)) {
  92. var tempoAgora = (tempo * ++x) - aleatorio(500,700);
  93. setTimeout(function(minhaVar) {
  94. $(minhaVar).click();
  95. }, tempoAgora, this);
  96. }
  97. })
  98. }
  99.  
  100. function altAldeia()
  101. {
  102. $('.arrowRight').click();
  103. $('.groupRight').click();
  104. }
  105.  
  106. setInterval(altAldeia, altAldTempo);
  107.  
  108.  
  109.  
  110.  
  111. // ga('create', 'UA-48471099-1', 'datweb.com.br');
  112. //ga('send', 'pageview');
  113.  
  114.  
  115. console.log("####;) ");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement