CowboySoberano

japinha

Jun 12th, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.78 KB | None | 0 0
  1. // ==UserScript==
  2. // @name JAPONES
  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 = 1000;
  11. var x = 0;
  12. var minhaVar = "";
  13. var remove_atacadas = 0;
  14. var menu = $('#am_widget_Farm a.farm_icon_a');
  15.  
  16. var jaEnviados = $(menu).parent().parent().find('img.tooltip').length+"000";
  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. }, 180000);
  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_a').length+"000") - parseInt(jaEnviados);
  36. console.log("Resta " + altAldTempo + " aldeias para Atacar.");
  37.  
  38. if (altAldTempo == "0") {
  39. var altAldTempo = aleatorio(4000,14000);
  40. } else {
  41. var altAldTempo = parseInt(altAldTempo) + parseInt(aleatorio(4000,14000));
  42. }
  43. console.log("Resta " + altAldTempo + " milesegundos para alternar a aldeia.");
  44.  
  45. function aleatorio(superior,inferior) {
  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. console.log("By Taliton R.C -> Skype: taliton.rc");
Add Comment
Please, Sign In to add comment