Advertisement
Guest User

Untitled

a guest
Oct 16th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.99 KB | None | 0 0
  1. javascript:
  2. coords = "653|551 654|548 654|550 654|551 655|534 655|549 656|547 656|548 656|550 657|537 657|547 657|548 658|535 658|545 659|547 659|548 659|550 659|551 660|549 661|534 661|535 661|536 661|537 661|546 661|550 661|551 662|538 662|541 662|546 663|535 663|541 663|543 663|550 663|551 664|538 664|540 664|542 664|545 664|546 664|547 664|549 664|550 665|535 665|537 665|541 665|542 665|543 665|545 665|547 665|551 666|541 666|542 666|543 667|534 667|535 667|540 667|541 667|544 667|546 667|549 668|535 668|537 668|547 668|549 669|534 669|543 669|549 669|550 669|551 670|538 670|540 670|544 670|547 644|544 644|545 644|552 645|545 645|546 645|547 646|545 646|546 646|554 647|546 647|549 647|551 647|552 647|553 647|554 648|552 649|544 649|550 649|551 649|552 649|554 650|546 650|548 650|549 650|552 651|547 651|548 651|552 651|553 651|554 652|541 652|549 652|550 652|552 653|553 655|553 656|552 656|553 658|552 658|553 659|553 635|536 635|542 635|543 635|547 635|550 635|551 635|552 636|539 636|547 636|549 637|537 637|542 637|544 637|546 637|547 637|549 637|552 637|553 638|536 638|545 638|552 638|553 639|536 639|538 639|539 639|540 639|543 639|546 639|549 639|552 639|553 640|537 640|540 640|543 640|545 640|546 640|548 640|550 640|551 640|552 641|537 641|542 641|545 642|539 642|543 642|550 642|553 643|538 643|539 643|540 643|543 643|551 643|553".split(" ");
  3. fejkLimit=110;
  4. //nazwa,wartosc_zagroda
  5. wojska=[
  6. ["ram",1],
  7. ["spear",1],
  8. ["sword",1],
  9. ["axe",1],
  10. ["archer",1],
  11. ["spy",2],
  12. ["light",4],
  13. ["marcher",5],
  14. ["heavy",6],
  15. ["catapult",8],
  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_ram");
  35. b.value=wojska[0][1];
  36. fejkLimit=fejkLimit-wojska[0][1]*5
  37.  
  38. for(i=1;i<wojska.length-1;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