Advertisement
Guest User

Untitled

a guest
Oct 18th, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.09 KB | None | 0 0
  1. javascript:
  2. coords = "539|559 540|547 541|547 543|545 543|551 540|534 540|537 541|535 541|539 541|540 541|542 542|535 542|540 543|534 543|535 544|535 544|537 544|538 544|543 544|545 544|546 545|536 545|546 545|547 545|549 546|537 546|538 546|545 546|549 547|538 547|539 547|545 547|547 547|548 547|549 548|550 549|551 550|538 550|549 550|551 551|539 551|542 552|540 552|542 552|547 552|549 552|551 553|538 553|539 553|540 553|542 553|551 554|539 554|544 555|541 555|546 555|547 555|550 556|538 556|546 556|550 557|537 557|541 557|547 557|550 527|531 527|536 527|539 528|534 528|535 528|536 528|540 528|541 529|532 529|534 529|536 529|538 529|539 529|540 530|532 530|533 530|535 530|536 531|539 531|540 532|530 533|531 533|532 533|533 533|537 534|533 534|535 534|539 535|535 535|536 536|536 536|539 537|539 537|540 537|541 538|533 538|537 538|538 538|539 538|540 539|533 539|534 539|537 539|539 539|541 541|532 519|523 519|535 521|534 521|535 521|539 522|526 522|527 522|539 523|529 523|537 523|539 524|529 524|530 524|537 525|526 525|529 525|533 525|535 525|536 526|523 526|532 526|537 530|522 531|524 496|533 496|534 496|535 496|536 496|539 496|543 497|536 498|534 498|536 498|537 498|540 498|543 498|544 499|533 499|539 499|546 500|540 500|543 501|532 501|540 501|544 502|540 502|542 504|532 508|531 509|533 500|529 502|529 503|522 504|522 504|528 505|522 505|523 505|526 506|524 506|525 506|526 507|526 509|526 509|528 510|533 511|531 512|531".split(" ");
  3. fejkLimit=110;
  4. //nazwa,wartosc_zagroda
  5. wojska=[
  6. ["catapult",1],
  7. ["spy",2],
  8. ["light",4],
  9. ["axe",1],
  10. ["spear",1],
  11. ["sword",1],
  12. ["archer",1],
  13. ["marcher",5],
  14. ["heavy",6],
  15. ["ram",1],
  16. ];
  17.  
  18.  
  19. function losowanieCoordow()
  20. {
  21. index = Math.round(Math.random() * (coords.length - 1));
  22. document.getElementsByClassName("target-input-field target-input-autocomplete ui-autocomplete-input")[0].value = coords[index];
  23. poczatekC=coords[index].substring(0,3)
  24. koniecC=coords[index].substring(4,7)
  25. odleglosc=Math.hypot((poczatekC-game_data.village.x), (koniecC-game_data.village.y))
  26. czas=new Date(odleglosc * 30 * 60 * 1000 + Date.now());
  27. godzina=czas.getHours();
  28. if(godzina<8)
  29. {losowanieCoordow();}
  30. }
  31.  
  32. function ataki()
  33. {
  34. b=document.getElementById("unit_input_catapult");
  35. b.value=wojska[0][1];
  36. fejkLimit=fejkLimit-wojska[0][1]*5
  37.  
  38. for(i=1;i<wojska.length;i++)
  39. {
  40. a=document.getElementById("unit_input_"+wojska[i][0]);
  41. if(a.attributes[6].value*wojska[i][1]>=fejkLimit)
  42. {
  43. a.value=parseInt(fejkLimit/wojska[i][1]);
  44. fejkLimit=0;
  45. } else if (a.attributes[6].value*wojska[i][1]>0){
  46. a.value=a.attributes[6].value;
  47. fejkLimit=fejkLimit-a.attributes[6].value*wojska[i][1];
  48. }
  49. }
  50. if(fejkLimit>0&&b.attributes[6].value>=parseInt(fejkLimit/5))
  51. {
  52. b.value=parseInt(fejkLimit/5);
  53. fejkLimit=0
  54. }
  55. if(fejkLimit>0)
  56. alert("Za mało jednostek");
  57.  
  58. }
  59. //if(location!="https://pl126.plemiona.pl"+TribalWars.buildURL('GET', 'place'))
  60. //{
  61. //location=TribalWars.buildURL('GET', 'place');
  62. //}
  63.  
  64. losowanieCoordow();
  65. ataki();
  66.  
  67.  
  68. function units(name, value) {
  69. if(document.getElementById("unit_input_"+name)!== null)
  70. {document.getElementById("unit_input_"+name).value=value;}}
  71. end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement