Ikariam Empire Board Update Manager

By holyschmidt Last update May 12, 2011 — Installed 30,300 times.

There are 21 previous versions of this script.

// ==UserScript==
// @name           Empire Board Update Manager
// @namespace      holyschmidt
// @include        http://s*.ikariam.*/*
// @require        http://www.betawarriors.com/bin/gm/jquerymin.js
// @require        http://www.betawarriors.com/bin/gm/jquery.idle-timer.js
// @require        http://www.betawarriors.com/bin/gm/57377user.js
// @require        http://www.betawarriors.com/bin/gm/57756user.js
// @require        http://www.betawarriors.com/bin/gm/62718user.js 
// @require        http://userscripts.org/scripts/source/60774.user.js
// @exclude        http://board.ikariam.*/
// @version        0.09
//
// @history        0.09 Force update buttons created.  Also can "pause" auto-refresh through any of these links.
// @history        0.08 Added 30 second + 60 second delay options.
// @history        0.07 Fix for city selection issue. Smarter about when city selection changes are made.
// @history        0.06 Adding settings window, and ability to adjust navigation delay.
// @history        0.05 Updated script to change city selection appropriately before navigating to next desired link.
// @history        0.04 Integrated script as a formal add-on to the Empire Board, using ARexx API.
// @history        0.03 Added support for additional pages.
// @history        0.02 Added timeout feature.
//
// ==/UserScript==

ScriptUpdater.check(75377, "0.09");

Config.scriptName = "Empire Board Update Manager";
Config.tabs = {
	"General":{
		html:'<p>Empire Board Update Manager configuration settings.</p>',
		fields:{
			navigationDelay:{
				type:'select',
				label:'Navigation Delay',
				options:{ "1s":1, "2s":2, "3s":3, "5s":5, "10s":10, "30s":30, "60s":60, },
				text:'how long until visiting next link?',
				value:5,
			},
		}
	},
};
Config.Data = {
	get:function(key, def)
	{
		return GM_getValue(document.domain + '.' + key, def);
	},
	set:function(key, val)
	{
		GM_setValue(document.domain + '.' + key, val);
	},
};

// Add-on designed as EmpireBoard child object registered with ARexx 
EmpireBoard.UpdateManagerAddon =
{
	// Require for ARexx 
	_Parent:                                null,
	EmpireBoardRequiredVersion:             180,
	AddOnName:                              'Empire Board Update Manager',
	
	// Addon optional metas for ARexx 
	Version:                                '0.09',
	HomePage:                               'http://userscripts.org/scripts/show/75377',
	ScriptURL:                              'http://userscripts.org/scripts/show/75377',
	UserScriptsID:                          75377
};

// Constructor method require for ARexx
// May return true  or false (if failed)
EmpireBoard.UpdateManagerAddon.Init = function()
{
	// Create options link.
	IkaTools.addOptionsLink(Config.scriptName);

	// Add custom styling.
	GM_addStyle(
		'#EmpireBoard .Table { position:relative; } ' +
		'#EmpireBoard .Table img.updateImage { position:absolute; top:7px; left:7px; height:15px; width:15px; cursor:pointer; } '
	);

	// Add update button(s).
	EmpireBoard.UpdateManagerAddon.AddImages();

	setTimeout(EmpireBoard.UpdateManagerAddon.Update, Math.random() * 1000 + Config.get('navigationDelay') * 500);
	setTimeout(EmpireBoard.UpdateManagerAddon.Go, Math.random() * 1000 + Config.get('navigationDelay') * 1000);
	return true;
};

EmpireBoard.UpdateManagerAddon.AddImages = function()
{
	$('#EmpireBoard div.Table').each(function() {
		var tableId = $(this).attr('id');
		var tableImage = '';
		switch (tableId) {
			case 'EmpireBoardBuildings':
			case 'EmpireBoardResources':
			case 'EmpireBoardArmy':	
				tableImage = Config.Data.get('UpdateEmpireTable', '') == tableId
					? EmpireBoard.UpdateManagerAddon.Images.play
					: EmpireBoard.UpdateManagerAddon.Images.refresh;
			break;
		}
		if (tableImage != '') {
			$('th.city_name', this).append('<img class="updateImage" src="' + tableImage + '"/>');
		}
	});

	$('img.updateImage')
	.bind('click', function() {
		var tableId = $(this).parents('div.Table').attr('id');
		EmpireBoard.UpdateManagerAddon.ToggleUpdate(tableId);
	})
	.bind('dblclick', function() {
		Config.Data.set('UpdateEmpireTable', '');
		Config.Data.set('UpdateEmpireTableLink', -1);
		$('#EmpireBoard img.updateImage').each(function() {
			$(this).attr('src', EmpireBoard.UpdateManagerAddon.Images.refresh);
		});
	});
}

// Manager update function.
EmpireBoard.UpdateManagerAddon.Go = function()
{
	var attn = $('#EmpireBoard div.Table sup.Red')[0]; 
	if (attn != null && attn.innerHTML == '!')
	{
		var linkObj = $(attn).prev()[0];
		if (linkObj != null)
		{
			// If a table is set for force-update, make sure the play button is active.
			if (Config.Data.get('UpdateEmpireTable', '') != '')
			{
				// Make sure the client wants to navigate away.
				var table = $(linkObj).parents('div.Table').attr('id');
				if ($('#' + table + ' img.updateImage').attr('src') != EmpireBoard.UpdateManagerAddon.Images.play)
				{
					return;
				}
			}

			var onclickObj = $(linkObj).parent().html().match(/var s = document.getElementById\('citySelect'\); .+s.form.submit\(\);/);
			if (onclickObj != null)
			{ 	
				// This (should) be the link to simply change the selected town.  The onlick attribute 
				// contains the necessary javascript to do this.
				Evaluate.go(onclickObj.join(''));
			}
			else if (linkObj.href != null)
			{
				// If the current city selection does not match the link requested, do some magic to
				// fix that.
				if ($(linkObj).parents('tr').attr('class') != 'current')
				{ 
					// Update the id of the target, so we can find it below.
					$(linkObj).attr('id', 'UpdateManagerNextLink');

					// The "click" event can only be initiated from within the scope of the page itself, not within
					// a GreaseMonkey script.  There might be a better way to do this.  Suggestions are welcome.
					Evaluate.go('\
						var obj = document.getElementById("UpdateManagerNextLink");\
						if (obj != null)\
						{\
							if (document.createEvent)\
							{\
								var evObj = document.createEvent("MouseEvents");\
								evObj.initEvent("click", true, false);\
								obj.dispatchEvent(evObj);\
							}\
							else\
							if (document.createEventObject)\
							{\
								obj.fireEvent("onclick");\
							}\
						}'
					);
				}

				// Update last page visited and manually goto url.
				document.location = linkObj.href;
			}
		}
	}
};

EmpireBoard.UpdateManagerAddon.Update = function()
{
	var table = Config.Data.get('UpdateEmpireTable', '');
	if (table != '')
	{
		if ($('#' + table + ' img.updateImage').attr('src') == EmpireBoard.UpdateManagerAddon.Images.play)
		{
			var nextLink = Config.Data.get('UpdateEmpireTableLink', -1);
			if (nextLink != -1)
			{
				while(nextLink < $('#EmpireBoard #' + table + ' a').size() 
					&& !EmpireBoard.UpdateManagerAddon.LinkSupported($('#EmpireBoard #' + table + ' a:eq(' + nextLink + ')')))
				{
					nextLink = nextLink + 1;
				}

				if (nextLink < $('#EmpireBoard #' + table + ' a').size())
				{
					// Setup next link.
					Config.Data.set('UpdateEmpireTableLink', nextLink + 1);

					// Add attention link to appropriate link.
					$('#EmpireBoard #' + table + ' a:eq(' + nextLink + ')').after(
						'<sup class=Red title="Require attention">!</sup>'
					);

					// Fire off event to handle link update.
					setTimeout(EmpireBoard.UpdateManagerAddon.Go, Math.random() * 1000);
				}
				else
				{
					// Links done.
					Config.Data.set('UpdateEmpireTable', '');
					Config.Data.set('UpdateEmpireTableLink', -1);
					$('#EmpireBoard img.updateImage').attr('src', EmpireBoard.UpdateManagerAddon.Images.refresh);
				}
			}
		}
	}
};

EmpireBoard.UpdateManagerAddon.LinkSupported = function(linkObj)
{
	if (linkObj != null)
	{
		var url = $(linkObj).attr('href');
		if (url.match(/index.php?cityId=/) || url.match(/view=transport/) || url.match(/view=deployment/) || url.match(/view=worldmap_iso/))
		{
			return false;
		}
		else
		{
			return true;
		}
	}
	return false;
}

EmpireBoard.UpdateManagerAddon.ToggleUpdate = function(tableId)
{
	if (Config.Data.get('UpdateEmpireTable', '') == tableId && Config.Data.get('UpdateEmpireTableLink', -1) >= 0)
	{
		// Is it currently paused?
		var imageSrc = $('#' + tableId + ' img.updateImage').attr('src');
		if (imageSrc == EmpireBoard.UpdateManagerAddon.Images.refresh || imageSrc == EmpireBoard.UpdateManagerAddon.Images.play)
		{
			// Refresh --> Pause
			$('#' + tableId + ' img.updateImage').attr('src', EmpireBoard.UpdateManagerAddon.Images.pause);
		}
		else
		if (imageSrc == EmpireBoard.UpdateManagerAddon.Images.pause)
		{
			// Pause --> Play
			$('#' + tableId + ' img.updateImage').attr('src', EmpireBoard.UpdateManagerAddon.Images.play);

			// Fire off event.
			EmpireBoard.UpdateManagerAddon.Update();
		}
	}
	else
	{
		// Update the refresh button(s).
		$('#EmpireBoard img.updateImage').attr('src', EmpireBoard.UpdateManagerAddon.Images.refresh);
		$('#' + tableId + ' img.updateImage').attr('src', EmpireBoard.UpdateManagerAddon.Images.pause);

		// Initiate refresh by setting up first link index.
		Config.Data.set('UpdateEmpireTable', tableId);
		Config.Data.set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p5A9O5erSQHXtkqEZDxeewq8n9zl38SGRiIcEAEz+hq9Fh9js9doZLBhEyMzyorImRIMznHcBOCeJC5r9/i/43fozzUFF7iQbaboGt0dn3eSNH8weXJSwM/uFADNr3scO16WnOz2KGbU1YQ48lu9+/3gkNDbP3vm61v8bRGR6dLFWSKJwhCnbo91HRJ0mcdFg56kQZm2oGOB8/ChnPPHpfgBYtKkRPRb3rC/tXx5R8rbXTuBr9HT8BxZARbeuGAn2AAAAAElFTkSuQmCC',
};

// Evaluator used to initiate javascript from within the scope of the page itself.
Evaluate = {
	go:function(source) {
		// Check for function input.
		if ('function' == typeof source) {
			// Execute this function with no arguments, by adding parentheses.
			// One set around the function, required for valid syntax, and a
			// second empty set calls the surrounded function.
			source = '(' + source + ')();'
		}

		// Create a script node holding this  source code.
		var script = document.createElement('script');
		script.setAttribute("type", "application/javascript");
		script.textContent = source;

		// Insert the script node into the page, so it will run, and immediately
		// remove it to clean up.
		document.body.appendChild(script);
		document.body.removeChild(script);
	}
};

// Register with the Empire Board.
EmpireBoard.ARexx.RegisterAddOn(EmpireBoard.UpdateManagerAddon);