Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- javascript:
- 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(" ");
- fejkLimit=110;
- //nazwa,wartosc_zagroda
- wojska=[
- ["catapult",1],
- ["spy",2],
- ["light",4],
- ["axe",1],
- ["spear",1],
- ["sword",1],
- ["archer",1],
- ["marcher",5],
- ["heavy",6],
- ["ram",1],
- ];
- function losowanieCoordow()
- {
- index = Math.round(Math.random() * (coords.length - 1));
- document.getElementsByClassName("target-input-field target-input-autocomplete ui-autocomplete-input")[0].value = coords[index];
- poczatekC=coords[index].substring(0,3)
- koniecC=coords[index].substring(4,7)
- odleglosc=Math.hypot((poczatekC-game_data.village.x), (koniecC-game_data.village.y))
- czas=new Date(odleglosc * 30 * 60 * 1000 + Date.now());
- godzina=czas.getHours();
- if(godzina<8)
- {losowanieCoordow();}
- }
- function ataki()
- {
- b=document.getElementById("unit_input_catapult");
- b.value=wojska[0][1];
- fejkLimit=fejkLimit-wojska[0][1]*5
- for(i=1;i<wojska.length;i++)
- {
- a=document.getElementById("unit_input_"+wojska[i][0]);
- if(a.attributes[6].value*wojska[i][1]>=fejkLimit)
- {
- a.value=parseInt(fejkLimit/wojska[i][1]);
- fejkLimit=0;
- } else if (a.attributes[6].value*wojska[i][1]>0){
- a.value=a.attributes[6].value;
- fejkLimit=fejkLimit-a.attributes[6].value*wojska[i][1];
- }
- }
- if(fejkLimit>0&&b.attributes[6].value>=parseInt(fejkLimit/5))
- {
- b.value=parseInt(fejkLimit/5);
- fejkLimit=0
- }
- if(fejkLimit>0)
- alert("Za mało jednostek");
- }
- //if(location!="https://pl126.plemiona.pl"+TribalWars.buildURL('GET', 'place'))
- //{
- //location=TribalWars.buildURL('GET', 'place');
- //}
- losowanieCoordow();
- ataki();
- function units(name, value) {
- if(document.getElementById("unit_input_"+name)!== null)
- {document.getElementById("unit_input_"+name).value=value;}}
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement