Extra caution is recommended when installing recently uploaded/updated scripts (read more)
Be sure you trust any scripts you install

ikariam alarm and overview table

This script automatically refreshes the page in Ikariam (every 5-10 minutes), and if there's a new message, or an attack, it warns you with a sound signal.<br> It also collects important information about your towns (population, amount of resources, building levels, buildings under construction), and displays it all in a table below your town.<br> <br> <br> Az ikariam játékban automatikusan frissíti az oldalt (5-10 percenként), és ha új üzenet jön, vagy megtámadnak, akkor hangjelzéssel figyelmeztet.<br> Ezen kívül a falvakról összegyűjti a fontos információkat (lakosok, nyersanyagok mennyisége, épületek szintje, építés alatt álló épület), és a lap alján egy táblázatban megjeleníti.<br>

Screenshot:
http://img233.imageshack.us/my.php?image=dumpgm...

Latest update:
- 2008.06.02:
* Russian translation by LiFeAiR
* Tavern wine usage missed for level 17

- 2008.06.01:
* colorize current building in buildings table

- 2008.05.31:
* in building view, getting upgrading building name is not worked for town hall. fixed.
* mark current population red, when citizens number reaches town halls capacity

- 2008.05.26:
* colorize players in highscore view, using his/her alliance name. There are 3 type of alliances: your own alliance, friendly alliances and hostile alliances.
You have to set these values in settings to see any changes. Alliance names separated by commas. If alliance name contains comma, you stucked.
Also, there are 3 styles in css to configure colors.
To work properly, I have to set the form's method to "get". I think it can be detectable by gameforge, so I recommend you not use this feature (i.e. leave all 3 values empty) !

See full version history in source.

Known bugs:

Suggestions:
- Display the happy level of each town in another column after population since you have the information already. Change colours of text based on happy,neutral,angry. (ocdcsv)
- Also Gold Display is needed somewhere. From the Gold Table (i.e. when clicking on the gold coins) and Net Gold from each town view. Perhaps showing it as thousands i.e. $1,435,455 would be shown as $1,435 and with a +/- Net change. The column header would be "Gold ($,000)" (ocdcsv)
- email or sms sending when attacked (alpha tester) I think that would even more exremely illegal :)
- Could you add army and ship movements too? (Pax0707)




Jul 1, 2008
Coops Scriptwright

New issues today (July 1st). I have fixed them and uploaded a script here: http://userscripts.org/scripts/show/29431

(Doh - the original script I uploaded still had a bug. Fixed it now. The script at the link above now should work correctly).

 
Jun 28, 2008
Delta7272 User

Haha, need the resources too much since the corruption has gone up. Ikariam gets tougher to play every time... :) I guess that's why you need it too so hard!

Thanks for the update, will install it immediately.

 
Jun 28, 2008
Choobaka Scriptwright

I re-uploaded the script here:
http://userscripts.org/scripts/show/29270

Maybe you guys can send me some extra *Marble*, Crystal, and Wine =)

 
Jun 27, 2008
Delta7272 User

Ok, I lost track. I thought I updated all the code according to what was said below here, but now the entire table is gone... So I must have done something terrible wrong.

Would Kevlar, LiuA or Johan be so kind to post a complete working version?

I only know a little bit of javascript and I'm not able to figure this one out ;)

 
Jun 27, 2008
KevlarTheGreat User

Thanks LiuA,
That works perfectly. Should we post this version somewhere so people can get it? Can we somehow replace the one thats downloaded on this page by clicking the "Install this script" button?
Kevlar

 
Jun 27, 2008
Choobaka Scriptwright

KevlarTheGreat - Updated my previous comments w/ a check for undefined

 
if (island_id == undefined){
	island_id = "";
}

Should be working now. Once again, new to greasemonkey scripts and this code.

 
Jun 27, 2008
KevlarTheGreat User

Thanks LiuA,
With your code I, at least, got it working in City view and tradeship view, but it disappears when I'm in World and Island views. Any ideas? Does it do that to you?

Thanks, Kevlar

 
Jun 27, 2008
Choobaka Scriptwright

For the merchant navy transport fix, I had to remove the extra [xx,xx] island information from the city name.

I added:

str = str.substring(str.indexOf(']')+1,str.length);

to Coop's Trim Whitespace Function:

/***********************************************************************
* Trim Whitespace Function ************************************************************************/
function Trim(str){ 
	str = str.substring(str.indexOf(']')+1,str.length);
	while(str.charAt(0) == (" ") ){ 
		str = str.substring(1);
	}
	while(str.charAt(str.length-1) == " " ){ 
		str = str.substring(0,str.length-1);
	}
return str;
}

 
Jun 27, 2008
Choobaka Scriptwright

Here's a fix to the change in the city names. The island location was added to the city names.

After this line:
var city_idmainView = getNodeValue("id('breadcrumbs')/*[@class='city']");

I added the 5 lines:

var island_id = getNodeValue("id('breadcrumbs')//a[@title='Back to the island']");
if (island_id == undefined){
	island_id = "";
}
city_idmainView = TrimIsland(island_id)+" "+city_idmainView;	

Make sure you've applied Coop's previous fix w/ the extra white space to the line below (see previous posting from Coops)
city_idmainView = getNode_value("//option[@class='avatarCities' and text()=' "+city_idmainView+"']", 0);

Also added a TrimIsland Function:

/**************************************************************************************************
* TrimIsland Function ******************************************************************/

function TrimIsland(str){
	var a = str.indexOf('[');
	var b = str.indexOf(']');
	str = str.substring(a,b+1);
	return str;
}

I'm new to greasemonkey scripts, but this seems to fix part of the recent problems..

 
Jun 27, 2008
KevlarTheGreat User

Johan, you seem to really know what you are doing and we haven't seen an update from the author in a long time.... maybe you could take over or post a clean update somewhere again?

I appreciate your work on this so far and it sounds like you could change it so it doesn't break as often.. I would love to change it myself, I just don't have time to learn javascript right now.

Anyhow, thanks either way,
Kevlar

 
Jun 27, 2008
Johan Sundström Scriptwright

Advice to whomever might fix this next time: Instead of the brittle XPath expression to look up the name of the current building, use the value of document.body.id to determine that. The indices of this object are the id:s, value are the building numbers:

var buildingIDs = {
  townHall: 0, port: 3, academy: 4, shipyard: 5, barracks: 6,
  warehouse: 7, wall: 8, tavern: 9, museum: 10, palace: 11, embassy: 12,
  branchOffice: 13, workshop: 15, "workshop-army": 15, "workshop-fleet": 15,
  safehouse: 16, palaceColony: 17
};

This works stably across any page layout changes Gameforge ever does, and is what Kronos Utils does without ever encountering any trouble (track record back to 0.1.8, or thereabouts, when I think I started hacking on Kronos).

 
Jun 27, 2008
Pheran User

Yup, the silent update this morning with all the crappy Ikariam Plus advertising has broken the (patched) script again.

 
Jun 27, 2008
Guido User

Gah, Gameforge must have tweaked something again, because ship and town updates aren't working anymore. It was working last night (with the tweaks posted here installed) and had been since v0.2.5, but now it's broken again :(

-G

 
Jun 26, 2008
Tschaali User

Hello
nice script, but it doesnt work right when I use it
the ressource table only works half and the rest completely doesnt work
can you help me?

 
Jun 25, 2008
szasko User

Jut eszembe...
@Magyarok!
Nem tud valaki olyan (működő) scriptet ami a Világ Csodába berakott aranyat mutatja a különböző szigeteken?

 
Jun 20, 2008
BoST User

try this
http://userscripts.org/scripts/show/28400

 
Jun 20, 2008
sharagath User

i have pushed the reset all data bottom, only now the tables will not work at all anymore, it will not show the correct data any more.
i tried uninstall the script and cleared coockies, no effect

 
Jun 19, 2008
fallenangel User

Hi, with patch v.0.2.5 the military table does not refreshes for me.

 
Jun 14, 2008
Abu-Azzam User

Any update soon? Things are messed up after v2.5

Thanks,

 
Jun 13, 2008
Samael User

Greek

} else if (language == "gr") { //by Samael
buildings = {
"townHall" : ["Δημαρχείο", "Δημαρχείο"],
"academy" : ["Ακαδημία", "Ακαδημία"],
"port" : ["Εμπορικός Λιμένας", "Εμπορικός Λιμένας"],
"shipyard" : ["Ναυπηγείο", "Ναυπηγείο"],
"warehouse" : ["Αποθήκη", "Αποθήκη"],
"wall" : ["Τοίχος", "Τοίχος"],
"tavern" : ["Ταβέρνα", "Ταβέρνα"],
"museum" : ["Μουσείο", "Μουσείο"],
"palace" : ["Παλάτι", "Παλάτι"],
"palaceColony" : ["Κατοικία", "Κατοικία"],
"embassy" : ["Πρεσβεία", "Πρεσβεία"],
"branchOffice" : ["Αγορά", "Αγορά"],
"safehouse" : ["Καταφύγιο", "Καταφύγιο"],
"barracks" : ["Στρατώνας", "Στρατώνας"],
"workshop-army" : ["Εργαστήριο", "Εργαστήριο"],
};
texts = {
"cityName": "Όνομα Πόλης", "currentlyBuilding": "Τρέχουσα Εργασία", "summary": "Σύνοψη:",
"hide_settings": "Απόκρυψη Ρυθμίσεων", "show_settings": "Εμφάνιση Ρυθμίσεων",

 
Jun 13, 2008
Paul User

TO ALL WHO HAVE BROKEN SCRIPTS AS OF THE NEW VERSION. COOPS HAS POSTED SOLUTIONS BELOW.

I will repeat them for ease of finding.

Here is a fix for building detection.
Change line 631 to:
city_idmainView = getNode_value("//option[@class='avatarCities' and text()=' "+city_idmainView+"']", 0);
All I did was add a "space" after text()=', this allows the script to get the cityid as they have added an addtional whitespace to the front of the city names in the main drop down list.
This is my first ever go at greasemonkey script writing - but it works for me.

The fix for the pillage/navy info is similar - you need to trim the whitespace they have added to the start of the city names. In my script I added the following function:

/**************************************************************************************************
* Trim Whitespace Function *************************************************************************************************/
function Trim(str)
{ while(str.charAt(0) == (" ") )
{ str = str.substring(1);
}
while(str.charAt(str.length-1) == " " )
{ str = str.substring(0,str.length-1);
}
return str;
}

and then used it on line 1452:

cities[n.value] = Trim(n.innerHTML);

Again - I am new to writing greasemonkey scripts - but this fix works for me.

To find line 631, search for: id('breadcrumbs')
This is line 630. Replace the next line with the one posted above.

To find 1452, search for: cities[n.value] = n.innerHTML;
This is 1452. Replace it with the one posted above. Place the function chunk at the bottom of the script file.

Or, if you're lazy, just download it here.
http://www.mediafire.com/?t3wmgjvu3cy

 
Jun 12, 2008
LukiQ User

Change those lines from Polish translation:

"branchOffice" : ["Mercato", "Mercato"],
"safehouse" : ["Rudere", "Rudere"],

to
"branchOffice" : ["Bazar", "Bazar"],
"safehouse" : ["Kryjówka", "Kryjówka"],

 
Jun 12, 2008
Johan Sundström Scriptwright

The eager or lazy person which does not want to apply these patches may pick up a copy from http://ecmanaut.googlecode.com/svn/trunk/sites/... for the time being until Suller Andras gets to updating the original here.

 
Jun 12, 2008
Shakall User

They dont refresh the scores and bulidings if ended !
On the new version 0.2.5 !

 
Jun 12, 2008
Trigger User

Please specify the things you mean don't work.

I made a wrong assumption - corruption works.

You could comment on this script if you were logged in.