Advertisement
SophieDebleeckere

Packet senderrr

Aug 18th, 2020
2,209
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. javascript: var popsend = 1000;
  2. var minPop = 1000;
  3. var alertWhenDone = 1;
  4. var nextVillageWhenDone = 1;
  5. var include = {
  6.     spear: 1,
  7.     sword: 1,
  8.     archer: 1,
  9.     scout: 0,
  10.     heavy: 0,
  11.     cat: 0
  12. };
  13. var targets = 'ENTER COORDINATES HERE';
  14. var doc = (window.frames.length > 0) ? window.main.document : document;
  15.  
  16. function getTroop(a) {
  17.     return parseInt(doc.units[a].parentNode.getElementsByTagName("a")[1].innerHTML.match(/\d+/), 10);
  18. }
  19. var SP = include.spear ? getTroop("spear") : 0;
  20. var AR = include.archer ? getTroop("archer") : 0;
  21. var HC = include.heavy ? getTroop("heavy") : 0;
  22. var CAT = include.cat ? getTroop("catapult") : 0;
  23. var SPY = include.scout ? getTroop("spy") : 0;
  24. var SW = include.sword ? getTroop("sword") : 0;
  25. var pop = SP + SW + AR + 2 * SPY + 8 * CAT + 6 * HC;
  26. if (pop > minPop) {
  27.     var ratio = popsend / pop;
  28.     ratio = ratio > 1 ? 1 : ratio;
  29.     doc.forms[0].spear.value = Math.floor(SP * ratio);
  30.     doc.forms[0].heavy.value = Math.floor(HC * ratio);
  31.     doc.forms[0].archer.value = Math.floor(AR * ratio);
  32.     doc.forms[0].sword.value = Math.floor(SW * ratio);
  33.     doc.forms[0].catapult.value = Math.floor(CAT * ratio);
  34.     doc.forms[0].spy.value = Math.floor(SPY * ratio);
  35.     targets = targets.split(" ");
  36.     var index = 0;
  37.     var farmcookie = document.cookie.match("(^|;) ?fluffy_fake=([^;]*)(;|$)");
  38.     if (farmcookie == null) {
  39.         index = Math.floor(Math.random() * (targets.length + 1));
  40.     } else {
  41.         index = parseInt(farmcookie[2]);
  42.     }
  43.     if (index >= targets.length) index = 0;
  44.     var coord = targets[index].split("|");
  45.     index++;
  46.     cookie_date = new Date(2099, 11, 11);
  47.     document.cookie = "fluffy_fake=" + index + "; expires=" + cookie_date.toGMTString();
  48.     doc.forms[0].x.value = coord[0];
  49.     doc.forms[0].y.value = coord[1];
  50.     void(0);
  51. } else {
  52.     if (alertWhenDone) alert('done');
  53.     if (nextVillageWhenDone) {
  54.         var sitter = doc.URL.match(/t=\d+/);
  55.         sitter = sitter ? "&" + sitter : "";
  56.         window.location = "game.php?village=n" + window.game_data.village.id + "&screen=place" + sitter
  57.     }
  58. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement