Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- javascript:
- var coords = "500|506";
- if (window.location.href.indexOf('&screen=place') < 0) {
- //relocate
- window.location.assign(game_data.link_base_pure + "place");
- }
- var name = 'fakes1';
- var d = (window.frames.length > 0) ? window.main.document : document;
- var u = document.URL;
- if (u.match(/screen=place/)) {
- if (coords != null) {
- coords = coords.split(" ");
- var index = Math.round(Math.random() * (coords.length - 1));
- coords = coords[index];
- /*coords = coords.split("|");
- d.forms[0].x.value = coords[0];
- d.forms[0].y.value = coords[1];*/
- let $coordsInput = $('input[data-type=player]');
- $coordsInput.val(coords);
- $coordsInput.submit();
- selectAllUnits(false);
- tcat = getTroop("catapult");
- tram = getTroop("ram");
- theavy = getTroop("heavy");
- tlight = getTroop("light");
- tsword = getTroop("sword");
- tarcher = getTroop("archer");
- tspear = getTroop("spear");
- taxe = getTroop("axe");
- tscout = getTroop("spy");
- if (tscout >= 10) {
- d.forms[0].spy.value = 10;
- }
- else
- {
- //not enough scouts, next village
- window.location.assign("/game.php?village=n"+game_data.village.id+"&screen=place")
- }
- if (tcat > Math.ceil(((game_data.village.points/100)-20)/8)) {
- d.forms[0].catapult.value = Math.ceil(((game_data.village.points/100)-20)/8);
- } else if (tram > Math.ceil(((game_data.village.points/100)-20)/5)) {
- d.forms[0].ram.value = Math.ceil(((game_data.village.points/100)-20)/5);
- } else
- {
- //not enough scouts, next village
- window.location.assign("/game.php?village=n"+game_data.village.id+"&screen=place")
- }
- }
- }
- void(0);
- function getTroop(a) {
- return parseInt(d.units[a].nextSibling.nextSibling.innerHTML.match(/\d+/), 10);
- }
- void(0);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement