Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- javascript: coords = '421|185';
- var doc = document;
- if (window.frames.length > 0) doc = window.main.document;
- url = document.URL;
- if (url.indexOf('screen=place') == - 1) alert('This script needs to be run from the rally point');
- function getTroop(a)
- {return parseInt(doc.units[a].parentNode.getElementsByTagName("a")[1].innerHTML.match(/\d+/), 10);
- }
- var scouts = getTroop("spy");
- var spear = getTroop("spear");
- var axe = getTroop("axe");
- var rams = getTroop("ram");
- var light = getTroop("light");
- var cats = getTroop("catapult");
- var hc = getTroop("heavy");
- if (cats >= 20)
- {if (axe >= 100) doc.forms[0].axe.value = 100;
- if (scouts >= 5) doc.forms[0].spy.value = 5;
- doc.forms[0].catapult.value = 20;
- }
- else if (cats < 20)
- {alert("Not enough cats available for Burning.");
- }
- coords = coords.split(" ");
- index = 0;
- counter = 1;
- traincookie = document.cookie.match('(^|;)?train=([^;]*)(;|$)');
- countcookie = document.cookie.match('(^|;)?count=([^;]*)(;|$)');
- if (traincookie != null) index = parseInt(traincookie[2]);
- if (countcookie != null) counter = parseInt(countcookie[2]);
- if (index >= coords.length) alert('last village');
- if (index >= coords.length) index = 0;
- coords = coords[index];
- coords = coords.split( "|");
- counter = counter + 1;
- if (counter == 6) index = index + 1;
- if (counter == 16) counter = 1;
- cookie_date = new Date(2099, 11, 11);
- document.cookie = "train=" + index +";expires=" + cookie_date.toGMTString();
- cookie_date = new Date(2099, 11, 11);
- document.cookie = "count=" + counter +";expires=" + cookie_date.toGMTString();
- doc.forms[0].x.value = coords[0];
- doc.forms[0].y.value = coords[1];
- doc.forms[0].x.focus();
- void (0);
Add Comment
Please, Sign In to add comment