Förslag på skript

xouz

Member
Reaktionspoäng
0
Någon som har ett eller kan fixa ett script som på samlingsplatsen fyller i t.ex. xx antal LK och xx antal spejare?

Edit: är V25 om det spelar någon roll.

Mvh JC

Detta borde fungera ändra bara spej=0;lk=0; till det antal du vill att den ska fylla i och spara det i snabbmenyn.

Skriptet kommer att trycka på attack knappen efter att den fyllt i trupperna, så ha så att koords är ifyllda redan innan du kör skriptet.

Källkod:
javascript:spej=0;lk=0;insertUnit(document.forms[0].spy,spej);insertUnit(document.forms[0].light,lk);document.getElementById("target_attack").click();
 
Senast ändrad:

DeletedUser

Guest
Hello everybody !

I am french and I don't speak Swedish, so excuse me if the scripts that I suggest have already been proposed.
I would like to propose many scripts :

one to rename attacks that we launch :
Källkod:
var Rma = Rma || {};

Rma.debug = Rma.debug || false;
Rma.settings = Rma.settings || {};

(function($) {
	
	Rma.obj = function() {
		
		function getGameSettings(callback) {
			
			function Callback() {
				if(Rma.debug) console.info('Rma.settings.game : ',Rma.settings.game);
				callback();
			};
			
			if(Rma.settings.game != null) {
				Callback();
				return;
			}
			
			$.ajax({
				type: 'GET',
				url: '/interface.php?func=get_config',
				dataType: 'xml',
				success: function(xml){
					var $game = $(xml).find('game');
					var archer = $game.find('archer').text();
					var knight = $game.find('knight').text();
					
					Rma.settings.game = {
						archer:archer == 1,
						knight:knight > 0
					};

					Callback();
				},
				error: function() {
					UI.ErrorMessage('An error occurred while processing XML file.');
				}
			});
		}
		function getDefaultSettings() {
			return '[1,[["***Noble*** ({coords})",[["snob","gte","1"]]],["===OFF=== ({coords})",[["ram","gt","200"]]],["===OFF=== ({coords})",[["axe","gt","2000"],["light","gt","500"]]],["Fakes ({coords})",[["ram","e","1"]]],["Fakes ({coords})",[["catapult","e","1"]]],["Cata ({coords})",[["catapult","gte","1"],["axe","lt","200"],["light","lt","100"]]],["Pillage ({coords})",[["spy","gte","1"],["light","gte","1"]]],["Scout ({coords})",[["spy","gte","1"],["ram","e","0"],["axe","e","0"],["light","e","0"]]]]]';
		}
		function generateRmaSettings() {
			if(typeof(rmaSettings) == 'undefined' || rmaSettings == null || rmaSettings == '')
				rmaSettings = getDefaultSettings();
			
			Rma.settings.rma = null;
			try {
				Rma.settings.rma = JSON.parse(rmaSettings);
			}
			catch(e){}
			
			if(Rma.debug) {
				console.info('Rma.settings.rma : ',Rma.settings.rma);
			}
		}
		
		function getValues($row) {
			var units = ['spear','sword','axe','archer','spy','light','marcher','heavy','ram','catapult','knight','snob'];
			var $cells = $row.find('td:gt(2)');
			
			var values = {};
			var diff = 0;
			
			$.each(units,function(index,unit) {
				if((unit == 'archer' || unit == 'marcher') && !Rma.settings.game.archer)
					diff ++;
				else if((unit == 'knight') && !Rma.settings.game.knight)
					diff ++;
				else
					values[unit] = parseInt($($cells[index - diff]).text());
			});
			
			if(Rma.debug) {
				console.info('$row : ',$row,' | values : ',values);
			}
			
			return values;
		}
		function getCoordinates(text) {
			var matches = text.match(/([0-9]{1,3}\|[0-9]{1,3})/g);
			
			if(matches.length >= 1) {
				return matches[0];
			}
			return '';
		}
		function getAttackName($row) {
			return $row.find('.quickedit-label').text();
		}
		function editAttackName($row) {
			var $button = $row.find('.rename-icon');
			$button.click();
		}
		function renameAttackName($row,name) {
			var $input = $row.find('.quickedit-edit input[type="text"]');
			$input.val(name);
		}
		function submitAttackName($row) {
			var $button = $row.find('.quickedit-edit input[type="button"]');
			$button.click();
		}

		function findRule(values) {
			var searchRule = null;
			
			var rules = Rma.settings.rma[1];
			for(var i=0;i<rules.length;i++) {
				if(Rma.debug) {
					console.info('Test rule : ',rules[i]);
				}
				var conds = rules[i][1];
				
				var allCondsOk = true;
				
				for(var j=0;j<conds.length;j++) {
					if(Rma.debug) {
						console.info('Test cond : ',conds[j]);
					}
					var unit = conds[j][0];
					var operator = conds[j][1];
					var nb = conds[j][2];
					
					var condOk = false;
					if(operator == 'e' && values[unit] == nb) {
						condOk = true;
					}
					else if(operator == 'lt' && values[unit] < nb) {
						condOk = true;
					}
					else if(operator == 'lte' && values[unit] <= nb) {
						condOk = true;
					}
					else if(operator == 'gt' && values[unit] > nb) {
						condOk = true;
					}
					else if(operator == 'gte' && values[unit] >= nb) {
						condOk = true;
					}
					
					if(!condOk) {
						allCondsOk = false;
						if(Rma.debug) {
							console.info('cond pas ok');
						}
						break;
					}
					else {
						if(Rma.debug) {
							console.info('cond ok');
						}
					}
					
				}
				
				if(allCondsOk) {
					searchRule = rules[i];
					break;
				}
				
			}
			
			if(Rma.debug) {
				console.info('Rule found : ',searchRule);
			}
			
			return searchRule;
		}

		function process() {
			
			var $rows = $('tr[class*="nowrap"]');
			
			$rows.each(function() {
				var $row = $(this);
				var name = getAttackName($row);
				if(name.indexOf('Attaque sur') > -1) {
					var values = getValues($row);
					var coords = getCoordinates(name);
					
					/////////////////////////////////////
					// Search correct rule
					var rule = findRule(values);
					
					if(rule != null) {
						
						var newName = rule[0];
						newName = newName.replace('{coords}',coords);
						
						editAttackName($row);
						renameAttackName($row,newName);
						submitAttackName($row);
					}
				}
				
			});
			
		}
		
		function init() {
			if(game_data.screen == 'overview_villages' && game_data.mode == 'commands') {
				generateRmaSettings();
				if(Rma.settings.rma != null)
					getGameSettings(process);
				else
					UI.ErrorMessage('La configuration utilisée est incorrecte');
			}
			else {
				UI.ErrorMessage('Ce script doit être lancé depuis l\'aperçu ordres');
			}
		}
		
		///////////////////////////////////////////////////
		// Return
		return {
			init: init
		};
	};
	
})(jQuery);

var rma = new Rma.obj();
one to calculate backtime and snipe :
Källkod:
(function ()	{
var popup=window.open ('about:blank','twfg','width=640,height=480,scrollbars=1');
popup.document.open ('text/html','replace');
var S = "<br />"
+"<h2 style = 'text-align:center'>Virza\'s calculator</h2><hr />"
+"<table align=\'center\' id = \'table\'>"
+"<tr>"
+"<td>Fuseau horaire : <select id ='liste' name = \'liste\' size = \'1\' onChange = \'javascript:" +"changeList(this);void(0)\'>"
+"<option value = \'0\'>Choisissez votre fuseau horaire</option>"
+"<option value = \'-12\'>UTC -12</option>"
+"<option value = \'-11\'>UTC -11</option>"
+"<option value = \'-10\'>UTC -10</option>"
+"<option value = \'-9\'>UTC -9</option>"
+"<option value = \'-8\'>UTC -8</option>"
+"<option value = \'-7\'>UTC -7</option>"
+"<option value = \'-6\'>UTC -6</option>"
+"<option value = \'-5\'>UTC -5</option>"
+"<option value = \'-4\'>UTC -4</option>"
+"<option value = \'-3\'>UTC -3</option>"
+"<option value = \'-2\'>UTC -2</option>"
+"<option value = \'-1\'>UTC -1</option>"
+"<option value = \'0\'>UTC </option>"
+"<option value = \'1\'>UTC +1</option>"
+"<option value = \'2\'>UTC +2</option>"
+"<option value = \'3\'>UTC +3</option>"
+"<option value = \'4\'>UTC +4</option>"
+"<option value = \'5\'>UTC +5</option>"
+"<option value = \'6\'>UTC +6</option>"
+"<option value = \'7\'>UTC +7</option>"
+"<option value = \'8\'>UTC +8</option>"
+"<option value = \'9\'>UTC +9</option>"
+"<option value = \'10\'>UTC +10</option>"
+"<option value = \'11\'>UTC +11</option>"
+"<option value = \'12\'>UTC +12</option>"
+"</select>"
+"</td>"
+"<td>"
+"<div id=\"horlogeDiv\">Vous devez choisir votre fuseau pour afficher l\'horloge</div></td></tr></table>"
+"<link rel=\"stylesheet\" type=\"text/css\" href=\"http://" + window.location.hostname + "/merged/game.css\"/>"
+"</td>"
+"</tr>"
+"<hr />"
+"<script type = \'text/javascript\'> "
+"function changeList(f)	{"
+"	setCookie('fuseau', f.options[f.selectedIndex].value);"
+"	updateHorloge();"
+"}"
+""
+"	function setCookie(name, value, expires, path, domain, secure)	{"
+"		document.cookie = name + '=' + escape(value) +"
+"		((expires==undefined) ? '' : ('; expires=' + expires.toGMTString()))+"
+"		((path==undefined) ? '' : ('; path=' + path))+"
+"		((domain==undefined) ? '' : ('; domain='+domain))+"
+"		((secure==true) ? '; secure' : '');"
+"	}"
+""
+"	function getCookie(name)	{"
+"		if(document.cookie.length==0)	{ return null; }"
+"		var regCookies=new RegExp('(; )', 'g');"
+"		var cookies = document.cookie.split(regCookies);"
+"		for (i=0 ; i < cookies.length ; i++)	{"
+"			var regInfo=new RegExp('=', 'g');"
+"			var infos = cookies[i].split(regInfo);"
+"			if(infos[0] == name)	{"
+"				return unescape(infos[1]);"
+"			}"
+"		}"
+"		return null;"
+"}"
+"function updateHorloge ()	{"
+"var dt=new Date();"
+"var t = parseInt(getCookie('fuseau'));"
+"var jours = Array('Dimanche', 'Lundi', 'Mardi', 'Mercredi', 'Jeudi', 'Vendredi', 'Samedi');"
+"var mois= Array('Jan.', 'Fév.', 'Mars', 'Avr.', 'Mai', 'Juin', 'Juil.', 'Août', 'Sept.', 'Oct.', 'Nov.', 'Déc.');"
+"var Y=dt.getFullYear();"
+"var M=mois[dt.getMonth()];"
+"var D=dt.getDate();"
+"if(D==1)	{D='1er';}"
+"var J =jours[dt.getDay()];"
+"var h=dt.getHours();"
+"h = h+ t - 1;"
+"if(h<10)	{h = '0' + h;}"
+"var m = dt.getMinutes();"
+"if(m<10)	{m = '0' + m; }"
+"var s=dt.getSeconds();"
+"if(s<10)	{s='0' + s;}"
+"if(h>=24)	{h -= 24; D += 1; J = jours[dt.getDay() + 1]; if(h<10) {h = '0' + h;}}"
+"if(h<0)	{ h +=24; D-= 1; J = jours[dt.getDay() - 1]; if(h<10)	{h = '0' + h;}}"
+"document.getElementById('horlogeDiv').innerHTML=J+' '+D+' '+M+ ' ' +h+':' + m + ':' + s;"
+"setTimeout(function ()	{"
+"updateHorloge();"
+"}, 1000);"
+""
+"}</script>";

S += "<script type = 'text/javascript'>"
+"function focusT(champ)	{"
+"	if(champ.value == \"Entrez l'heure d'impact\")	{"
+"	champ.value = '';"
+"	}"
+"	else	{"
+"	champ.select();"
+"	} "
+"}"
+""
+"function blurT(champ)	{"
+"	if(champ.value == '')	{"
+"	champ.value = \"Entrez l'heure d'impact\";"
+"	}"
+"}"
+"function focusTi(champ)	{"
+"	if(champ.value == \"Entrez la durée du trajet\")	{"
+"	champ.value = '';"
+"	}"
+"	else	{"
+"	champ.select();"
+"	} "
+"}"
+""
+"function blurTi(champ)	{"
+"	if(champ.value == '')	{"
+"	champ.value = \"Entrez la durée du trajet\";"
+"	}"
+"}"
+"</script>"
+""
+"<h3 style = 'text-align:center'>Calculs d'heures</h3>"
+"<table align = 'center' id = 'show'>"
+"<tr>"
+"	<td>Back-Time</td><td>Snipe</td>"
+"</tr>"
+"<tr>"
+"	<td><input type = 'text' id = 'back' tabindex = '10' value = \"Entrez l'heure d'impact\" name = 'back'" +"onfocus = 'javascript: focusT(this);void(0)' onblur = 'javascript: blurT(this);' /></td>"
+"	<td><input type = 'text' id = 'snipe' tabindex = '16' value = \"Entrez l'heure d'impact\" name = 'snipe'" +"onfocus = 'javascript: focusT(this);void(0)' onblur = 'javascript: blurT(this);' /></td>"
+"</tr>"
+"<tr>"
+"	<td><input type = 'text' id = 'backT' tabindex = '13' value = \"Entrez la durée du trajet\" name = 'backT'" +"onfocus = 'javascript: focusTi(this);void(0)' onblur = 'javascript: blurTi(this);' /></td>"
+"	<td><input type = 'text' id = 'snipeT' tabindex = '19' value = \"Entrez la durée du trajet\" name = 'snipeT'" +"onfocus = 'javascript: focusTi(this);void(0)' onblur = 'javascript: blurTi(this);' /></td>"
+"</tr>"
+"<tr>"
+"	<td><input type = 'button' tabindex = '14' value = 'OK' onclick = 'javascript: backTime();void(0)'/></td>"
+"	<td><input type = 'button' tabindex = '20' value = 'OK' onclick = 'javascript: snipeO();void(0)'/></td>"
+"</tr>"
+"</table>"
+"<table align = 'center'>"
+"<br /><br />"
+"<tr>"
+"<td>"
+"<textarea style = 'width:400px;height:100px;' tabindex = '22' name = 'texte' id = 'texte' value = '' onfocus =" +"'select();'></textarea>"
+"</td>"
+"<input type = 'button' tabindex = '24' name = 'reset' value = 'Vider le champ' onclick = 'javascript:" +"toReset();void(0)'/>"
+"</tr>"
+"</table>"
+"<script type = 'text/javascript'>"
+"function backTime()	{"
+"	var timeArray = document.getElementById('back').value.split(':');"
+"	var travArray = document.getElementById('backT').value.split(':');"
+"	var H = parseInt(timeArray[0], 10) + parseInt(travArray[0], 10);"
+"	var M = parseInt(timeArray[1], 10) + parseInt(travArray[1], 10);"
+"	var S = parseInt(timeArray[2], 10) + parseInt(travArray[2], 10);"
+"	if(S > 60)	{M += 1;S -= 60;}"
+"	if(M > 60)	{H += 1;M -= 60;}"
+"	if(H >= 24)	{H -= 24;}"
+"	if(S<10)	{S = '0' + S;}"
+"	if(M<10)	{M = '0' + M;}"
+"	if(H<10)	{H = '0' + H;}"
+"	var resultat = H + ':' + M + ':' + S;"
+"	document.getElementById('texte').value += 'OFF ennemie sera de retour dans son village à ' + resultat + '';"
+"}"
+"function snipeO()	{"
+"	var timeArray = document.getElementById('snipe').value.split(':');"
+"	var travArray = document.getElementById('snipeT').value.split(':');"
+"	var H = parseInt(timeArray[0], 10) - parseInt(travArray[0], 10);"
+"	var M = parseInt(timeArray[1], 10) - parseInt(travArray[1], 10);"
+"	var S = parseInt(timeArray[2], 10) - parseInt(travArray[2], 10);"
+"	if(S < 0)	{S = 60 - (S * -1);M --;}"
+"	if(M < 0)	{M = 60 - (M * -1);H --;}"
+"	if(H < 0 )	{H = 24 - (H * -1);if(H>10)	{H = 'La veille à ' + H;}else if(H<10)	{H = 'La veille à 0' + H;}}"
+"	if(S<10)	{S = '0' + S;}"
+"	if(M<10)	{M = '0' + M;}"
+"	if(H<10)	{H = '0' + H;}"
+"	var resultat = H + ':' + M + ':' + S;"
+"	document.getElementById('texte').value += 'Heure de lancement : ' + resultat + '';"
+"}"
+"function toReset()	{"
+"document.getElementById('texte').value = '';"
+"}"
+"</script>";
S += "<a style = 'position:absolute; bottom:5%;'href = 'javascript: window.close()'>Fermer</a>";

popup.document.write(S);
popup.document.close();
})();
one to put a ram and randomly enter the coordinates of a village from a list :
Källkod:
javascript:coords='123|456 789|123 456|789';var doc=document;if (window.frames.length>0)doc=window.main.document;url=doc.URL;if(url.indexOf('screen=place')==-1)alert ('Ce script doit être lancé depuis le point de ralliement o_ô !');coords=coords.split(' ');index=Math.round (Math.random()*(coords.length-1));coords=coords[index];coords=coords.split('|');doc.forms [0].x.value=coords[0];doc.forms[0].y.value=coords[1];insertUnit(doc.forms[0].catapult,0);insertUnit(doc.forms [0].catapult,1); insertUnit(doc.forms[0].spy,0);insertUnit(doc.forms [0].spy,4); void(0)

these scripts are allowed on the french servers.
I hope you will accept if it is not already done.
 
Senast redigerad av en moderator:

xeM xeT

Member
Reaktionspoäng
0
Hello everybody !

I am french and I don't speak Swedish, so excuse me if the scripts that I suggest have already been proposed.
I would like to propose many scripts :

one to rename attacks that we launch :
Källkod:
var Rma = Rma || {};

Rma.debug = Rma.debug || false;
Rma.settings = Rma.settings || {};

(function($) {
	
	Rma.obj = function() {
		
		function getGameSettings(callback) {
			
			function Callback() {
				if(Rma.debug) console.info('Rma.settings.game : ',Rma.settings.game);
				callback();
			};
			
			if(Rma.settings.game != null) {
				Callback();
				return;
			}
			
			$.ajax({
				type: 'GET',
				url: '/interface.php?func=get_config',
				dataType: 'xml',
				success: function(xml){
					var $game = $(xml).find('game');
					var archer = $game.find('archer').text();
					var knight = $game.find('knight').text();
					
					Rma.settings.game = {
						archer:archer == 1,
						knight:knight > 0
					};

					Callback();
				},
				error: function() {
					UI.ErrorMessage('An error occurred while processing XML file.');
				}
			});
		}
		function getDefaultSettings() {
			return '[1,[["***Noble*** ({coords})",[["snob","gte","1"]]],["===OFF=== ({coords})",[["ram","gt","200"]]],["===OFF=== ({coords})",[["axe","gt","2000"],["light","gt","500"]]],["Fakes ({coords})",[["ram","e","1"]]],["Fakes ({coords})",[["catapult","e","1"]]],["Cata ({coords})",[["catapult","gte","1"],["axe","lt","200"],["light","lt","100"]]],["Pillage ({coords})",[["spy","gte","1"],["light","gte","1"]]],["Scout ({coords})",[["spy","gte","1"],["ram","e","0"],["axe","e","0"],["light","e","0"]]]]]';
		}
		function generateRmaSettings() {
			if(typeof(rmaSettings) == 'undefined' || rmaSettings == null || rmaSettings == '')
				rmaSettings = getDefaultSettings();
			
			Rma.settings.rma = null;
			try {
				Rma.settings.rma = JSON.parse(rmaSettings);
			}
			catch(e){}
			
			if(Rma.debug) {
				console.info('Rma.settings.rma : ',Rma.settings.rma);
			}
		}
		
		function getValues($row) {
			var units = ['spear','sword','axe','archer','spy','light','marcher','heavy','ram','catapult','knight','snob'];
			var $cells = $row.find('td:gt(2)');
			
			var values = {};
			var diff = 0;
			
			$.each(units,function(index,unit) {
				if((unit == 'archer' || unit == 'marcher') && !Rma.settings.game.archer)
					diff ++;
				else if((unit == 'knight') && !Rma.settings.game.knight)
					diff ++;
				else
					values[unit] = parseInt($($cells[index - diff]).text());
			});
			
			if(Rma.debug) {
				console.info('$row : ',$row,' | values : ',values);
			}
			
			return values;
		}
		function getCoordinates(text) {
			var matches = text.match(/([0-9]{1,3}\|[0-9]{1,3})/g);
			
			if(matches.length >= 1) {
				return matches[0];
			}
			return '';
		}
		function getAttackName($row) {
			return $row.find('.quickedit-label').text();
		}
		function editAttackName($row) {
			var $button = $row.find('.rename-icon');
			$button.click();
		}
		function renameAttackName($row,name) {
			var $input = $row.find('.quickedit-edit input[type="text"]');
			$input.val(name);
		}
		function submitAttackName($row) {
			var $button = $row.find('.quickedit-edit input[type="button"]');
			$button.click();
		}

		function findRule(values) {
			var searchRule = null;
			
			var rules = Rma.settings.rma[1];
			for(var i=0;i<rules.length;i++) {
				if(Rma.debug) {
					console.info('Test rule : ',rules[i]);
				}
				var conds = rules[i][1];
				
				var allCondsOk = true;
				
				for(var j=0;j<conds.length;j++) {
					if(Rma.debug) {
						console.info('Test cond : ',conds[j]);
					}
					var unit = conds[j][0];
					var operator = conds[j][1];
					var nb = conds[j][2];
					
					var condOk = false;
					if(operator == 'e' && values[unit] == nb) {
						condOk = true;
					}
					else if(operator == 'lt' && values[unit] < nb) {
						condOk = true;
					}
					else if(operator == 'lte' && values[unit] <= nb) {
						condOk = true;
					}
					else if(operator == 'gt' && values[unit] > nb) {
						condOk = true;
					}
					else if(operator == 'gte' && values[unit] >= nb) {
						condOk = true;
					}
					
					if(!condOk) {
						allCondsOk = false;
						if(Rma.debug) {
							console.info('cond pas ok');
						}
						break;
					}
					else {
						if(Rma.debug) {
							console.info('cond ok');
						}
					}
					
				}
				
				if(allCondsOk) {
					searchRule = rules[i];
					break;
				}
				
			}
			
			if(Rma.debug) {
				console.info('Rule found : ',searchRule);
			}
			
			return searchRule;
		}

		function process() {
			
			var $rows = $('tr[class*="nowrap"]');
			
			$rows.each(function() {
				var $row = $(this);
				var name = getAttackName($row);
				if(name.indexOf('Attaque sur') > -1) {
					var values = getValues($row);
					var coords = getCoordinates(name);
					
					/////////////////////////////////////
					// Search correct rule
					var rule = findRule(values);
					
					if(rule != null) {
						
						var newName = rule[0];
						newName = newName.replace('{coords}',coords);
						
						editAttackName($row);
						renameAttackName($row,newName);
						submitAttackName($row);
					}
				}
				
			});
			
		}
		
		function init() {
			if(game_data.screen == 'overview_villages' && game_data.mode == 'commands') {
				generateRmaSettings();
				if(Rma.settings.rma != null)
					getGameSettings(process);
				else
					UI.ErrorMessage('La configuration utilisée est incorrecte');
			}
			else {
				UI.ErrorMessage('Ce script doit être lancé depuis l\'aperçu ordres');
			}
		}
		
		///////////////////////////////////////////////////
		// Return
		return {
			init: init
		};
	};
	
})(jQuery);

var rma = new Rma.obj();
one to calculate backtime and snipe :
Källkod:
(function ()	{
var popup=window.open ('about:blank','twfg','width=640,height=480,scrollbars=1');
popup.document.open ('text/html','replace');
var S = "<br />"
+"<h2 style = 'text-align:center'>Virza\'s calculator</h2><hr />"
+"<table align=\'center\' id = \'table\'>"
+"<tr>"
+"<td>Fuseau horaire : <select id ='liste' name = \'liste\' size = \'1\' onChange = \'javascript:" +"changeList(this);void(0)\'>"
+"<option value = \'0\'>Choisissez votre fuseau horaire</option>"
+"<option value = \'-12\'>UTC -12</option>"
+"<option value = \'-11\'>UTC -11</option>"
+"<option value = \'-10\'>UTC -10</option>"
+"<option value = \'-9\'>UTC -9</option>"
+"<option value = \'-8\'>UTC -8</option>"
+"<option value = \'-7\'>UTC -7</option>"
+"<option value = \'-6\'>UTC -6</option>"
+"<option value = \'-5\'>UTC -5</option>"
+"<option value = \'-4\'>UTC -4</option>"
+"<option value = \'-3\'>UTC -3</option>"
+"<option value = \'-2\'>UTC -2</option>"
+"<option value = \'-1\'>UTC -1</option>"
+"<option value = \'0\'>UTC </option>"
+"<option value = \'1\'>UTC +1</option>"
+"<option value = \'2\'>UTC +2</option>"
+"<option value = \'3\'>UTC +3</option>"
+"<option value = \'4\'>UTC +4</option>"
+"<option value = \'5\'>UTC +5</option>"
+"<option value = \'6\'>UTC +6</option>"
+"<option value = \'7\'>UTC +7</option>"
+"<option value = \'8\'>UTC +8</option>"
+"<option value = \'9\'>UTC +9</option>"
+"<option value = \'10\'>UTC +10</option>"
+"<option value = \'11\'>UTC +11</option>"
+"<option value = \'12\'>UTC +12</option>"
+"</select>"
+"</td>"
+"<td>"
+"<div id=\"horlogeDiv\">Vous devez choisir votre fuseau pour afficher l\'horloge</div></td></tr></table>"
+"<link rel=\"stylesheet\" type=\"text/css\" href=\"http://" + window.location.hostname + "/merged/game.css\"/>"
+"</td>"
+"</tr>"
+"<hr />"
+"<script type = \'text/javascript\'> "
+"function changeList(f)	{"
+"	setCookie('fuseau', f.options[f.selectedIndex].value);"
+"	updateHorloge();"
+"}"
+""
+"	function setCookie(name, value, expires, path, domain, secure)	{"
+"		document.cookie = name + '=' + escape(value) +"
+"		((expires==undefined) ? '' : ('; expires=' + expires.toGMTString()))+"
+"		((path==undefined) ? '' : ('; path=' + path))+"
+"		((domain==undefined) ? '' : ('; domain='+domain))+"
+"		((secure==true) ? '; secure' : '');"
+"	}"
+""
+"	function getCookie(name)	{"
+"		if(document.cookie.length==0)	{ return null; }"
+"		var regCookies=new RegExp('(; )', 'g');"
+"		var cookies = document.cookie.split(regCookies);"
+"		for (i=0 ; i < cookies.length ; i++)	{"
+"			var regInfo=new RegExp('=', 'g');"
+"			var infos = cookies[i].split(regInfo);"
+"			if(infos[0] == name)	{"
+"				return unescape(infos[1]);"
+"			}"
+"		}"
+"		return null;"
+"}"
+"function updateHorloge ()	{"
+"var dt=new Date();"
+"var t = parseInt(getCookie('fuseau'));"
+"var jours = Array('Dimanche', 'Lundi', 'Mardi', 'Mercredi', 'Jeudi', 'Vendredi', 'Samedi');"
+"var mois= Array('Jan.', 'Fév.', 'Mars', 'Avr.', 'Mai', 'Juin', 'Juil.', 'Août', 'Sept.', 'Oct.', 'Nov.', 'Déc.');"
+"var Y=dt.getFullYear();"
+"var M=mois[dt.getMonth()];"
+"var D=dt.getDate();"
+"if(D==1)	{D='1er';}"
+"var J =jours[dt.getDay()];"
+"var h=dt.getHours();"
+"h = h+ t - 1;"
+"if(h<10)	{h = '0' + h;}"
+"var m = dt.getMinutes();"
+"if(m<10)	{m = '0' + m; }"
+"var s=dt.getSeconds();"
+"if(s<10)	{s='0' + s;}"
+"if(h>=24)	{h -= 24; D += 1; J = jours[dt.getDay() + 1]; if(h<10) {h = '0' + h;}}"
+"if(h<0)	{ h +=24; D-= 1; J = jours[dt.getDay() - 1]; if(h<10)	{h = '0' + h;}}"
+"document.getElementById('horlogeDiv').innerHTML=J+' '+D+' '+M+ ' ' +h+':' + m + ':' + s;"
+"setTimeout(function ()	{"
+"updateHorloge();"
+"}, 1000);"
+""
+"}</script>";

S += "<script type = 'text/javascript'>"
+"function focusT(champ)	{"
+"	if(champ.value == \"Entrez l'heure d'impact\")	{"
+"	champ.value = '';"
+"	}"
+"	else	{"
+"	champ.select();"
+"	} "
+"}"
+""
+"function blurT(champ)	{"
+"	if(champ.value == '')	{"
+"	champ.value = \"Entrez l'heure d'impact\";"
+"	}"
+"}"
+"function focusTi(champ)	{"
+"	if(champ.value == \"Entrez la durée du trajet\")	{"
+"	champ.value = '';"
+"	}"
+"	else	{"
+"	champ.select();"
+"	} "
+"}"
+""
+"function blurTi(champ)	{"
+"	if(champ.value == '')	{"
+"	champ.value = \"Entrez la durée du trajet\";"
+"	}"
+"}"
+"</script>"
+""
+"<h3 style = 'text-align:center'>Calculs d'heures</h3>"
+"<table align = 'center' id = 'show'>"
+"<tr>"
+"	<td>Back-Time</td><td>Snipe</td>"
+"</tr>"
+"<tr>"
+"	<td><input type = 'text' id = 'back' tabindex = '10' value = \"Entrez l'heure d'impact\" name = 'back'" +"onfocus = 'javascript: focusT(this);void(0)' onblur = 'javascript: blurT(this);' /></td>"
+"	<td><input type = 'text' id = 'snipe' tabindex = '16' value = \"Entrez l'heure d'impact\" name = 'snipe'" +"onfocus = 'javascript: focusT(this);void(0)' onblur = 'javascript: blurT(this);' /></td>"
+"</tr>"
+"<tr>"
+"	<td><input type = 'text' id = 'backT' tabindex = '13' value = \"Entrez la durée du trajet\" name = 'backT'" +"onfocus = 'javascript: focusTi(this);void(0)' onblur = 'javascript: blurTi(this);' /></td>"
+"	<td><input type = 'text' id = 'snipeT' tabindex = '19' value = \"Entrez la durée du trajet\" name = 'snipeT'" +"onfocus = 'javascript: focusTi(this);void(0)' onblur = 'javascript: blurTi(this);' /></td>"
+"</tr>"
+"<tr>"
+"	<td><input type = 'button' tabindex = '14' value = 'OK' onclick = 'javascript: backTime();void(0)'/></td>"
+"	<td><input type = 'button' tabindex = '20' value = 'OK' onclick = 'javascript: snipeO();void(0)'/></td>"
+"</tr>"
+"</table>"
+"<table align = 'center'>"
+"<br /><br />"
+"<tr>"
+"<td>"
+"<textarea style = 'width:400px;height:100px;' tabindex = '22' name = 'texte' id = 'texte' value = '' onfocus =" +"'select();'></textarea>"
+"</td>"
+"<input type = 'button' tabindex = '24' name = 'reset' value = 'Vider le champ' onclick = 'javascript:" +"toReset();void(0)'/>"
+"</tr>"
+"</table>"
+"<script type = 'text/javascript'>"
+"function backTime()	{"
+"	var timeArray = document.getElementById('back').value.split(':');"
+"	var travArray = document.getElementById('backT').value.split(':');"
+"	var H = parseInt(timeArray[0], 10) + parseInt(travArray[0], 10);"
+"	var M = parseInt(timeArray[1], 10) + parseInt(travArray[1], 10);"
+"	var S = parseInt(timeArray[2], 10) + parseInt(travArray[2], 10);"
+"	if(S > 60)	{M += 1;S -= 60;}"
+"	if(M > 60)	{H += 1;M -= 60;}"
+"	if(H >= 24)	{H -= 24;}"
+"	if(S<10)	{S = '0' + S;}"
+"	if(M<10)	{M = '0' + M;}"
+"	if(H<10)	{H = '0' + H;}"
+"	var resultat = H + ':' + M + ':' + S;"
+"	document.getElementById('texte').value += 'OFF ennemie sera de retour dans son village à ' + resultat + '';"
+"}"
+"function snipeO()	{"
+"	var timeArray = document.getElementById('snipe').value.split(':');"
+"	var travArray = document.getElementById('snipeT').value.split(':');"
+"	var H = parseInt(timeArray[0], 10) - parseInt(travArray[0], 10);"
+"	var M = parseInt(timeArray[1], 10) - parseInt(travArray[1], 10);"
+"	var S = parseInt(timeArray[2], 10) - parseInt(travArray[2], 10);"
+"	if(S < 0)	{S = 60 - (S * -1);M --;}"
+"	if(M < 0)	{M = 60 - (M * -1);H --;}"
+"	if(H < 0 )	{H = 24 - (H * -1);if(H>10)	{H = 'La veille à ' + H;}else if(H<10)	{H = 'La veille à 0' + H;}}"
+"	if(S<10)	{S = '0' + S;}"
+"	if(M<10)	{M = '0' + M;}"
+"	if(H<10)	{H = '0' + H;}"
+"	var resultat = H + ':' + M + ':' + S;"
+"	document.getElementById('texte').value += 'Heure de lancement : ' + resultat + '';"
+"}"
+"function toReset()	{"
+"document.getElementById('texte').value = '';"
+"}"
+"</script>";
S += "<a style = 'position:absolute; bottom:5%;'href = 'javascript: window.close()'>Fermer</a>";

popup.document.write(S);
popup.document.close();
})();
one to put a ram and randomly enter the coordinates of a village from a list :
Källkod:
javascript:coords='123|456 789|123 456|789';var doc=document;if (window.frames.length>0)doc=window.main.document;url=doc.URL;if(url.indexOf('screen=place')==-1)alert ('Ce script doit être lancé depuis le point de ralliement o_ô !');coords=coords.split(' ');index=Math.round (Math.random()*(coords.length-1));coords=coords[index];coords=coords.split('|');doc.forms [0].x.value=coords[0];doc.forms[0].y.value=coords[1];insertUnit(doc.forms[0].catapult,0);insertUnit(doc.forms [0].catapult,1); insertUnit(doc.forms[0].spy,0);insertUnit(doc.forms [0].spy,4); void(0)

these scripts are allowed on the french servers.
I hope you will accept if it is not already done.

Thank you, but these scripts are legal and players use them frequently on .se to :)

Merry Christmas
 

SvinFot

Member
Reaktionspoäng
22
Skulle vilja ha ett script som döper om alla byar till den förra ägaren, dvs tar någon en by av mig och använder scriptet så döps byn om till "fd Svinfot"

Tänkte att man kanske skulle kunna ha nytta av detta script om man inkorporera
den med ett massrenamer script..

javascript:var pathArray=window.location.host.split('.');var YourURL=String(window.location);var VillageID=YourURL.split('&id=');window.open("http://www.twstats.com/"+pathArray[0]+"/index.php?page=village&mode=conquers&id="+VillageID[1]);
 

DeletedUser

Guest
Söker ett script som byter namn på byarna men behåller siffrorna dom har


alltså 001 Gris > 001 Höna

Dom vanliga namnbyte scripten byter ju siffrorna framför namnet och det vill jag inte
 

xouz

Member
Reaktionspoäng
0
Söker ett script som byter namn på byarna men behåller siffrorna dom har


alltså 001 Gris > 001 Höna

Dom vanliga namnbyte scripten byter ju siffrorna framför namnet och det vill jag inte

Faktum är så behövs det egentligen inte ett sådant skript i detta fall eftersom "dom vanliga" byter namn uppifrån och ner, och sorterar man byarna efter namn så kommer 001 först och därmed kommer också dess namn bytas först och därför också få samma siffra.
 
Senast ändrad:
Topp