CowboySoberano

Auto Farm (A)

Jun 9th, 2017
588
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name           BY: Farm Cowboys Script
  3. // @description    Só alegria.
  4. // @author        Cowboy vs Alieens
  5. // @include       https://*screen=am_farm*
  6. // @version        1.0
  7. // ==/UserScript==
  8.  
  9.    var tempo = 310;
  10.    var x = 0;
  11.  
  12.    var menu = $('#am_widget_Farm a.farm_icon_a');
  13.  
  14.    var jaEnviados = $(menu).parent().parent().find('img.tooltip').length+"000";
  15.    console.log("Ja existe " + jaEnviados.substring(0,(jaEnviados.length - 3)) + " aldeia com ataque.");
  16.    
  17.    var altAldTempo = parseInt($('#am_widget_Farm a.farm_icon_c').length+"000") - parseInt(jaEnviados);
  18.    console.log("Resta " + altAldTempo + " aldeias para Atacar.");
  19.  
  20.    if (altAldTempo == "3000") {
  21.  var altAldTempo = aleatorio(70000,40000);
  22.    } else {
  23.  var altAldTempo = parseInt(altAldTempo) + parseInt(aleatorio(90000,90000));
  24.    }
  25.    console.log("Resta " + altAldTempo + " milesegundos para alternar a aldeia.");
  26.  
  27.    function aleatorio(inferior, superior) {
  28.     numPosibilidades = superior - inferior
  29.     aleat = Math.random() * numPosibilidades
  30.     return Math.round(parseInt(inferior) + aleat)
  31.    }
  32.  
  33.  
  34.    for (i = 0; i < 80; i++) {
  35.       $(menu).eq(i).each(function() {
  36.          if (!($(this).parent().parent().find('img.tooltip').length)) {
  37.   var tempoAgora = (tempo * ++x) - aleatorio(150,300);
  38.                 setTimeout(function(minhaVar) {
  39.                    $(minhaVar).click();
  40.               }, tempoAgora, this);
  41.          }
  42.        })
  43.    }
  44.  
  45.    function altAldeia()
  46.    {
  47.       $('.arrowRight').click();
  48.       $('.groupRight').click();
  49.    }
  50.    setInterval(altAldeia, altAldTempo);
  51.    
  52.    console.log("By Marcos -> Email: marcosvinicius.santosmarques@gmail.com");
Add Comment
Please, Sign In to add comment