Advertisement
Guest User

dsadsa

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