Advertisement
Guest User

Untitled

a guest
Apr 20th, 2018
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.93 KB | None | 0 0
  1. // ==UserScript==
  2. // @name AUTO FARM A TROCA
  3. // @description https://www.youtube.com/channel/UCeYF2UWfIvI9isXCRknliiA
  4. // @author DanielBR
  5. // @Email danielchaves17p@gmail.com
  6. // @include https://*screen=am_farm*
  7. // @version 1.0
  8. // @namespace https://greasyfork.org/users/159045
  9. // ==/UserScript==
  10.  
  11. var atualizarPagina = 1;
  12. var tempo = 2000;
  13. var x = 0;
  14. var minhaVar = "1";
  15. var remove_atacadas = 0;
  16. var menu = $('#am_widget_Farm a.farm_icon_a');
  17.  
  18. var jaEnviados = $(menu).parent().parent().find('img.tooltip').length+"000";
  19.  
  20. if (remove_atacadas == 1) {
  21. $('img').each(function() {
  22. var tempStr = $(this).attr('src');
  23. if (tempStr.indexOf('attack') != -1) {
  24. $(this).addClass('tooltip');
  25. }
  26. });
  27. }
  28. if(atualizarPagina == 1) {
  29. setInterval(
  30. function() {
  31. window.location.reload();
  32. }, 700000);
  33. }
  34.  
  35. console.log("Ja existe " + jaEnviados.substring(0,(jaEnviados.length - 3)) + " aldeia com ataque.");
  36.  
  37. var altAldTempo = parseInt($('#am_widget_Farm a.farm_icon_d').length+"000") - parseInt(jaEnviados);
  38. console.log("Resta " + altAldTempo + " aldeias para Atacar.");
  39.  
  40. if (altAldTempo == "0") {
  41. var altAldTempo = aleatorio(200000,300000);
  42. } else {
  43. var altAldTempo = parseInt(altAldTempo) + parseInt(aleatorio(14000,34000));
  44. }
  45. console.log("Resta " + altAldTempo + " milesegundos para alternar a aldeia.");
  46.  
  47. function aleatorio(superior,inferior) {
  48. numPosibilidades = superior - inferior;
  49. aleat = Math.random() * numPosibilidades;
  50. return Math.round(parseInt(inferior) + aleat);
  51. }
  52.  
  53.  
  54.  
  55. for (i = 0; i < 100; i++) {
  56. $(menu).eq(i).each(function() {
  57. if (!($(this).parent().parent().find('img.tooltip').length)) {
  58. var tempoAgora = (tempo * ++x) - aleatorio(150,300);
  59. setTimeout(function(minhaVar) {
  60. $(minhaVar).click();
  61. }, tempoAgora, this);
  62. }
  63. });
  64. }
  65.  
  66.  
  67.  
  68. function altAldeia()
  69. {
  70. $('.arrowRight').click();
  71. $('.groupRight').click();
  72. }
  73.  
  74. setInterval(altAldeia, altAldTempo);
  75.  
  76. console.log("By GLivio -> Skype: Giovanni|Visca El Barça");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement