Advertisement
joadson

AutoFarm

Mar 31st, 2016
3,209
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name AutoFarm By Joadson
  3. // @include  https://br74.tribalwars.com.br*screen=am_farm*
  4. // ==/UserScript==
  5. var atualizarPagina = 1;
  6. var tempo = 350;
  7. var x = 0;
  8. var minhaVar = "";
  9. var remove_atacadas = 1;
  10. var menu = $('#am_widget_Farm a.farm_icon_c');
  11. var altAldTempo = 10;
  12. var jaEnviados = $(menu).parent().parent().find('img.tooltip').length+"000";
  13. if (remove_atacadas === 0) {
  14.     $('img').each(function() {
  15.         var tempStr = $(this).attr('src');
  16.         if (tempStr.indexOf('attack') != -1) {
  17.             $(this).addClass('tooltip');
  18.         }
  19.     });
  20. }
  21. if(atualizarPagina == 1) {
  22.     setInterval(
  23.         function() {
  24.             window.location.reload();
  25.         }, 220222);
  26. }
  27. console.log("Ja existe " + jaEnviados.substring(0,(jaEnviados.length - 3)) + " aldeia com ataque.");
  28. if (altAldTempo == "1") {
  29.     var altAldTempo = aleatorio(30553,6556);
  30. } else {
  31.     var altAldTempo = parseInt(altAldTempo) + parseInt(aleatorio(92353,45356));
  32. }
  33. console.log("Resta " + altAldTempo + " milesegundos para alternar a aldeia.");
  34. function aleatorio(superior,inferior) {
  35.     numPosibilidades = superior - inferior;
  36.     aleat = Math.random() * numPosibilidades;
  37.     return Math.round(parseInt(inferior) + aleat);
  38. }
  39. for (i = 0; i < 100; i++) {
  40.     $(menu).eq(i).each(function() {
  41.         if (!($(this).parent().parent().find('img.tooltip').length)) {
  42.             var tempoAgora = (tempo * ++x) - aleatorio(150,300);
  43.             setTimeout(function(minhaVar) {
  44.                 $(minhaVar).click();
  45.             }, tempoAgora, this);
  46.         }
  47.     });
  48. }
  49. function altAldeia()
  50. {
  51.     $('.arrowRight').click();
  52.     $('.groupRight').click();
  53. }
  54. setInterval(altAldeia, altAldTempo);
  55. console.log("Changed by the best br Speeed Player ever");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement