Guest User

Untitled

a guest
Apr 27th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. javascript: coords = '421|185';
  2.  
  3. var doc = document;
  4.  
  5. if (window.frames.length > 0) doc = window.main.document;
  6.  
  7. url = document.URL;
  8.  
  9. if (url.indexOf('screen=place') == - 1) alert('This script needs to be run from the rally point');
  10.  
  11. function getTroop(a)
  12.  
  13.    {return parseInt(doc.units[a].parentNode.getElementsByTagName("a")[1].innerHTML.match(/\d+/), 10);
  14.  
  15.    }
  16.  
  17. var scouts = getTroop("spy");
  18.  
  19. var spear = getTroop("spear");
  20.  
  21. var axe = getTroop("axe");
  22.  
  23. var rams = getTroop("ram");
  24.  
  25. var light = getTroop("light");
  26.  
  27. var cats = getTroop("catapult");
  28.  
  29. var hc = getTroop("heavy");
  30.  
  31. if (cats >= 20)
  32.  
  33.    {if (axe >= 100) doc.forms[0].axe.value = 100;
  34.  
  35.     if (scouts >= 5) doc.forms[0].spy.value = 5;
  36.  
  37.     doc.forms[0].catapult.value = 20;
  38.  
  39.    }
  40.  
  41. else if (cats < 20)
  42.  
  43.    {alert("Not enough cats available for Burning.");
  44.  
  45.    }
  46.  
  47. coords = coords.split(" ");
  48.  
  49. index = 0;
  50.  
  51. counter = 1;
  52.  
  53. traincookie = document.cookie.match('(^|;)?train=([^;]*)(;|$)');
  54.  
  55. countcookie = document.cookie.match('(^|;)?count=([^;]*)(;|$)');
  56.  
  57. if (traincookie != null) index = parseInt(traincookie[2]);
  58.  
  59. if (countcookie != null) counter = parseInt(countcookie[2]);
  60.  
  61. if (index >= coords.length) alert('last village');
  62.  
  63. if (index >= coords.length) index = 0;
  64.  
  65. coords = coords[index];
  66.  
  67. coords = coords.split( "|");
  68.  
  69. counter = counter + 1;
  70.  
  71. if (counter == 6) index = index + 1;
  72.  
  73. if (counter == 16) counter = 1;
  74.  
  75. cookie_date = new Date(2099, 11, 11);
  76.  
  77. document.cookie = "train=" + index +";expires=" + cookie_date.toGMTString();
  78.  
  79. cookie_date = new Date(2099, 11, 11);
  80.  
  81. document.cookie = "count=" + counter +";expires=" + cookie_date.toGMTString();
  82.  
  83. doc.forms[0].x.value = coords[0];
  84.  
  85. doc.forms[0].y.value = coords[1];
  86.  
  87. doc.forms[0].x.focus();
  88.  
  89. void (0);
Add Comment
Please, Sign In to add comment