Advertisement
Guest User

Farm c

a guest
Mar 19th, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.41 KB | None | 0 0
  1. // ==UserScript==
  2. // @name Farm C
  3. // @description Só alegria.
  4. // @author Skype: taliton.rc
  5. // @include https://*screen=am_farm*
  6. // @version 1.0
  7. // ==/UserScript==
  8.  
  9. var atualizarPagina = 1;
  10. var tempo = 300;
  11. var x = 0;
  12. var minhaVar = "";
  13. var remove_atacadas = 1;
  14. var menu = $('#am_widget_Farm a.farm_icon_c');
  15.  
  16. var jaEnviados = $(menu).parent().parent().find('img.tooltip').length+"5";
  17.  
  18. if (remove_atacadas == 1) {
  19. $('img').each(function() {
  20. var tempStr = $(this).attr('src');
  21. if (tempStr.indexOf('attack') != -1) {
  22. $(this).addClass('tooltip')
  23. }
  24. });
  25. }
  26. if(atualizarPagina == 1) {
  27. setInterval(
  28. function() {
  29. window.location.reload();
  30. }, 2000);
  31. }
  32.  
  33. console.log("Ja existe " + jaEnviados.substring(0,(jaEnviados.length - 3)) + " aldeia com ataque.");
  34.  
  35. var altAldTempo = parseInt($('#am_widget_Farm a.farm_icon_c').length+"05") - parseInt(jaEnviados);
  36. console.log("Resta " + altAldTempo + " aldeias para Atacar.");
  37.  
  38. if (altAldTempo == "0") {
  39. var altAldTempo = aleatorio(500,900);
  40. } else {
  41. var altAldTempo = parseInt(altAldTempo) + parseInt(aleatorio(500,900));
  42. }
  43. console.log("Resta " + altAldTempo + " milesegundos para alternar a aldeia.");
  44.  
  45. function aleatorio(inferior, superior) {
  46. numPosibilidades = superior - inferior
  47. aleat = Math.random() * numPosibilidades
  48. return Math.round(parseInt(inferior) + aleat)
  49. }
  50.  
  51.  
  52.  
  53. for (i = 0; i < 100; i++) {
  54. $(menu).eq(i).each(function() {
  55. if (!($(this).parent().parent().find('img.tooltip').length)) {
  56. var tempoAgora = (tempo * ++x) - aleatorio(150,300);
  57. setTimeout(function(minhaVar) {
  58. $(minhaVar).click();
  59. }, tempoAgora, this);
  60. }
  61. })
  62. }
  63.  
  64. function altAldeia()
  65. {
  66. $('.arrowRight').click();
  67. $('.groupRight').click();
  68. }
  69.  
  70. setInterval(altAldeia, altAldTempo);
  71.  
  72.  
  73.  
  74. (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  75. (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  76. m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  77. })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
  78.  
  79. ga('create', 'UA-48471099-1', 'datweb.com.br');
  80. ga('send', 'pageview');
  81.  
  82.  
  83. console.log("By Taliton R.C -> Skype: taliton.rc");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement