Advertisement
Guest User

Untitled

a guest
Nov 12th, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.79 KB | None | 0 0
  1. // ==UserScript==
  2. // @name fAKES PT56
  3. // @include https*pt68.tribalwars.com.*place*
  4. // @grant none
  5. // ==/UserScript==
  6.  
  7. var tempo = 500;
  8. var x = 0;
  9.  
  10. javascript:
  11. var FakesPorAldeia = 1;
  12. var sp = 0;var sw = 0;var ax = 0;var scout = 0;var lc = 0;var hv = 0;var cat = 0;var ra = 1;var snob = 0;
  13. var coords ='537|578 538|577 543|582 524|583 520|583 521|571 532|602 526|577 534|570 560|583 517|581 520|572 520|569 531|585 522|564 525|576 505|587 535|568 529|580 526|581 519|580 521|566 518|571 522|568 539|575 535|576 533|574 558|556 525|581 520|581 526|578 527|578 526|571 536|602 535|569 537|570 542|579 537|569 542|578 537|573 541|571 540|572 557|555 538|576 509|588 534|575 536|577 522|569 535|571 517|571 525|582 532|577 559|556 536|574 560|584 523|582 537|574 541|579 539|578 534|576 521|573 527|579 523|616 524|613 533|573 538|571 536|569 527|581 538|572 540|578 523|565 525|578';
  14. var doc = document;
  15. var url = document.URL;
  16. var cookieName = "farmeruk";
  17. var cookieNameTent = "tentcookie";
  18. var maxTentativas = 15;
  19. var data;
  20. var h2 = document.getElementsByTagName('h2');
  21. var Praca = false;
  22. var EnviarAtaque = false;
  23. for (i = 0; i < h2.length; i++)
  24. {
  25. if (h2[i].innerHTML == "Praça de Reuniões (nível 1)")
  26. {
  27. Praca = true;
  28. }
  29. else if(h2[i].innerHTML.search("Confirmar ataque a") != -1)
  30. {
  31. EnviarAtaque=true;
  32. }
  33. }
  34. if (Praca == EnviarAtaque)
  35. {
  36. alert("Algo correu mal");
  37. }
  38. var tentCookie = document.cookie.match('(^|;) ?' + cookieNameTent + '=([^;]*)(;|$)');
  39. if (tentCookie !== null)
  40. {
  41. var numTentativas = parseInt(tentCookie[2]);
  42. } else
  43. {
  44. data = new Date(2019, 11, 11);
  45. document.cookie = cookieNameTent + "=0;expires=" + data.toGMTString();
  46. var numTentativas = 0;
  47. }
  48. if (Praca)
  49. {
  50. if (document.getElementsByClassName("error_box")[0] !== undefined)
  51. {
  52. var erroFaltaUnid = document.getElementsByClassName("error_box");
  53. for (i = 0; i < erroFaltaUnid.length && !found; i++)
  54. {
  55. if (erroFaltaUnid[i].innerHTML.search("Não existem unidades suficientes") != -1)
  56. {
  57. document.getElementById("village_switch_right").click();
  58. throw '';
  59. }
  60. }
  61. }
  62. if (doc.forms[0].x.value !== "")
  63. {
  64. var index = 0; farmcookie = document.cookie.match('(^|;) ?' + cookieName + '=([^;]*)(;|$)');
  65. if (farmcookie !== null)
  66. {
  67. index = parseInt(farmcookie[2]);
  68. }
  69. if (index >= coords.length)
  70. {
  71. index = 0;
  72. }
  73. index = index + 1;
  74. cookie_date = new Date(2019, 11, 11);
  75. document.cookie = cookieName + "=" + index + ";expires=" + cookie_date.toGMTString();
  76. var link = document.getElementsByClassName("quickbar_link");
  77. for (i = 0; i < link.length; i++)
  78. {
  79. if (link[i].href.search(/screen=place/) != -1)
  80. {
  81. window.location.href = link[i].href;
  82. }
  83. }
  84. }
  85. else
  86. {
  87. if (window.frames.length > 0)
  88. {
  89. doc = window.main.document;
  90. }
  91. url = document.URL;
  92. coords = coords.split(" ");
  93. var index = 0;
  94. farmcookie = document.cookie.match('(^|;) ?' + cookieName + '=([^;]*)(;|$)');
  95. if (farmcookie !== null)
  96. {
  97. index = parseInt(farmcookie[2]);
  98. }
  99. if (index >= coords.length)
  100. {
  101. index = 0;
  102. }
  103. if (document.getElementsByClassName("command-list-count") [0] !== undefined)
  104. {
  105. var numAtaques = document.getElementsByClassName("command-list-count") [0].innerHTML;
  106. }
  107. else
  108. {
  109. var numAtaques = 0;
  110. }
  111. if (numAtaques < FakesPorAldeia)
  112. {
  113. if (numTentativas <= maxTentativas)
  114. {
  115. coords = coords[index];
  116. coords = coords.split("|");
  117. index = index + 1;
  118. cookie_date = new Date(2019, 11, 11);
  119. document.cookie = cookieName + "=" + index + ";expires=" + cookie_date.toGMTString();
  120. doc.forms[0].x.value = coords[0];
  121. doc.forms[0].y.value = coords[1];
  122. doc.forms[0].spy.value = scout;
  123. doc.forms[0].spear.value = sp;
  124. doc.forms[0].sword.value = sw;
  125. doc.forms[0].axe.value = ax;
  126. doc.forms[0].spy.value = scout;
  127. doc.forms[0].light.value = lc;
  128. doc.forms[0].heavy.value = hv;
  129. doc.forms[0].ram.value = ra;
  130. doc.forms[0].catapult.value = cat;
  131. doc.forms[0].snob.value = snob;
  132. document.forms[0].attack.click();
  133. }
  134. else
  135. {
  136. data = new Date(2019, 11, 11);
  137. document.cookie = cookieNameTent + "=0;expires=" + data.toGMTString();
  138. document.getElementById("village_switch_right").click();
  139. }
  140. }
  141. else
  142. {
  143. document.getElementById("village_switch_right").click();
  144. }
  145. }
  146. }
  147. else if (EnviarAtaque)
  148. {
  149. var BNCheck = document.getElementsByClassName("error");
  150. var found = false;
  151. for (i = 0; i < BNCheck.length && !found; i++)
  152. {
  153. if (BNCheck[i].innerHTML == "Bónus noturno ativo!")
  154. {
  155. found = true;
  156. }
  157. }
  158. if (found)
  159. {
  160. var link = document.getElementById("village_switch_right").click();
  161. for (i = 0; i < link.length; i++)
  162. {
  163. if (link[i].href.search(/screen=place/) != -1)
  164. {
  165. numTentativas = numTentativas + 1;
  166. data = new Date(2019, 11, 11);
  167. document.cookie = cookieNameTent + "=" + numTentativas + ";expires=" + data.toGMTString();
  168. window.location.href = link[i].href;
  169. }
  170. }
  171. }
  172. else
  173. {
  174. document.forms[0].troop_confirm_go.click();
  175. }
  176. }
  177. else
  178. {
  179. alert("Corra o script apartir da praça de reuniões");
  180. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement