Ikariam kChen Overview

By kchen Last update Feb 18, 2009 — Installed 346,343 times.

Split Army Table!!

in
Subscribe to Split Army Table!! 7 posts, 3 voices



alreemi User

Hello,
thanks a lot for the programmers of this great scripts
i really can't play without it...

I have a little issue...
could the army table be split into two tables; one for troops and the other for ships?
because the table is really too long and it extends outside the browser panel

and thank you

 
frechi User

maybe the same at the buildings?
old buildings in one table and the new buildings in a second one.

or if it would be easier, use pictures instead words like at the armee/fleet table. I could decrease the pictures and host them for you.

 
alreemi User

thanks frechi for your comment
you are right
there is 10 new buildings in version 0.3

maybe it is better to include the pictures rather than the names
and adding a choice in the options for choosing either the names or the pictures

 
frechi User

I've tested a little bit.
If the Icons from the Building are width 35 px all 25 Buildings will fit in only one table, but i don't know how to edit the scipt to help kchen.

For the test i chanched the discription into a link to the picture, i know it's a simple way, but on this way i only changed one language. I think kchen will find a better way to implemet it.

I've test also a little bit at the army table but without any solution. The only way will be to split the table like alreemi wrote in the first posting here.

 
lexichlong(LxL) User
I has edited the script for icon in building table with size (65px-65px) and I has succeedwith it but the wall's icon is too weird. So I don't khow but if you want to change it you can try this. This is the full script but it just support Vietnamese and English. //************************************************** //==Ikariam kchen Overview //Original script by kchen at http://userscripts.org/scripts/show/35879 //Remix by LxL //************************************************** var _startTime = new Date().getTime(); var scriptversion = "v0.2.8.031"; var scriptname = "kChen Overview"; // please don't change var scriptinstall = "http://userscripts.org/scripts/source/35879.user.js"; var scriptsource = "http://userscripts.org/scripts/review/35879?format=txt"; var scriptsite = "http://userscripts.org/scripts/show/35879"; var default_style = <><![CDATA[ #overview__table .resources_table, #overview__table .buildings_table, #overview__table .army_table, #overview__table .favorites_table, #overview__table .players_table, #overview__table .transporters_table, #overview__table .research_table { text-align: center; border-style: dotted; width: 980px; } .time_counter { font-weight: bold; color: #C00000; } .lf { border-left: double; border-color: #542C0F; } .rf { border-right: double; border-color: #542C0F; } .current_city_highlight { background-color: #CDA55F; } #overview__table table td { padding: 0px; height: auto; white-space: nowrap; } #overview__table .upgrading { background-color: #B4DC8C; } #overview__table tr.table_header { border-bottom: double; font-weight: bold; padding: 0px; background-color: #E6C88C; color: #542C0F; } #overview__table th.table_header { text-align: center; font-weight: bold; padding: 0px; color: #542C0F; background-color: #E6C88C; } #overview__table tr.table_footer { border-top: double; } #overview__table td.table_footer { /*also for army table's last column*/ font-weight: bold; } #overview__table .vacation { background-color: #B4DC8C; } #overview__table .banned { background-color: #F09090; } #overview__table .inactivity { background-color: #C0C0C0; } #overview__table img { vertical-align: middle; } .arrivinggoods { font-weight: bold; color: #C00000; } td.arrivinggoodstooltip { padding: 3px; } td.arrivinggoodstooltip { border-width: 1px; border-style: dotted; } /****************** progress bar styles *******************/ table.myPercent { height: 4px; width: 100%; } tr.myPercent { height: 4px; } td.myPercentRemaining { // background-color: #CDA55F; } td.myPercentNormal { /* normal state. you have plenty of rooms */ background-color: green; } td.myPercentWarning { /* warehose is getting full */ background-color: #A00000; } td.myPercentAlmostFull { /* warehouse is almost full */ background-color: #C00000; } td.myPercentFull { /* warehouse is full */ background-color: #ff0000; } /****************** highscore styles *******************/ tr.hs_ownally { background-color: #DAF887 !important; } tr.hs_friendlyally { background-color: #FFFF80 !important; } tr.hs_hostileally { background-color: #FF979B !important; } /****************** population full *******************/ td.populationfull { color: red; font-weight: bold; } /****************** current building *******************/ #overview__table table th.current_building { background-color: #E6C88C; color: #424994; } th.current_building { background-color: #E6C88C; color: #424994; } td.current_building { } ]></>.toXMLString(); var server = /\/\/([a-z._0-9]+)\//.exec(document.URL); server = RegExp.$1; var config = getConfig(); var players = getPlayers(); var langtype = "lf"; var language = setLanguage(); var buildings; var texts; getLocalizedTexts(language); var actioncode = getActionCode(); String.prototype.Trim = function() { return this.replace(/(^\s*)|(\s*$)/g, ""); } String.prototype.LTrim = function() { return this.replace(/(^\s*)/g, ""); } String.prototype.RTrim = function() { return this.replace(/(\s*$)/g, ""); } String.prototype.TrimHTML = function() { return this.replace(/(<[^>]*>)/g, ""); } function rand(min,max) { return Math.floor(Math.random()*(max-min+1)+min); } function getConfig() { var config = unserialize(getVar("config", "")); if (config == null || config == undefined || config == "" || ("".config == "NaN")) { config = new Object(); } if (config.cfg == undefined) { config.cfg = new Object(); } return config; } function saveConfig() { setVar("config", serialize(config)); } function getPlayers() { var players; try { players = eval(getVar("players", "({})")); } catch (e) { log("Error while unserializing 'players': "+e); log("Stored data: "+getVar("players", "")); } if (players == null || players == undefined || ("".players == "NaN")) { players = new Object(); } if (players.cities == undefined) { players.cities = new Object(); } if (players.playersCities == undefined) { players.playersCities = new Object(); } if (players.islands == undefined) { players.islands = new Object(); } return players; } function savePlayers() { setVar("players", uneval(players)); } function CheckupDate(text){ if (/scriptversion.*=.*\"([v0-9.]+.+)\"/.exec(text) == null) return; var newversion = RegExp.$1; var newver = newversion.split("\."); var oldver = scriptversion.split("\."); var update = (newver.length != oldver.length) ? true : false; if (!update) { for(var i=0; i<newver>< inewver) update = true; if (update) { if (confirm(texts["NewVersion"].replace(/%s/,newversion))) { location.href = scriptinstall; } } } function VersionUpdate(){ var lastSearch = getCfgValue("LAST_UPDATE", 0); var searchFreq = 8 * 3600 * 1000; // if(_startTime - lastSearch > searchFreq) { setCfgValue("LAST_UPDATE", _startTime); get(scriptsource, CheckupDate); } } function log(msg) { if ((config.cfg["DEBUG_LOG"] == true) && (console != undefined)) { console.log("[kChenOverview] "+msg); } } function xpath(query) { return document.evaluate(query, document, null,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null); } function getCfgValue(key, defaultValue) { return ((config.cfg != undefined && config.cfg[key] != undefined) ? config.cfg[key] : defaultValue); } function getCfgValueNonEmpty(key, defaultValue) { return ((config.cfg != undefined && config.cfg[key] != undefined && config.cfg[key] != "") ? config.cfg[key] : defaultValue); } function setCfgValue(key, value) { config.cfg[key] = value; setVar("config", serialize(config)); } function playSound(sound, volume) { var body = document.getElementsByTagName("body")[0]; var emb = document.createElement("embed"); emb.src = sound; emb.setAttribute("autostart", "true"); emb.setAttribute("loop", "false"); emb.setAttribute("hidden", "true"); emb.setAttribute("volume", volume); body.appendChild(emb); } function getRefreshTime() { return (parseInt(MIN) + Math.round(Math.random() * (MAX - MIN))) * 1000; } function setLanguage() { var arr = server.split("\."); var lang = arr[arr.length - 1]; if (lang == "com" && arr.length == 4) { //for example: http://s1.ba.ikariam.com lang = arr[1]; } if (lang == "net" && arr.length == 3) { //for example: http://s1.ikariam.net/ lang = "tr"; } var l = getCfgValueNonEmpty("LANGUAGE", language); if (l != undefined) { lang = l; } return lang; } var TimeUnits = { day: 86400, hour: 3600, minute: 60, second: 1 }; var academyCapacities = [0, 8, 12, 16, 22, 28, 35, 43, 51, 60, 69, 79, 89, 100, 111, 122, 134, 146, 159, 172, 185, 198, 212, 227, 241]; var warehouseWoodCapacities = [0, 1160, 2200, 3576, 5336, 7424, 9975, 12799, 16152, 19944, 24200, 28791, 34040, 43520, 54439, 66528, 80024, 320096, 640192, 1280384, 2560768, 5121536, 10243072, 20486144, 40972288, 81944576, 163889152, 327778304, 655556608, 1311113216, 2622226432, 5244452864, 10488905728]; var warehouseOtherCapacities = [0, 420, 500, 1152, 2052, 2248, 3507, 3780, 5332, 7179, 9347, 11784, 14499, 20028, 23548, 27484, 34932, 139728, 279456, 558912, 1117824, 2235648, 4471296, 8942592, 17885184, 35770368, 71540736, 143081472, 286162944, 572325888, 1144651776, 2289303552, 4579607104]; var tavernWineUsage = [0, 3, 5, 8, 11, 14, 17, 21, 25, 29, 33, 38, 42, 47, 52, 57, 63, 68, 73, 79, 85, 91, 97, 103, 109]; var townHallSpaces = [0, 60, 96, 143, 200, 263, 333, 410, 492, 580, 672, 769, 871, 977, 1087, 1201, 1320, 1441, 1567, 1696, 1828, 1964, 2103, 2246, 2391, 2540, 2691, 2845, 3003, 3163, 3326, 3492, 3660]; var unitScoreBasePoints = {"wood": 0.02, "wine": 0.16, "glass": 0.04, "sulfur": 0.04}; var unitScoreBaseIndex = {"wood": "w", "wine": "W", "glass":"C", "sulfur":"S"}; var costs = { "townHall" : [{}, {w:70, t:"34m 48s"}, {w:98, t:"56m 24s"}, {w:65, M:17, t:"1h 24m"}, {w:129, M:28, t:"1h 58m"}, {w:236, M:66, t:"2h 40m"}, {w:402, M:95, t:"3h 29m"}, {w:594, M:156, t:"4h 25m"}, {w:849, M:243, t:"5h 30m"}, {w:1176, M:406, t:"6h 43m"}, {w:1586, M:579, t:"8h 5m"}, {w:2101, M:799, t:"9h 35m"}, {w:3280, M:1348, t:"11h 15m"}, {w:4937, M:2124, t:"13h 3m"}, {w:7171, M:2951, t:"15h 1m"}, {w:10139, M:4409, t:"17h 9m"}, {w:14537, M:6461, t:"20h 11m"}, {w:18420, M:8187, t:"22h 44m"}, {w:22896, M:10176, t:"1D 1h"}, {w:28047, M:12466, t:"1D 4h"}, {w:33934, M:15082, t:"1D 7h"}, {w:40623, M:18055, t:"1D 10h"}, {w:48107, M:21381, t:"1D 14h"}, {w:56511, M:25116, t:"1D 17h"}, {w:226044, M:100464, t:"6D 23h"}, {w:452088, M:200928, t:"13D 22h"}, {w:904176, M:401856, t:"27D 21h"}, {w:1808352, M:803712, t:"55D 19h"}, {w:3616704, M:1607424, t:"111D 15h"}, {w:7233408, M:3214848, t:"223D 6h"}, {w:14466816, M:6429696, t:"446D 12h"}, {w:28933632, M:12859392, t:"893D 19m"}], "academy" : [{w:36, t:"14m 24s"}, {w:58, t:"28m 48s"}, {w:84, t:"48m"}, {w:79, C:30, t:"1h 19m"}, {w:159, C:73, t:"1h 57m"}, {w:302, C:210, t:"2h 48m"}, {w:535, C:285, t:"3h 52m"}, {w:889, C:467, t:"5h 6m"}, {w:1423, C:712, t:"6h 36m"}, {w:2174, C:999, t:"8h 16m"}, {w:3221, C:1307, t:"10h 16m"}, {w:4639, C:1960, t:"12h 27m"}, {w:7155, C:3267, t:"15h"}, {w:10630, C:4573, t:"17h 45m"}, {w:15224, C:6264, t:"20h 44m"}, {w:20358, C:8853, t:"1D 7m"}, {w:81432, C:35412, t:"4D 28m"}, {w:162864, C:70824, t:"8D 57m"}, {w:325728, C:141648, t:"16D 1h"}, {w:651456, C:283296, t:"32D 3h"}, {w:1302912, C:566592, t:"64D 7h"}, {w:2605824, C:1133184, t:"128D 15h"}, {w:5211648, C:2266368, t:"257D 6h"}, {w:10423296, C:4532736, t:"514D 13h"}], "port" : [{w:18, t:"10m 48s"}, {w:31, t:"24m 29s"}, {w:44, t:"50m 24s"}, {w:87, M:33, t:"1h 26m"}, {w:156, M:48, t:"2h 18m"}, {w:266, M:93, t:"2h 58m"}, {w:425, M:126, t:"3h 41m"}, {w:653, M:215, t:"4h 52m"}, {w:963, M:344, t:"5h 37m"}, {w:1381, M:529, t:"7h 6m"}, {w:1915, M:777, t:"7h 48m"}, {w:2604, M:1100, t:"9h 30m"}, {w:3790, M:1731, t:"10h 36s"}, {w:5349, M:2301, t:"11h 53m"}, {w:7333, M:3017, t:"11h 59m"}, {w:9808, M:4265, t:"13h 56m"}, {w:39232, M:17060, t:"2D 7h"}, {w:78464, M:34120, t:"4D 15h"}, {w:156928, M:68240, t:"9D 7h"}, {w:313856, M:136480, t:"18D 14h"}, {w:627712, M:272960, t:"37D 4h"}, {w:1255424, M:545920, t:"74D 8h"}, {w:2510848, M:1091840, t:"148D 17h"}, {w:5021696, M:2183680, t:"297D 11h"}], "shipyard" : [{w:38, t:"22m 41s"}, {w:67, t:"52m 49s"}, {w:96, t:"1h 50m"}, {w:152, M:57, t:"2h 31m"}, {w:272, M:83, t:"4h 1m"}, {w:388, M:135, t:"4h 20m"}, {w:609, M:180, t:"5h 17m"}, {w:810, M:266, t:"6h 2m"}, {w:1091, M:390, t:"6h 22m"}, {w:1551, M:594, t:"7h 58m"}, {w:1921, M:780, t:"7h 50m"}, {w:2600, M:1098, t:"9h 29m"}, {w:3530, M:1612, t:"9h 19m"}, {w:4555, M:1960, t:"10h 7m"}, {w:6228, M:2563, t:"10h 10m"}, {w:7702, M:3349, t:"10h 57m"}, {w:30808, M:13396, t:"1D 19h"}, {w:61616, M:26792, t:"3D 15h"}, {w:123232, M:53584, t:"7D 7h"}, {w:246464, M:107168, t:"14D 14h"}, {w:492928, M:214336, t:"29D 4h"}, {w:985856, M:428672, t:"58D 9h"}, {w:1971712, M:857344, t:"116D 19h"}, {w:3943424, M:1714688, t:"233D 14h"}, {w:7886848, M:3429376, t:"467D 4h"}, {w:15773696, M:6858752, t:"934D 9h"}, {w:31547392, M:13717504, t:"1868D 19h"}, {w:63094784, M:27435008, t:"3737D 14h"}, {w:126189568, M:54870016, t:"7475D 4h"}, {w:252379136, M:109740032, t:"14950D 9h"}, {w:504758272, M:219480064, t:"29900D 19h"}, {w:1009516544, M:438960128, t:"59801D 14h"}], "warehouse" : [{w:42, t:"27m 36s"}, {w:91, t:"1h 7m"}, {w:79, M:13, t:"1h 40m"}, {w:145, M:43, t:"2h 25m"}, {w:255, M:62, t:"3h 8m"}, {w:396, M:110, t:"4h 2m"}, {w:565, M:134, t:"4h 54m"}, {w:799, M:237, t:"5h 57m"}, {w:1203, M:387, t:"7h 6m"}, {w:1619, M:558, t:"8h 24m"}, {w:2135, M:780, t:"9h 54m"}, {w:2761, M:1167, t:"11h 27m"}, {w:4198, M:1917, t:"13h 12m"}, {w:5746, M:2472, t:"15h 12m"}, {w:7655, M:3150, t:"17h 22m"}, {w:10032, M:5235, t:"19h 48m"}, {w:40128, M:20940, t:"3D 7h"}, {w:80256, M:41880, t:"6D 14h"}, {w:160512, M:83760, t:"13D 4h"}, {w:321024, M:167520, t:"26D 9h"}, {w:642048, M:335040, t:"52D 19h"}, {w:1284096, M:670080, t:"105D 15h"}, {w:2568192, M:1340160, t:"211D 7h"}, {w:5136384, M:2680320, t:"422D 14h"}, {w:10272768, M:5360640, t:"845D 5h"}, {w:20545536, M:10721280, t:"1690D 10h"}, {w:41091072, M:21442560, t:"3380D 21h"}, {w:82182144, M:42885120, t:"6761D 19h"}, {w:164364288, M:85770240, t:"13523D 15h"}, {w:328728576, M:171540480, t:"27047D 6h"}, {w:657457152, M:343080960, t:"54094D 12h"}, {w:1314914304, M:686161920, t:"108189D 19m"}], "wall" : [{w:72, t:"1h 12m"}, {w:74, M:13, t:"1h 50m"}, {w:100, M:32, t:"2h 29m"}, {w:155, M:58, t:"3h 16m"}, {w:227, M:69, t:"4h 12m"}, {w:324, M:113, t:"4h 37m"}, {w:442, M:131, t:"4h 59m"}, {w:593, M:195, t:"5h 18m"}, {w:777, M:278, t:"5h 32m"}, {w:998, M:382, t:"5h 42m"}, {w:1255, M:509, t:"6h 24m"}, {w:1564, M:661, t:"7h 8m"}, {w:2159, M:950, t:"8h 55m"}, {w:2317, M:1058, t:"8h 44m"}, {w:2784, M:1301, t:"9h 7m"}, {w:3308, M:1423, t:"9h 27m"}, {w:3902, M:1728, t:"9h 43m"}, {w:4559, M:1876, t:"9h 56m"}, {w:5296, M:2245, t:"10h 4m"}, {w:6119, M:2661, t:"10h 9m"}, {w:7020, M:3120, t:"10h 8m"}, {w:7533, M:3348, t:"10h 2m"}, {w:8065, M:3584, t:"9h 51m"}, {w:8613, M:3828, t:"9h 34m"}, {w:34452, M:15312, t:"1D 14h"}, {w:68904, M:30624, t:"3D 4h"}, {w:137808, M:61248, t:"6D 9h"}, {w:275616, M:122496, t:"12D 18h"}, {w:551232, M:244992, t:"25D 12h"}, {w:1102464, M:489984, t:"51D 57m"}, {w:2204928, M:979968, t:"102D 1h"}, {w:4409856, M:1959936, t:"204D 3h"}, {w:8819712, M:3919872, t:"408D 7h"}, {w:17639424, M:7839744, t:"816D 15h"}, {w:35278848, M:15679488, t:"1633D 6h"}, {w:70557696, M:31358976, t:"3266D 13h"}, {w:141115392, M:62717952, t:"6533D 2h"}, {w:282230784, M:125435904, t:"13066D 5h"}, {w:564461568, M:250871808, t:"26132D 11h"}, {w:1128923136, M:501743616, t:"52264D 23h"}, {w:2257846272, M:1003487232, t:"104529D 22h"}, {w:4515692544, M:2006974464, t:"209059D 20h"}, {w:9031385088, M:4013948928, t:"418119D 16h"}, {w:18062770176, M:8027897856, t:"836239D 8h"}, {w:36125540352, M:16055795712, t:"1672478D 17h"}, {w:72251080704, M:32111591424, t:"3344957D 10h"}, {w:144502161408, M:64223182848, t:"6689914D 21h"}, {w:289004322816, M:128446365696, t:"13379829D 18h"}, {w:578008645632, M:256892731392, t:"26759659D 12h"}, {w:1156017291264, M:513785462784, t:"53519319D 57m"}, {w:2312034582528, M:1027570925568, t:"107038638D 1h"}, {w:4624069165056, M:2055141851136, t:"214077276D 3h"}, {w:9248138330112, M:4110283702272, t:"428154552D 7h"}, {w:18496276660224, M:8220567404544, t:"856309104D 15h"}, {w:36992553320448, M:16441134809088, t:"1712618209D 6h"}, {w:73985106640896, M:32882269618176, t:"3425236418D 13h"}], "tavern" : [{w:25, t:"13m 20s"}, {w:112, M:12, t:"55m 12s"}, {w:196, M:46, t:"1h 49m"}, {w:297, M:88, t:"3h 5m"}, {w:494, M:162, t:"4h 2m"}, {w:766, M:274, t:"4h 58m"}, {w:1127, M:432, t:"5h 47m"}, {w:1588, M:644, t:"7h 17m"}, {w:2177, M:920, t:"7h 57m"}, {w:2895, M:1274, t:"9h 34m"}, {w:3756, M:1715, t:"9h 55m"}, {w:4803, M:2244, t:"11h 35m"}, {w:6030, M:2594, t:"11h 29m"}, {w:7468, M:3307, t:"13h 8m"}, {w:9117, M:3751, t:"12h 25m"}, {w:11804, M:5133, t:"13h 59m"}, {w:47216, M:20532, t:"2D 7h"}, {w:94432, M:41064, t:"4D 15h"}, {w:188864, M:82128, t:"9D 7h"}, {w:377728, M:164256, t:"18D 15h"}, {w:755456, M:328512, t:"37D 7h"}, {w:1510912, M:657024, t:"74D 14h"}, {w:3021824, M:1314048, t:"149D 4h"}, {w:6043648, M:2628096, t:"298D 8h"}], "museum" : [{w:282, M:84, t:"1h 28m"}, {w:760, M:272, t:"2h 57m"}, {w:1616, M:656, t:"4h 56m"}, {w:2996, M:1319, t:"7h 25m"}, {w:5035, M:2353, t:"8h 40m"}, {w:7901, M:3499, t:"11h 35m"}, {w:11746, M:4979, t:"14h 54m"}, {w:16776, M:7456, t:"18h 38m"}, {w:67104, M:29824, t:"3D 2h"}, {w:134208, M:59648, t:"6D 5h"}, {w:268416, M:119296, t:"12D 10h"}, {w:536832, M:238592, t:"24D 20h"}, {w:1073664, M:477184, t:"49D 16h"}, {w:2147328, M:954368, t:"99D 9h"}, {w:4294656, M:1908736, t:"198D 19h"}, {w:8589312, M:3817472, t:"397D 15h"}, {w:17178624, M:7634944, t:"795D 7h"}, {w:34357248, M:15269888, t:"1590D 14h"}, {w:68714496, M:30539776, t:"3181D 5h"}, {w:137428992, M:61079552, t:"6362D 10h"}, {w:274857984, M:122159104, t:"12724D 21h"}, {w:549715968, M:244318208, t:"25449D 19h"}, {w:1099431936, M:488636416, t:"50899D 15h"}, {w:2198863872, M:977272832, t:"101799D 6h"}], "palace" : [{w:648, t:"4h"}, {w:5600, M:536, t:"8h"}, {w:20880, M:7317, C:4878, t:"9h"}, {w:57600, W:12800, M:32000, C:25600, t:"8h"}, {w:230400, W:102400, M:153600, C:102400, t:"8h"}, {w:460800, W:204800, M:307200, C:204800, t:"8h"}, {w:921600, W:409600, M:614400, C:409600, t:"8h"}, {w:1843200, W:819200, M:1228800, C:819200, t:"8h"}, {w:3686400, W:1638400, M:2457600, C:1638400, t:"8h"}, {w:7372800, W:3276800, M:4915200, C:3276800, t:"8h"}, {w:14745600, W:6553600, M:9830400, C:6553600, t:"8h"}, {w:29491200, W:13107200, M:19660800, C:13107200, t:"8h"}], "palaceColony" : [{w:648, t:"4h"}, {w:5600, M:536, t:"8h"}, {w:20880, M:7317, C:4878, t:"9h"}, {w:57600, W:12800, M:32000, C:25600, t:"8h"}, {w:230400, W:102400, M:153600, C:102400, t:"8h"}, {w:460800, W:204800, M:307200, C:204800, t:"8h"}, {w:921600, W:409600, M:614400, C:409600, t:"8h"}, {w:1843200, W:819200, M:1228800, C:819200, t:"8h"}, {w:3686400, W:1638400, M:2457600, C:1638400, t:"8h"}, {w:7372800, W:3276800, M:4915200, C:3276800, t:"8h"}, {w:14745600, W:6553600, M:9830400, C:6553600, t:"8h"}, {w:29491200, W:13107200, M:19660800, C:13107200, t:"8h"}], "embassy" : [{w:46, M:14, t:"50m 25s"}, {w:120, M:42, t:"1h 42m"}, {w:212, M:63, t:"2h 23m"}, {w:334, M:110, t:"2h 59m"}, {w:489, M:175, t:"3h 29m"}, {w:681, M:261, t:"3h 53m"}, {w:1001, M:406, t:"4h 38m"}, {w:1428, M:603, t:"5h 25m"}, {w:1967, M:866, t:"6h 15m"}, {w:2635, M:1203, t:"7h 6m"}, {w:3472, M:1622, t:"7h 58m"}, {w:4481, M:1928, t:"8h 53m"}, {w:5693, M:2521, t:"9h 49m"}, {w:7122, M:2931, t:"10h 46m"}, {w:8804, M:3732, t:"11h 45m"}, {w:10770, M:4683, t:"12h 45m"}, {w:43080, M:18732, t:"2D 3h"}, {w:86160, M:37464, t:"4D 6h"}, {w:172320, M:74928, t:"8D 12h"}, {w:344640, M:149856, t:"17D 19m"}, {w:689280, M:299712, t:"34D 38m"}, {w:1378560, M:599424, t:"68D 1h"}, {w:2757120, M:1198848, t:"136D 2h"}, {w:5514240, M:2397696, t:"272D 5h"}, {w:11028480, M:4795392, t:"544D 10h"}, {w:22056960, M:9590784, t:"1088D 20h"}, {w:44113920, M:19181568, t:"2177D 16h"}, {w:88227840, M:38363136, t:"4355D 9h"}, {w:176455680, M:76726272, t:"8710D 19h"}, {w:352911360, M:153452544, t:"17421D 15h"}, {w:705822720, M:306905088, t:"34843D 7h"}, {w:1411645440, M:613810176, t:"69686D 14h"}], "branchOffice" : [{w:15, t:"17m 17s"}, {w:38, t:"43m 12s"}, {w:104, M:32, t:"1h 32m"}, {w:222, M:66, t:"2h 7m"}, {w:426, M:152, t:"2h 45m"}, {w:643, M:246, t:"3h 40m"}, {w:933, M:417, t:"4h 45m"}, {w:1301, M:660, t:"5h 56m"}, {w:1765, M:1010, t:"7h 17m"}, {w:2317, M:1481, t:"8h 44m"}, {w:3002, M:2104, t:"10h 21m"}, {w:3799, M:2615, t:"12h 3m"}, {w:4754, M:3579, t:"13h 56m"}, {w:5839, M:4325, t:"15h 54m"}, {w:7618, M:6294, t:"18h 3m"}, {w:9131, M:8116, t:"20h 17m"}, {w:36524, M:32464, t:"3D 9h"}, {w:73048, M:64928, t:"6D 18h"}, {w:146096, M:129856, t:"13D 12h"}, {w:292192, M:259712, t:"27D 1h"}, {w:584384, M:519424, t:"54D 2h"}, {w:1168768, M:1038848, t:"108D 5h"}, {w:2337536, M:2077696, t:"216D 10h"}, {w:4675072, M:4155392, t:"432D 20h"}, {w:9350144, M:8310784, t:"865D 16h"}, {w:18700288, M:16621568, t:"1731D 9h"}, {w:37400576, M:33243136, t:"3462D 19h"}, {w:74801152, M:66486272, t:"6925D 15h"}, {w:149602304, M:132972544, t:"13851D 7h"}, {w:299204608, M:265945088, t:"27702D 14h"}, {w:598409216, M:531890176, t:"55405D 5h"}, {w:1196818432, M:1063780352, t:"110810D 10h"}], "safehouse" : [{w:20, t:"15m 8s"}, {w:49, M:10, t:"42m"}, {w:95, M:27, t:"1h 8m"}, {w:163, M:48, t:"1h 41m"}, {w:266, M:88, t:"2h 10m"}, {w:407, M:146, t:"2h 38m"}, {w:594, M:228, t:"3h 23m"}, {w:867, M:352, t:"4h 25m"}, {w:1179, M:498, t:"5h 22m"}, {w:1559, M:686, t:"6h 26m"}, {w:2012, M:919, t:"7h 12m"}, {w:2674, M:1250, t:"8h 17m"}, {w:3343, M:1438, t:"9h 1m"}, {w:4127, M:1828, t:"9h 40m"}, {w:5021, M:2066, t:"10h 15m"}, {w:6304, M:2672, t:"11h 12m"}, {w:7533, M:3276, t:"11h 36m"}, {w:8910, M:3960, t:"11h 52m"}, {w:9833, M:4370, t:"12h 1m"}, {w:11232, M:4992, t:"12h 28m"}, {w:44928, M:19968, t:"2D 1h"}, {w:89856, M:39936, t:"4D 3h"}, {w:179712, M:79872, t:"8D 7h"}, {w:359424, M:159744, t:"16D 15h"}, {w:718848, M:319488, t:"33D 6h"}, {w:1437696, M:638976, t:"66D 13h"}, {w:2875392, M:1277952, t:"133D 2h"}, {w:5750784, M:2555904, t:"266D 5h"}, {w:11501568, M:5111808, t:"532D 11h"}, {w:23003136, M:10223616, t:"1064D 23h"}, {w:46006272, M:20447232, t:"2129D 22h"}, {w:92012544, M:40894464, t:"4259D 20h"}, {w:184025088, M:81788928, t:"8519D 16h"}, {w:368050176, M:163577856, t:"17039D 8h"}, {w:736100352, M:327155712, t:"34078D 17h"}, {w:1472200704, M:654311424, t:"68157D 10h"}, {w:2944401408, M:1308622848, t:"136314D 21h"}, {w:5888802816, M:2617245696, t:"272629D 18h"}, {w:11777605632, M:5234491392, t:"545259D 12h"}, {w:23555211264, M:10468982784, t:"1090519D 57m"}], "barracks" : [{w:35, t:"6m 58s"}, {w:45, t:"16m 12s"}, {w:68, t:"31m 12s"}, {w:76, t:"56m 24s"}, {w:67, M:22, t:"1h 39m"}, {w:76, M:24, t:"1h 44m"}, {w:124, M:46, t:"2h 3m"}, {w:183, M:56, t:"2h 15m"}, {w:235, M:82, t:"2h 23m"}, {w:336, M:100, t:"2h 55m"}, {w:455, M:150, t:"3h 23m"}, {w:616, M:220, t:"4h"}, {w:755, M:289, t:"4h 18m"}, {w:980, M:398, t:"5h"}, {w:1170, M:494, t:"4h 48m"}, {w:1477, M:650, t:"5h 29m"}, {w:1797, M:821, t:"5h 25m"}, {w:2120, M:991, t:"5h 50m"}, {w:2435, M:1048, t:"5h 24m"}, {w:2831, M:1254, t:"5h 48m"}, {w:3208, M:1320, t:"5h 14m"}, {w:3763, M:1595, t:"5h 43m"}, {w:4296, M:1869, t:"5h 5m"}, {w:4874, M:2166, t:"5h 24m"}, {w:19496, M:8664, t:"21h 39m"}, {w:38992, M:17328, t:"1D 19h"}, {w:77984, M:34656, t:"3D 14h"}, {w:155968, M:69312, t:"7D 5h"}, {w:311936, M:138624, t:"14D 10h"}, {w:623872, M:277248, t:"28D 21h"}, {w:1247744, M:554496, t:"57D 18h"}, {w:2495488, M:1108992, t:"115D 12h"}, {w:4990976, M:2217984, t:"231D 57m"}, {w:9981952, M:4435968, t:"462D 1h"}, {w:19963904, M:8871936, t:"924D 3h"}, {w:39927808, M:17743872, t:"1848D 7h"}, {w:79855616, M:35487744, t:"3696D 15h"}, {w:159711232, M:70975488, t:"7393D 6h"}, {w:319422464, M:141950976, t:"14786D 13h"}, {w:638844928, M:283901952, t:"29573D 2h"}, {w:1277689856, M:567803904, t:"59146D 5h"}, {w:2555379712, M:1135607808, t:"118292D 11h"}, {w:5110759424, M:2271215616, t:"236584D 23h"}, {w:10221518848, M:4542431232, t:"473169D 22h"}, {w:20443037696, M:9084862464, t:"946339D 20h"}, {w:40886075392, M:18169724928, t:"1892679D 16h"}, {w:81772150784, M:36339449856, t:"3785359D 8h"}, {w:163544301568, M:72678899712, t:"7570718D 17h"}, {w:327088603136, M:145357799424, t:"15141437D 10h"}, {w:654177206272, M:290715598848, t:"30282874D 21h"}, {w:1308354412544, M:581431197696, t:"60565749D 18h"}, {w:2616708825088, M:1162862395392, t:"121131499D 12h"}, {w:5233417650176, M:2325724790784, t:"242262999D 57m"}, {w:10466835300352, M:4651449581568, t:"484525998D 1h"}, {w:20933670600704, M:9302899163136, t:"969051996D 3h"}, {w:41867341201408, M:18605798326272, t:"1938103992D 7h"}], "workshop-army" : [{w:26, M:8, t:"18m 36s"}, {w:55, M:20, t:"33m 37s"}, {w:102, M:30, t:"52m 48s"}, {w:163, M:54, t:"1h 12m"}, {w:236, M:85, t:"1h 31m"}, {w:277, M:106, t:"1h 34m"}, {w:371, M:151, t:"1h 53m"}, {w:465, M:197, t:"2h 7m"}, {w:545, M:240, t:"2h 15m"}, {w:682, M:311, t:"2h 34m"}, {w:810, M:379, t:"2h 47m"}, {w:980, M:422, t:"3h 6m"}, {w:1037, M:460, t:"3h 2m"}, {w:1197, M:493, t:"3h 15m"}, {w:1509, M:640, t:"3h 28m"}, {w:1925, M:837, t:"3h 48m"}, {w:2352, M:1046, t:"4h 1m"}, {w:2672, M:1188, t:"4h 14m"}, {w:2883, M:1281, t:"4h 16m"}, {w:3089, M:1373, t:"4h 17m"}, {w:3305, M:1469, t:"4h 19m"}, {w:3913, M:1739, t:"4h 49m"}, {w:4233, M:1881, t:"4h 57m"}, {w:4563, M:2028, t:"5h 4m"}, {w:18252, M:8112, t:"20h 16m"}, {w:36504, M:16224, t:"1D 16h"}, {w:73008, M:32448, t:"3D 9h"}, {w:146016, M:64896, t:"6D 18h"}, {w:292032, M:129792, t:"13D 12h"}, {w:584064, M:259584, t:"27D 57m"}, {w:1168128, M:519168, t:"54D 1h"}, {w:2336256, M:1038336, t:"108D 3h"}], }; var unit_cost = { "unit slinger" : {p:1,w:40,b:"12m",u:8,m:1,o:4,a:7,d:7,A:2,D:2,s:10,c:"Human",v:20}, "unit swordsman" : {p:2,w:47,S:16,b:"17m",u:16,m:3,o:5,a:18,d:14,A:4,D:3,s:12,c:"Human",v:20,x:"Assault"}, "unit phalanx" : {p:4,w:104,S:64,b:"40m",u:24,m:4,o:7,a:24,d:40,A:6,D:10,s:14,c:"Human",v:20,x:"Resistance"}, "unit ram" : {p:8,w:198,S:128,b:"42m",u:52,m:5,o:8,a:14,d:18,A:3,D:4,s:16,c:"Machina",v:20,x:"Ram"}, "unit archer" : {p:4,w:172,S:86,b:"49m",u:32,m:7,o:10,a:40,d:40,A:10,D:10,s:12,c:"Human",v:20}, "unit catapult" : {p:10,w:342,S:232,b:"49m",u:72,m:10,o:14,a:36,d:28,A:9,D:7,s:16,c:"Machina",v:20,x:"Ram"}, "unit marksman" : {i:"marksman",p:7,w:355,S:154,b:"1h 23m",u:58,m:14,o:18,a:80,d:64,A:18,D:14,s:10,c:"Human",v:20}, "unit mortar" : {p:12,w:1325,S:938,b:"1h 53m",u:128,m:19,o:21,a:64,d:64,A:15,D:15,s:16,c:"Machina",v:20,x:"Ram"}, "unit steamgiant" : {i:"steamgiant",p:6,w:1150,S:716,b:"1h 45m",u:68,m:16,o:20,a:100,d:140,A:20,D:30,s:14,c:"Machina",v:20,x:"Resistance"}, "unit gyrocopter" : {p:8,w:1250,S:670,b:"1h 2m",u:97,m:12,o:16,a:112,d:112,A:25,D:25,s:12,c:"Machina",v:20}, "unit bombardier" : {p:24,w:2270,S:878,b:"2h 10m",u:228,m:22,o:24,a:200,d:165,A:45,D:35,s:14,c:"Machina",v:20,x:"Assault"}, "unit medic" : {i:"medic",p:6,w:640,C:361,b:"1h 2m",u:244,m:11,o:12,a:4,d:28,A:0,D:0,s:14,c:"Human",v:20,x:"Healer"}, "unit cook" : {p:4,w:520,W:103,b:"38m",u:138,m:8,o:8,a:6,d:26,A:0,D:0,s:16,c:"Human",v:20,x:"Regeneration"}, "unit ship_ram" : {p:6,w:56,S:21,b:"34m",u:20,m:1,o:3,a:16,d:16,A:4,D:4,s:10,c:"Sailer",v:10}, "unit ship_ballista" : {p:5,w:72,S:29,b:"47m",u:24,m:3,o:5,a:20,d:28,A:5,D:7,s:11,c:"Sailer",v:8,x:"Resistance"}, "unit ship_flamethrower" : {p:5,w:105,S:77,b:"1h 55m",u:45,m:5,o:7,a:40,d:40,A:10,D:10,s:12,c:"Steamship",v:8,x:"Assault"}, "unit ship_catapult" : {p:10,w:173,S:76,b:"3h 11m",u:57,m:7,o:10,a:60,d:60,A:12,D:12,s:16,c:"Sailer",v:6}, "unit ship_mortar" : {p:22,w:456,S:282,b:"3h 38m",u:130,m:12,o:15,a:160,d:160,A:35,D:35,s:14,c:"Steamship",v:4}, "unit ship_steamboat" : {i:"steamboat",p:12,w:513,S:167,b:"4h 8m",u:114,m:10,o:13,a:100,d:90,A:20,D:18,s:13,c:"Steamship",v:8,x:"Assault"}, "unit ship_submarine" : {i:"submarine",p:16,w:493,C:378,b:"5h 5m",u:126,m:15,o:16,a:110,d:155,A:20,D:30,s:10,c:"Steamship",v:2,x:"Resistance"}, }; var unitsAndShipsIndexes = { "unit slinger" : 0, "unit swordsman" : 1, "unit phalanx" : 2, "unit ram" : 3, "unit archer" : 4, "unit catapult" : 5, "unit marksman" : 6, "unit mortar" : 7, "unit steamgiant" : 8, "unit gyrocopter" : 9, "unit bombardier" : 10, "unit medic" : 11, "unit cook" : 12, "unit ship_ram" : 13, "unit ship_ballista" : 14, "unit ship_flamethrower" : 15, "unit ship_catapult" : 16, "unit ship_mortar" : 17, "unit ship_steamboat" : 18, "unit ship_submarine" : 19, }; var icons = { gold: "/skin/resources/icon_gold.gif", wood: "/skin/resources/icon_wood.gif", wine: "/skin/resources/icon_wine.gif", glass: "/skin/resources/icon_glass.gif", marble: "/skin/resources/icon_marble.gif", sulfur: "/skin/resources/icon_sulfur.gif", time: "/skin/resources/icon_time.gif", citizens: "/skin/resources/icon_citizen.gif", upkeep: "/skin/resources/icon_upkeep.gif", bulb: "/skin/layout/bulb-on.gif", attack: "/skin/layout/sword-icon-report.gif", defend: "/skin/layout/shield-icon-report.gif", speed: "data:image/gif;base64,R0lGODlhEgAUAOZjAK2hf8vBpploQpVWNX5tP8qqjotULE0mFNK6qJqMZYJTOE4wJHM/Id m8pPbx4d3UvGtCKm9PPmIwGZ5eQZCBWPru26SOfbadivHs2uPcx8ZxMrZnLrtpL6ZdK5t7SoJyRsyDTNlgHeB6MlE 3H3tfU6ZWJNxLC4gtB6lfK49iKVBGQKqZhnZkMu/p1o9EG6E4CnIqC5xXKaFaKpNlJPjy4jYoGm1XPYFvWoxNJTEP BoVLJXVXG3tpNmo5H1I9DZWHYJFkRmE1Hl40G4JTDr6CGvK6LczFre7m1uveyUMzGTMgDottUQ0KCG9UN/Dq3I VvUr25rnVjMrqzp7SRcpGDbbOPbHhxZufg0WlbQXpmVHZlNeXfyv7663JdSca7osS+seLczoyEe1NFLf///wAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAHoA2MALAAAAAASABQAAAeygGOCg4SFggCGiYQBiQIDiQSG BQYHCIYJiQoLDA2FDg+JEBESE4UUiRVjFgcXhBgZhhobHB0eCoQfhiAhIh0bIySDuYYlJicdKCkqK2MsLYkuLzAxMj M0NTY3ijg5Mjg6O4I8imM9OgwMPT5jP+RjQEFCQkNERUbuY0dISUo2S/iDlDAZ08QJvidLmECJImWKIipVllgRFGlM kiuJsGQZpGWLIC5dxngp9AWMojBiJhIKBAA7", }; var title_icons = { "unit slinger" : "/skin/characters/military/x40_y40/y40_slinger_faceright.gif", "unit swordsman" : "/skin/characters/military/x40_y40/y40_swordsman_faceright.gif", "unit phalanx" : "/skin/characters/military/x40_y40/y40_phalanx_faceright.gif", "unit ram" : "/skin/characters/military/x40_y40/y40_ram_faceright.gif", "unit archer" : "/skin/characters/military/x40_y40/y40_archer_faceright.gif", "unit catapult" : "/skin/characters/military/x40_y40/y40_catapult_faceright.gif", "unit marksman" : "/skin/characters/military/x40_y40/y40_marksman_faceright.gif", "unit mortar" : "/skin/characters/military/x40_y40/y40_mortar_faceright.gif", "unit steamgiant" : "/skin/characters/military/x40_y40/y40_steamgiant_faceright.gif", "unit gyrocopter" : "/skin/characters/military/x40_y40/y40_gyrocopter_faceright.gif", "unit bombardier" : "/skin/characters/military/x40_y40/y40_bombardier_faceright.gif", "unit medic" : "/skin/characters/military/x40_y40/y40_medic_faceright.gif", "unit cook" : "/skin/characters/military/x40_y40/y40_cook_faceright.gif", "unit ship_ram" : "/skin/characters/fleet/40x40/ship_ram_r_40x40.gif", "unit ship_ballista" : "/skin/characters/fleet/40x40/ship_ballista_r_40x40.gif", "unit ship_flamethrower" : "/skin/characters/fleet/40x40/ship_flamethrower_r_40x40.gif", "unit ship_catapult" : "/skin/characters/fleet/40x40/ship_catapult_r_40x40.gif", "unit ship_mortar" : "/skin/characters/fleet/40x40/ship_mortar_r_40x40.gif", "unit ship_steamboat" : "/skin/characters/fleet/40x40/ship_steamboat_r_40x40.gif", "unit ship_submarine" : "/skin/characters/fleet/40x40/ship_submarine_r_40x40.gif", "townHall" : "/skin/img/city/building_townhall.gif", "academy" : "/skin/img/city/building_academy.gif", "port" : "/skin/img/city/building_port.gif", "shipyard" : "/skin/img/city/building_shipyard.gif", "warehouse" : "/skin/img/city/building_warehouse.gif", "wall" : "/skin/img/city/building_wall.gif", "tavern" : "/skin/img/city/building_tavern.gif", "museum" : "/skin/img/city/building_museum.gif", "palace" : "/skin/img/city/building_palace.gif", "palaceColony" : "/skin/img/city/building_palaceColony.gif", "embassy" : "/skin/img/city/building_embassy.gif", "branchOffice" : "/skin/img/city/building_branchOffice.gif", "safehouse" : "/skin/img/city/building_safehouse.gif", "barracks" : "/skin/img/city/building_barracks.gif", "workshop-army" : "/skin/img/city/building_workshop.gif", } var unitsAndShipsIndexesR = getUnitsShipsIndexesR(); function getLocalizedTexts(lang) { switch (lang) { case "vn" : buildings = { "townHall" : ["tòa thị chính", "tòa thị chính"], "academy" : ["Học viện", "Học viện"], "port" : ["Cảng giao dịch", "Cảng giao dịch"], "shipyard" : ["Xưởng đóng tàu", "Xưởng đóng tàu"], "warehouse" : ["Kho hàng", "Kho hàng"], "wall" : ["Tường thành", "Tường thành"], "tavern" : ["Quán rượu", "Quán rượu"], "museum" : ["Viện bảo tàng", "Viện bảo tàng"], "palace" : ["Cung điện", "Cung điện"], "palaceColony" : ["Phủ thủ hiến", "Phủ thủ hiến"], "embassy" : ["Tòa Đại sứ", "Tòa Đại sứ"], "branchOffice" : ["Trạm giao dịch", "Trạm giao dịch"], "safehouse" : ["Nơi ẩn náu", "Nơi ẩn náu"], "barracks" : ["Trại lính", "Trại lính"], "workshop-army" : ["Xưởng", "Xưởng"], //"carpentering" : ["Thợ mộc", "Thợ mộc"], //"forester" : ["Kiểm lâm", "kiểm lâm"], //"stonemason" : ["Thợ đẽo đá", "Thợ đẽo đá"], //"glassblowing" : ["Thổi cốc", "Thổi cốc"], //"winegrower" : ["Trồng nho", "Trồng nho"], //"alchemist" : ["Luyện kim", "Luyện kim"], //"architect" : ["Kiến trúc sư", "Kiến trúc sư"], //"optician" : ["Nhà quang học", "Nhà quang học"], //"vineyard" : ["Vườn nho", "Vườn nho"], //"fireworker" : ["Công nhân", "Công nhân"], }; texts = { "cityName" : "Tên Thành phố", "ActionPoints" : "Điểm hoạt động", "Coordinate" : "Tọa độ ", "Population" : "Dân cư", "Incomegold" : "Vàng", "Corruption" : "Tham nhũng", "Woodworkers" : "Công nhân Gỗ", "Specialworkers" : "Công nhân Đặc biệt", "Resource" : "Tài nguyên", "wood" : "Gỗ", "wine" : "Rượu Nho", "marble" : "Cẩm Thạch", "crystal" : "Pha Lê", "sulfur" : "Lưu Huỳnh", "currentlyBuilding" : "Đang xây dựng", "summary" : "Tổng cộng:", "hide_settings" : "Ẩn tùy chỉnh", "show_settings" : "Hiện tùy chỉnh", "scienceReport" : "Kết quả nghiên cứu", "constructionLevel" : "Cấp độ học viện", "scientists" : "Nhà khoa học", "production" : "Thành quả", "costs" : "Tốn", "goTo" : "Chuyển đến ", "armyReport" : "Thông báo quân tình", "resourcesReport" : "Thông báo nguồn tài nguyên", "buildingsReport" : "Thông báo các tòa nhà", "transportReport" : "Thông báo giao thông vận tải", "m" : "phút", "h" : "giờ", "day" : "ngày", "hoursToFull" : "giờ để đầy", "hoursToEmpty" : "giờ để trống", "available" : "(sức chứa)", "fullness" : "đầy", "lastUpdate" : "Lần cập nhật cuối cùng", "appendDestn" : "Thêm vào điểm đến hữu ích", "removeDestn" : "Hủy bỏ điểm đến hữu ích", "appendDestnName" : "Đặt một tên cho liên kết các điểm đến", "removeDestnConfirm" : "Bạn có chắc chắn muốn xoá bỏ các điểm đến từ danh sách?", "addFavorites" : "Thêm vào yêu thích", "removeFavorites" : "Hủy bỏ yêu thích", "addFavoriteName" : "Đặt tên cho thành phố", "removeFavoriteConfirm" : "Bạn có chắc chắn muốn xoá %s từ danh sách favorties?", "NameLabelError" : "Tên được quy định là không hợp lệ, hãy thử lại", "RESET_DATA_CONFIRM" : "Bạn có chắc chắn muốn xoá Tất cả dữ liệu lưu trữ?", "RESET_PLAYERS_DATA" : "Bạn có chắc chắn muốn xoá Tất cả dữ liệu người chơi?", "PREMIUM_VIEW" : "Kiểu xem Premium", "ALERT_SOUNDS" : "Âm thanh cảnh báo", "ALERT_VOLUME" : "Âm lượng tới hạn", "WARNING_VOLUME" : "Âm lượng cảnh báo", "AUTO_REFRESH" : "Tự động làm mới", "AUTO_REFRESH_MIN_SECS" : "Tự động làm mới với thời gian tối thiểu", "AUTO_REFRESH_MAX_SECS" : "Tự động làm mới với thời gian tối đa", "TABLE_RESOURCES" : "Hiển thị bảng nguồn tài nguyên", "TABLE_CITIES" : "Hiển thị bảng thành phố", "TABLE_BUILDINGS" : "Hiển thị bảng xây dựng", "TABLE_ARMYFLEET" : "Hiển thị bảng quân và fleet", "TABLE_RESEARCH" : "Hiển thị bảng nghiên cứu", "TABLE_TRANSPORT" : "Hiển thị bảng giao thông vận tải", "TABLE_PLAYERS" : "Hiển thị bảng người chơi và thành phố", "TABLE_FAVORITES" : "Hiển thị bảng yêu thích của tôi", "TECH_LETTERCHUTE" : "Nghiên cứu xong Buồng thư?", "TECH_PULLEY" : "Nghiên cứu xong Ròng rọc?", "TECH_GEOMETRY" : "Nghiên cứu xong Hình học?", "TECH_SPIRITLEVEL" : "Nghiên cứu xong Thước thủy cân bằng?", "PLAYERS_NORMAL" : "Hiển thị người chơi bình thường", "PLAYERS_INACTIVITY" : "Hiển thị người chơi không hoạt động", "PLAYERS_BANNED" : "Hiển thị người chơi bị cấm", "PLAYERS_VACATION" : "Hiển thị người chơi nghỉ phép", "PROGRESS_BAR_MODE" : "Thanh kiểm tra tài nguyên", "SETTING_EXPANDED" : "Mở rộng các nguồn lực của giao thông vận tải tàu", "off" : "Tắt", "time" : "dựa trên thời gian còn lại", "percent" : "dựa trên tỷ lệ phần trăm đầy", "LANGUAGE" : "Ngôn ngữ", "LANGUAGE_AUTO" : "Tự động từ tên máy chủ", "ownAlly" : "Liên minh của bạn (tên ngắn)", "friendlyAllies" : "Liên minh liên kết (tên ngắn, cách nhau bằng dấu phẩy)", "hostileAllies" : "Liên minh thù địch (tên ngắn, cách nhau bằng dấu phẩy)", "DEBUG_LOG" : "Đăng nhập tin nhắn debug", "Refresh_table" : "Làm mới bảng", "Reset_all_data" : "Thiết lập lại tất cả các dữ liệu", "Reset_players_data" : "Thiết lập lại dữ liệu người chơi", "Players" : "Người chơi", "Alliance" : "Liên minh", "Score" : "Điểm", "StartCity" : "Thành phố bắt đầu", "DestinationCity" : "Thành phố đích", "Mission" : "Nhiệm vụ", "FinishTime" : "Thời gian kết thúc", "FinishResources" : "Khi tàu đến,nguồn lực này của thành phố sẽ là", "Point" : "Điểm", "Loading" : "Đang tải", "Wait" : "Đợi", "Remaining" : "Còn lại", "Upgrade" : "nâng cấp", "UpgradeConfirm" : "Bạn có chắc chắn rằng bạn muốn nâng cấp công trình trên?", "Level" : "Cấp", "Happiness" : "Hài lòng", "Growth" : "Tốc độ tăng trưởng", "FreeWorkers" : "Công nhân rảnh", "full" : "Đầy", "empty" : "Trống", "NewVersion" : "Có một phiên bản mới hơn của "+scriptname+"\n%s\nBấm OK nếu bạn muốn cập nhật ngay bây giờ", "Attack" : "Tấn công", "Action" : "Hành động", "Remark" : "Remark", "DeleteConfirm" : "Bạn có chắc chắn muốn xoá %s?", "ResourceNeeds" : "Nguồn tài nguyên cần thiết", "unitInfo" : "Thông tin Đơn vị",}; break; default : buildings = { "townHall" : ["Town Hall", "Town Hall"], "academy" : ["Academy", "Academy"], "port" : ["Trading Port", "Trading Port"], "shipyard" : ["Shipyard", "Shipyard"], "warehouse" : ["Warehouse", "Warehouse"], "wall" : ["Wall", "Wall"], "tavern" : ["Tavern", "Tavern"], "museum" : ["Museum", "Museum"], "palace" : ["Palace", "Palace"], "palaceColony" : ["Governor's Residence", "Governor"], "embassy" : ["Embassy", "Embassy"], "branchOffice" : ["Trading Post", "Trading Post"], "safehouse" : ["Hideout", "Hideout"], "barracks" : ["Barracks", "Barracks"], "workshop-army" : ["Workshop", "Workshop"], // "carpentering" : ["Carpenter", "Carpenter"], // "forester" : ["forester", "forester"], // "stonemason" : ["stonemason", "stonemason"], // "glassblowing" : ["glassblowing", "glassblowing"], // "winegrower" : ["winegrower", "winegrower"], // "alchemist" : ["alchemist", "alchemist"], // "architect" : ["architect", "architect"], // "optician" : ["optician", "optician"], // "vineyard" : ["vineyard", "vineyard"], // "fireworker" : ["fireworker", "fireworker"], }; texts = { "cityName" : "City name", "ActionPoints" : "Action Points", "Coordinate" : "Coordinate", "Population" : "Population", "Incomegold" : "Net gold", "Corruption" : "Corruption", "Woodworkers" : "Wood Workers", "Specialworkers" : "Speciald Workers", "Resource" : "Resource", "wood" : "wood", "wine" : "wine", "marble" : "marble", "crystal" : "crystal", "sulfur" : "sulfur", "currentlyBuilding" : "Currently building", "summary" : "Summary:", "hide_settings" : "Hide settings", "show_settings" : "Show settings", "scienceReport" : "Science Report", "constructionLevel" : "Construction Level", "scientists" : "Scientists", "production" : "Production", "costs" : "Costs", "goTo" : "Go to ", "armyReport" : "Army Report", "resourcesReport" : "Resources Report", "buildingsReport" : "Buildings Report", "transportReport" : "Transport Report", "m" : "m", "h" : "h", "day" : "day", "hoursToFull" : "hours to full", "hoursToEmpty" : "hours to empty", "available" : "available", "fullness" : "fullness", "lastUpdate" : "last update", "appendDestn" : "Append to usefull destinations", "removeDestn" : "Remove from usefull destinations", "appendDestnName" : "Type a name for the destination link", "removeDestnConfirm" : "Are you sure you want to remove the destination from the list?", "addFavorites" : "Add Favorites", "removeFavorites" : "Remove Favorites", "addFavoriteName" : "Type a name for the city", "removeFavoriteConfirm" : "Are you sure you want to remove %s from the favorties list?", "NameLabelError" : "The specified name is invalid, try again", "RESET_DATA_CONFIRM" : "Are you sure you want to delete ALL stored data?", "RESET_PLAYERS_CONFIRM" : "Are you sure you want to delete ALL players data?", "PREMIUM_VIEW" : "Premium view", "ALERT_SOUNDS" : "Alert sounds", "ALERT_VOLUME" : "Alert volume", "WARNING_VOLUME" : "Warning volume", "AUTO_REFRESH" : "Auto refresh", "AUTO_REFRESH_MIN_SECS" : "Auto refresh min seconds", "AUTO_REFRESH_MAX_SECS" : "Auto refresh max seconds", "TABLE_RESOURCES" : "Show resources table", "TABLE_CITIES" : "Show cities table", "TABLE_BUILDINGS" : "Show buildings table", "TABLE_ARMYFLEET" : "Show army and fleet table", "TABLE_RESEARCH" : "Show research table", "TABLE_TRANSPORT" : "Show transport table", "TABLE_PLAYERS" : "Show players and cities table", "TABLE_FAVORITES" : "Show my favorites table", "TECH_LETTERCHUTE" : "Finish Letter Chute?", "TECH_PULLEY" : "Finish Pulley?", "TECH_GEOMETRY" : "Finish Geometry?", "TECH_SPIRITLEVEL" : "Finish Spirit Level?", "PLAYERS_NORMAL" : "Show normal players", "PLAYERS_INACTIVITY" : "Show inactivity players", "PLAYERS_BANNED" : "Show banned players", "PLAYERS_VACATION" : "Show vacation players", "PROGRESS_BAR_MODE" : "Resource progress bar mode", "SETTING_EXPANDED" : "Expand the resources of transport ship", "off" : "off", "time" : "based on remaining time", "percent" : "based on fullness percentage", "LANGUAGE" : "Language", "LANGUAGE_AUTO" : "Automatic from server name", "ownAlly" : "Own alliance (short name)", "friendlyAllies" : "Friendly alliances (short names, separated by comma)", "hostileAllies" : "Hostile alliances (short names, separated by comma)", "DEBUG_LOG" : "Log debug messages", "Refresh_table" : "Refresh table", "Reset_all_data" : "Reset all data", "Reset_players_data" : "Reset players data", "Players" : "Players", "Alliance" : "Alliance", "Score" : "Score", "StartCity" : "Start City", "DestinationCity" : "Destination City", "Mission" : "Mission", "FinishTime" : "Finish Time", "FinishResources" : "When finish mission, the start city of resources", "Point" : "Point", "Loading" : "Loading", "Wait" : "Wait", "Remaining" : "Remaining", "Upgrade" : "Upgrade", "UpgradeConfirm" : "Are you sure you want to upgrade building?", "Level" : "Level", "Happiness" : "Satisfaction", "Growth" : "Growth", "FreeWorkers" : "Free workers", "full" : "full", "empty" : "empty", "NewVersion" : "There is a newer version of "+scriptname+"\n%s\nClick on OK if you would like to update now", "Attack" : "Attack", "Action" : "Action", "Remark" : "Remark", "DeleteConfirm" : "Are you sure you want to delete %s?", "ResourceNeeds" : "Resource Needs", "unitInfo" : "Unit Information", }; break; } } VersionUpdate(); var ALERT_SOUNDS = getCfgValue("ALERT_SOUNDS", false); //play sound when you are under attack, or you have undreaded message var AUTO_REFRESH = getCfgValue("AUTO_REFRESH", false); //automatically refreshes browser window (useful when ALERT_SOUNDS is true) var DEBUG_LOG = getCfgValue("DEBUG_LOG", false); //log debug messages to console var PROGRESS_BAR_MODE = getCfgValue("PROGRESS_BAR_MODE", "time"); //have to be a global variable var SETTING_EXPANDED = getCfgValue("SETTING_EXPANDED", true); var PREMIUM_VIEW = getCfgValue("PREMIUM_VIEW", false); var alertSound = [ "http://simplythebest.net/sounds/WAV/events_WAV/event_WAV_files/alarm_3.wav", "http://boxstr.com/files/4137377_atuik/alarm_3.wav" ]; var warningSound = [ "http://www.ilovewavs.com/Effects/Beeps/FlyinOff.wav", "http://boxstr.com/files/4137365_xsmmz/FlyinOff.wav" ]; var WARNING_VOLUME = getCfgValue("WARNING_VOLUME", "50"); // "0" = silent "100" = full volume var ALERT_VOLUME = getCfgValue("ALERT_VOLUME", "100"); // "0" = silent "100" = full volume var MIN = getCfgValue("AUTO_REFRESH_MIN_SECS", 300); // seconds var MAX = getCfgValue("AUTO_REFRESH_MAX_SECS", 600); // seconds var TECH_LETTERCHUTE = getCfgValue("TECH_LETTERCHUTE", false); var TECH_PULLEY = getCfgValue("TECH_PULLEY", false); var TECH_GEOMETRY = getCfgValue("TECH_GEOMETRY", false); var TECH_SPIRITLEVEL = getCfgValue("TECH_SPIRITLEVEL", false); var TABLE_FAVORITES = getCfgValue("TABLE_FAVORITES", false); var TABLE_PLAYERS = getCfgValue("TABLE_PLAYERS", false); if (ALERT_SOUNDS) { var resWarning = xpath("//a[contains(@class, 'normalactive')]"); var resAlert = xpath("//a[contains(@class, 'normalalert')]"); if (resAlert.snapshotLength > 0 && ALERT_VOLUME != 0) { playSound(alertSound[rand(0, alertSound.length-1)], ALERT_VOLUME); } else if (resWarning.snapshotLength > 0 && WARNING_VOLUME !=0) { playSound(warningSound[rand(0, warningSound.length-1)], WARNING_VOLUME); } } if (AUTO_REFRESH) { var cities = $x("//select[@id='citySelect']/option", $("citySelect")); var idx = $("citySelect").selectedIndex+1; idx %= cities.length; var city_id = $x("//select[@id='citySelect']/option", $("citySelect"))[idx].value; var strurl = postUrl("?action=header&function=changeCurrentCity&oldView=city&view=city&cityId="+ city_id); var timeID = setTimeout("location.href= '"+strurl+"'", getRefreshTime()); } if (PREMIUM_VIEW) { GM_addStyle("#advisors #advCities a.normal {background-image:url ('/skin/layout/advisors/mayor_premium.gif');}"); GM_addStyle("#advisors #advCities a.normalactive {background-image:url ('/skin/layout/advisors/mayor_premium_active.gif');}"); GM_addStyle("#advisors #advMilitary a.normal {background-image:url ('/skin/layout/advisors/general_premium.gif');}"); GM_addStyle("#advisors #advMilitary a.normalactive {background-image:url ('/skin/layout/advisors/general_premium_active.gif');}"); GM_addStyle("#advisors #advMilitary a.normalalert {background-image:url ('/skin/layout/advisors/general_premium_alert.gif');}"); GM_addStyle("#advisors #advResearch a.normal {background-image:url ('/skin/layout/advisors/scientist_premium.gif');}"); GM_addStyle("#advisors #advResearch a.normalactive {background-image:url ('/skin/layout/advisors/scientist_premium_active.gif');}"); GM_addStyle("#advisors #advDiplomacy a.normal {background-image:url ('/skin/layout/advisors/diplomat_premium.gif');}"); GM_addStyle("#advisors #advDiplomacy a.normalactive {background-image:url ('/skin/layout/advisors/diplomat_premium_active.gif');}"); } var city_id = getIntValue(getNode_value("//option[@class='avatarCities coords' and @selected='selected']"), 0); if (city_id == 0){ city_id = getIntValue(getNode_value("//option[@class='avatarCities' and @selected='selected']"), 0); } if (city_id == 0){ city_id = getIntValue(getNode_value("//option[@class='avatarCities tradegood1' and @selected='selected']"), 0); } if (city_id == 0){ city_id = getIntValue(getNode_value("//option[@class='avatarCities tradegood2' and @selected='selected']"), 0); } if (city_id == 0){ city_id = getIntValue(getNode_value("//option[@class='avatarCities tradegood3' and @selected='selected']"), 0); } if (city_id == 0){ city_id = getIntValue(getNode_value("//option[@class='avatarCities tradegood4' and @selected='selected']"), 0); } var city_name = getNodeValue("id('breadcrumbs')/*[@class='city']"); var island_coord = getNodeValue("id('breadcrumbs')//a[@class='island']"); if ( island_coord == undefined || island_coord == 0 ) island_coord = getNodeValue("id('breadcrumbs')//span[@class='island']"); if ( island_coord == undefined || island_coord == 0 ) { if (/(\[[0-9]+:[0-9]+\])/.exec(getNode("id('breadcrumbs')").innerHTML) != null) island_coord = RegExp.$1; } if ( island_coord == undefined || island_coord == 0 ) { var node = getNode("id('breadcrumbs')"); if (node!=null) { node = node.getElementsByTagName("a")[0]; if (node!=null) { var strhref = node.getAttribute("href"); if (/islandX=([0-9]+).+islandY=([0-9]+)/.exec(strhref) != null) island_coord = "["+RegExp.$1+":"+RegExp.$2+"]"; } } } if ( island_coord == undefined || island_coord == 0 ) { var idx = $("citySelect").selectedIndex; island_coord = $x("//option", $("citySelect"))[idx].title; } var city_idmainView = getNode_value("//option[@class='avatarCities coords' and text()='"+TrimIsland(island_coord)+" "+city_name+"']", 0); if (city_idmainView == 0){ city_idmainView = getNode_value("//option[@class='avatarCities' and text()=' "+city_name+"']", 0); } if (city_idmainView == 0){ city_idmainView = getNode_value("//option[@class='avatarCities tradegood1' and @selected='selected' and text() ='"+city_name+"']", 0); } if (city_idmainView == 0){ city_idmainView = getNode_value("//option[@class='avatarCities tradegood2' and @selected='selected' and text() ='"+city_name+"']", 0); } if (city_idmainView == 0){ city_idmainView = getNode_value("//option[@class='avatarCities tradegood3' and @selected='selected' and text() ='"+city_name+"']", 0); } if (city_idmainView == 0){ city_idmainView = getNode_value("//option[@class='avatarCities tradegood4' and @selected='selected' and text() ='"+city_name+"']", 0); } var city_coord_node = getNode("//div[@id='breadcrumbs']/*[@class='island' and contains(text(), '[')]", ""); log("city_coord_1:"+city_coord_node);//city_coord.innerHTML+" tag:"+city_coord.tagName+ " " + city_coord); if (city_coord_node == null) { city_coord_node = getNode("//a[contains(@href, '?view=island')]/span[contains(text(), '[')]", ""); if (city_coord_node != null) { city_coord_node = city_coord_node.parentNode; } } else { log("city_coord_1.1:"+city_coord_node.innerHTML+" tag:"+city_coord_node.tagName+ " " + city_coord_node); } log("city_coord_2:"+city_coord_node); var island_id = ""; var city_coord = ""; if (city_coord_node != null) { log("city_coord_2.1:"+city_coord_node.innerHTML+" tag:"+city_coord_node.tagName+ " " + city_coord_node); if (/(\[[0-9:]+\])/.exec(city_coord_node.innerHTML)) { city_coord = RegExp.$1; if (/[?&]id=([0-9]+)/.exec(city_coord_node.href) != null) { island_id = RegExp.$1; } } } log("city_coord_3:"+city_coord); log("island_id_3:"+island_id); if (island_id == "" && (/view=island&id=([0-9]+)/.exec(document.URL) != null)) { island_id = RegExp.$1; } var body_id = $X("//body").id; log("server:"+server+", language:"+language+", city_id:"+city_id+", city_idmainView:"+city_idmainView+", city_coord:"+city_coord+", island_id:"+island_id + ", city_name:"+city_name + ", bodyid:"+body_id); function getUnitsShipsIndexesR() { var ret = []; for(key in unitsAndShipsIndexes) { ret[unitsAndShipsIndexes[key]] = key; } return ret; } function getVar(varname, vardefault) { var res = GM_getValue(server+varname); if (res == undefined) { return vardefault; } return res; } function setVar(varname, varvalue) { GM_setValue(server+varname, varvalue); } function getCity(city_id) { city_id = "city_"+city_id; if (config[city_id] == undefined) { config[city_id] = new Resource(); } return config[city_id]; } function getPath(node) { if (node == null || node == undefined) { return "/"; } return getPath(node.parentNode) + "/" + node.nodeName + "["+node.id+"]"; } function getNode(path) { var value = xpath(path); log("path: "+path+", size:"+value.snapshotLength); if (value.snapshotLength == 1) { return value.snapshotItem(0); } for(var i = 0; i < value.snapshotLength; i++) { log(i+".: "+getPath(value.snapshotItem(i))); } return null; } function getNodeValue(path, defaultValue) { var value = getNode(path); if (value != null) { return value.textContent; } return defaultValue; } function getNode_value(path, defaultValue) { var value = getNode(path); if (value != null) { return value.value; } return defaultValue; } //get node's title attribute function getNodeTitle(path, defaultValue) { var value = getNode(path); if (value != null) { if (value.title != "" && value.title != undefined) return value.title; } return defaultValue; } function getIntValue(str, defaultValue) { var temp = ""+str; temp = temp.replace(/[^0-9]+/g, ""); temp = parseInt(temp); if (defaultValue != undefined && (temp == undefined || (""+temp == "NaN"))) { return defaultValue; } return temp; } function mynumberformat(num, alwaysShowSign) { var s = ""+Math.round(num); if (num == undefined || s == "NaN") { return "-"; } if (num == "?") { return num; } var negative = ""; if (s.substring(0, 1) == "-") { negative = "-"; s = s.substring(1); } else if (alwaysShowSign == true) { negative = "+"; } var i = s.length-3; while (i > 0) { s = s.substring(0, i) + "," + s.substring(i); i -= 3; } return negative + s; } var _cachedDecimalPoint = undefined; function getDecimalPoint() { //hack if (_cachedDecimalPoint == undefined) { _cachedDecimalPoint = new Number(1.5).toLocaleString().substring(1, 2); if (_cachedDecimalPoint == undefined || _cachedDecimalPoint == "") { _cachedDecimalPoint = ","; } } return _cachedDecimalPoint; } function floatFormat(num, fracdigits, alwaysShowSign) { var s = ""+num; if (num == "?") { return num; } var negative = ""; if (s.substring(0, 1) == "-") { negative = "-"; s = s.substring(1); } else if (alwaysShowSign == true) { negative = "+"; } var p = s.indexOf("."); if (p >= 0) { var i = s.substring(0, p); var frac = s.substring(p + 1, p + 1 + fracdigits); while (frac.length < fracdigits) { frac += "0"; } s = i + getDecimalPoint() + frac; } return negative + s; } function getDecl(variable, root) { variable = "var "+ variable; var tag = $X('//script[contains(.,"'+ variable +'")]', root); var js = new RegExp(variable +"\\s*=\\s*\\S*?(\\({.*?}\\))", "m"); var v = tag.innerHTML.replace(/\s+/g, " ").match(js); if (v) return eval(v[1]); } function digProducedResources(res, root) { var vWood = getDecl("woodCounter", root); var vTradegood = getDecl("tradegoodCounter", root); var sTradeGoodName = vTradegood.valueElem.split("value_")[1]; res.prodwood = parseFloat(vWood.production)*3600; res.prodwine = 0; res.prodmarble = 0; res.prodglass = 0; res.prodsulfur = 0; res.prodtime = ""+new Date().getTime(); sTradeGoodName =(sTradeGoodName == "crystal") ? "glass" : sTradeGoodName; res.type = sTradeGoodName; res["prod"+res.type] = parseFloat(vTradegood.production)*3600; } function getCurrentResourceAmount(currenttime, startTime, startAmount, factPerHour) { var elapsedhours = (currenttime - startTime) / 1000.0 / 3600.0; return Math.max(0, Math.floor(startAmount + elapsedhours * factPerHour)); } function TimeResourceCounter() { var currenttime = new Date().getTime(); var counters = xpath("//font[contains(@id, 'ResourceCounter')]"); for(var i=0; i < counters.snapshotLength; i++) { var c = counters.snapshotItem(i); if (c.color != "#ff0000") { var arr = c.lang.split(","); var startTime = arr[0]; var startAmount = parseFloat(arr[1]); var factPerHour = parseFloat(arr[2]); c.innerHTML = mynumberformat(getCurrentResourceAmount(currenttime, startTime, startAmount, factPerHour)); } } return (counters.snapshotLength > 0); } function createTooltipAttribute(tooltip, title) { if (tooltip == undefined || tooltip == "") { return ""; } if (title == undefined || title == "") { title = ""; } else title = ", TITLE, '"+title+"', TITLEALIGN , 'center', TITLEFONTCOLOR, '#542C0F'"; var html = "
"+tooltip+"
"; html = html.replace(/'/g, "\\'"); return "onmouseover=\"Tip('"+html+"', PADDING, 2, FADEIN, 500, FADEOUT, 500 "+title+");\""; } function createTooltip(content, tooltip, title) { if (tooltip == undefined || tooltip == "") { return content; } return "<font>"+content+""; } function createTransportLink(id, enabled) { var href = "?view=transport&destinationCityId="+id; enabled = (enabled==undefined || enabled==true) ? "" : "_disabled"; var img = createImg("/skin/actions/transport"+enabled+".gif", "", 16); return (enabled=="") ? createLink(img, href, "") : img; } function createPlunderLink(id, enabled) { var href = "?view=plunder&destinationCityId="+id; enabled = (enabled==undefined || enabled==true) ? "" : "_disabled"; var img = createImg("/skin/actions/plunder"+enabled+".gif", "", 16); return (enabled=="") ? createLink(img, href, "") : img; } function createBlockadeLink(id, enabled) { var href = "?view=blockade&destinationCityId="+id; enabled = (enabled==undefined || enabled==true) ? "" : "_disabled"; var img = createImg("/skin/actions/blockade"+enabled+".gif", "", 16); return (enabled=="") ? createLink(img, href, "") : img; } function createDefendCityLink(id, enabled) { var href = "?view=defendCity&destinationCityId="+id; enabled = (enabled==undefined || enabled==true) ? "" : "_disabled"; var img = createImg("/skin/actions/defend"+enabled+".gif", "", 16); return (enabled=="") ? createLink(img, href, "") : img; } function createDefendPortLink(id, enabled) { var href = "?view=defendPort&destinationCityId="+id; enabled = (enabled==undefined || enabled==true) ? "" : "_disabled"; var img = createImg("skin/actions/defend_port"+enabled+".gif", "", 16); return (enabled=="") ? createLink(img, href, "") : img; } function createSendSpyLink(id, island_id, enabled) { var href = "?view=sendSpy&destinationCityId="+id+"&islandId="+island_id; enabled = (enabled==undefined || enabled==true) ? "" : "_disabled"; var img = createImg("/skin/actions/espionage"+enabled+".gif", "", 16); return (enabled=="") ? createLink(img, href, "") : img; } function createDiplomacyLink(city_id, id, enabled) { var href = "?view=sendMessage&with="+city_id+"&destinationCityId="+id+"&oldView=island"; enabled = (enabled==undefined || enabled==true) ? "" : "_disabled"; var img = createImg("/skin/actions/diplomacy"+enabled+".gif", "", 16); return (enabled=="") ? createLink(img, href, "") : img; } function createDeploymentArmyLink(id, enabled) { var href = "?view=deployment&deploymentType=army&destinationCityId="+id; enabled = (enabled==undefined || enabled==true) ? "" : "_disabled"; var img = createImg("/skin/actions/move_army"+enabled+".gif", "", 16); return (enabled=="") ? createLink(img, href, "") : img; } function createDeploymentFleetLink(id, enabled) { var href = "?view=deployment&deploymentType=fleet&destinationCityId="+id; enabled = (enabled==undefined || enabled==true) ? "" : "_disabled"; var img = createImg("/skin/actions/move_fleet"+enabled+".gif", "", 16); return (enabled=="") ? createLink(img, href, "") : img; } function createImg(src, att, height, width) { if (height == undefined) height = ""; if (height != "") height = "height='"+height+"' "; if (width == undefined) width = ""; if (width != "") width = "width='"+width+"' "; if (att == undefined || att == "") att = ""; return ""; } function createCounter(startTime, startAmount, factPerHour, showTooltip, maxCapacity, plusText) { intfactPerHour = Math.round(factPerHour); var dailyFact = Math.round(24 * factPerHour); var tooltip = ""; if ((showTooltip == true) && (dailyFact != 0)) { tooltip = mynumberformat(intfactPerHour, true)+" / "+texts["h"]+", "+mynumberformat(dailyFact, true)+" / "+texts ["day"]; } var res; if (factPerHour != 0) { res = "<font>x</font>"; if (intfactPerHour > 0) { res = ""+res+""; } } else { res = mynumberformat(startAmount); } if (plusText != undefined) { res += plusText; } res = createTooltip(res, tooltip); //progress bar :) if ((PROGRESS_BAR_MODE != "off") && (maxCapacity > 0)) { var curres = getCurrentResourceAmount(new Date().getTime(), startTime, startAmount, factPerHour); var perc = Math.min(100, Math.round(curres / maxCapacity * 100.0)); var remaining = ""; var remhour = 100000000; if (factPerHour > 0) { remhour = (maxCapacity - curres) / factPerHour; remaining = "
"+texts["Remaining"]+" "+floatFormat(remhour, 1) + " " + texts["hoursToFull"]; } else if (factPerHour < 0) { remaining = "
"+texts["Remaining"]+" "+floatFormat(curres / -factPerHour, 1) + " " + texts["hoursToEmpty"]; } var cl = "myPercentNormal"; if (PROGRESS_BAR_MODE == "percent") { if (perc == 100) { cl = "myPercentFull"; } else if (perc > 95) { cl = "myPercentAlmostFull"; } else if (perc > 80) { cl = "myPercentWarning"; } } else if (PROGRESS_BAR_MODE == "time") { if (remhour == 0) { cl = "myPercentFull"; } else if (remhour < 16) { cl = "myPercentAlmostFull"; } else if (remhour < 24) { cl = "myPercentWarning"; } } else { log("ismeretlen progress bar mode: "+PROGRESS_BAR_MODE); } res += ""+ "
" + perc+"% "+texts["fullness"] + remaining)+">"+ ""+ ""+ ""+ "
"; } return res; } function twodigit(val) { val = val%100; if(val < 10) { return "0"+val; } return val; } function TimeCounter() { var currenttime = new Date().getTime(); var cs = xpath("//font[contains(@id, 'FinishCounter')]"); for (var i = 0; i < cs.snapshotLength; i++) { var c = cs.snapshotItem(i); var abstime = Math.round(c.lang); hdata = (abstime - currenttime) / 1000; if (hdata > 0) { var hday = Math.floor(hdata / 86400); var hhor = Math.floor((hdata - (hday * 86400)) / 3600); var hmin = Math.floor((hdata - (hday * 86400) - (hhor * 3600)) / 60); var hsec = Math.floor(hdata - (hday * 86400) - (hhor * 3600) - (hmin * 60)); var s = ""; var b = false; if (b || hday > 0) { s += hday+texts["day"]+" "; b = true; } b = true; if (b || hhor > 0) { s += hhor+":"; b = true; } if (b || hmin > 0) { s += twodigit(hmin)+":"; b = true; } if (b || hsec > 0) { s += twodigit(hsec)+""; b = true; } c.innerHTML = s; } else { c.innerHTML = "-"; } } } function getDuration(timeStr) { var s = strToDatetime(timeStr); var serverTime = strToDatetime(document.getElementById('servertime').innerHTML); var d = s - serverTime; if(d < -1) d += 86400 * 1000; return d; } function getLocalTime(milliseconds) { var currenttime = new Date().getTime(); return currenttime + milliseconds; } function createTimeCounter(enddate) { if (enddate != undefined && enddate != "") { var s = smartDateFormat(enddate); return createTooltip("<font></font>", s); } return ""; } function createProd(prodPerHour, extraTooltip) { if (""+prodPerHour == "" || ""+prodPerHour == "0" || prodPerHour == undefined || ""+prodPerHour == "NaN") { return ""; } var tooltip = mynumberformat(24 * prodPerHour, true)+" / "+texts["day"]; if (extraTooltip != undefined) { tooltip += ", "+extraTooltip; } return createTooltip(mynumberformat(prodPerHour, true), tooltip); } function serialize(txt) { return uneval(txt); //new version } function unserialize(txt){ if (txt.substr(0,1) == "(") { //new version return eval(txt); } var level=0,arrlen=new Array(),del=0,final=new Array(),key=new Array(),save=txt; while(1){ switch(txt.substr(0,1)){ case 'N': del = 2; ret = null; break; case 'b': del = txt.indexOf(';')+1; ret = (txt.substring(2,del-1) == '1')?true:false; break; case 'i': del = txt.indexOf(';')+1; ret = Number(txt.substring(2,del-1)); break; case 'd': del = txt.indexOf(';')+1; ret = Number(txt.substring(2,del-1)); break; case 's': del = txt.substr(2,txt.substr(2).indexOf(':')); ret = txt.substr( 1+txt.indexOf('"'),del); del = txt.indexOf('"')+ 1 + ret.length + 2; break; case 'a': del = txt.indexOf(':{')+2; ret = new Object(); arrlen[level+1] = Number(txt.substring(txt.indexOf(':')+1, del-2))*2; break; case 'O': txt = txt.substr(2); var tmp = txt.indexOf(':"')+2; var nlen = Number(txt.substring(0, txt.indexOf(':'))); name = txt.substring(tmp, tmp+nlen ); //log(name); txt = txt.substring(tmp+nlen+2); del = txt.indexOf(':{')+2; ret = new Object(); arrlen[level+1] = Number(txt.substring(0, del-2))*2; break; case '}': txt = txt.substr(1); if(arrlen[level] != 0){log('var missed : '+save); return undefined;}; //log(arrlen[level]); level--; continue; default: if(level==0) return final; log('syntax invalid(1) : '+save+"\nat\n"+txt+"level is at "+level); return undefined; } if(arrlen[level]%2 == 0){ if(typeof(ret) == 'object'){log('array index object no accepted : '+save);return undefined;} if(ret == undefined){log('syntax invalid(2) : '+save);return undefined;} key[level] = ret; } else { var ev = ''; for(var i=1;i<=level;i++){ if(typeof(key[i]) == 'number'){ ev += '['+key[i]+']'; }else{ ev += '["'+key[i]+'"]'; } } eval('final'+ev+'= ret;'); } arrlen[level]--;//log(arrlen[level]-1); if(typeof(ret) == 'object') level++; txt = txt.substr(del); continue; } } function getArrValue(arr, key, defaultValue) { if (arr == undefined || arr[key] == undefined) { return defaultValue; } return arr[key]; } function url(query) { return (location.search || "").replace(/([#?].*)?$/, query||""); } function $x( xpath, root ) { var doc = root ? root.evaluate ? root : root.ownerDocument : document, next; var got = doc.evaluate( xpath, root||doc, null, 0, null ), result = []; switch (got.resultType) { case got.STRING_TYPE: return got.stringValue; case got.NUMBER_TYPE: return got.numberValue; case got.BOOLEAN_TYPE: return got.booleanValue; default: while (next = got.iterateNext()) result.push( next ); return result; } } function $X( xpath, root ) { var got = $x( xpath, root ); return got instanceof Array ? got[0] : got; } function postWrap(url) { var get = urlParse(null, url); if (!get.action) return url; var cookie = $X('id("changeCityForm")//input[@name="actionRequest"]'); if (cookie) get.actionRequest = cookie.value; return postUrlTo(url.replace(/\?.*|$/, "/index.php"), get); } function postUrlTo(url, postvars) { if (!/^http/i.test( url )) url = location.protocol +"//"+ location.host + url; var form = <form>; for (var v in postvars) form.* += <input>; var body = <body>{ form }</body>; return "data:text/html,"+ encodeURIComponent(body.toXMLString()); } function createLink(text, href, attrs) { return " 0) { var t = getOnePeopleGrowthTime(happiness); // log(population+", "+startTime+", "+currenttime+", "+happiness+", t: "+t); if (t == "NaN" || startTime + t > currenttime) { break; } population++; happiness--; startTime += t; } return population; } function getGrowthRemainingHours(population, maxPopulation, startTime, happiness) { if (maxPopulation - population > happiness) { return "∞ "+texts["h"]; } var time = Number(startTime); while (population < maxPopulation) { var t = getOnePeopleGrowthTime(happiness); if (t == "NaN") { return "∞ "+texts["h"]; } time += t; population++; happiness--; } return floatFormat((time - Number(startTime)) / 1000 / 3600, 1) + " " + texts["h"]; } function smartDateFormat(time, showElapsedTime, elapsedTimeSeparator) { if (showElapsedTime != true) { showElapsedTime = false; } if (elapsedTimeSeparator == undefined) { elapsedTimeSeparator = ","; } var s = new Date(); s.setTime(time); var now = new Date(); var t = twodigit(s.getHours())+":"+twodigit(s.getMinutes())+":"+twodigit(s.getSeconds()); if (now.getYear() != s.getYear() || now.getMonth() != s.getMonth() || now.getDate() != s.getDate()) { t = s.getFullYear()+"/"+twodigit(s.getMonth()+1)+"/"+twodigit(s.getDate())+" "+ t } if (showElapsedTime) { t += elapsedTimeSeparator; var d = (now.getTime() - s.getTime()) / 1000; if (d < 3600) { t += " " + Math.floor(d / 60) + texts["m"]; } else { if (d >= 86400) { t += " " + Math.floor(d / 86400) + texts["day"]; } t += " " + floatFormat((d % 86400) / 3600, 1) + texts["h"]; } } return t; } function createLastUpdateAsTooltip(content, actionsName, time) { return createTooltip(content, actionsName+" ("+texts["lastUpdate"]+" "+smartDateFormat(time, true)+")"); } function Resource() { // this.city_coord = city_coord; this.type = ""; this.gold = "?"; this.corruption = "?"; this.wood = 0; this.wine = 0; this.marble = 0; this.glass = 0; this.sulfur = 0; this.underConstruction = "-"; this.actions = "?"; this.population = "?"; this.freeworkers = "?"; this.woodworkers = "?"; this.specialworkers = "?"; this.spy = "?"; this.scientists = "?"; this.efficiency = "?"; this.happiness = "?"; this.bonusspace = "?"; this.woodlevel = "?"; this.tradegoodlevel = "?"; this.buildings = {}; this.units = {}; } log("time0: "+(new Date().getTime() - _startTime)+" msec"); var res = getCity(city_id); res.wood = getIntValue(getNodeValue("id('value_wood')")); res.wine = getIntValue(getNodeValue("id('value_wine')")); res.marble = getIntValue(getNodeValue("id('value_marble')")); res.glass = getIntValue(getNodeValue("id('value_crystal')")); res.sulfur = getIntValue(getNodeValue("id('value_sulfur')")); digProducedResources(res); var strpopulation = getNodeValue("//span[@id='value_inhabitants']"); if (/\(([0-9,.]+)/.exec(strpopulation) != null) { res.population = getIntValue(strpopulation.match(/\(([\d,.]+)/)[1]); res.freeworkers = getIntValue(strpopulation.match(/^[\d,.]+/)[0]); } else { res.population = 0; } res.actions = getNodeValue("//span[@id='value_maxActionPoints']"); if (city_idmainView > 0) { var res = getCity(city_idmainView); log("res.city_coord:"+city_coord); if (city_coord != "") { res.city_coord = city_coord; } if (island_id != "") { res.island_id = island_id; } var node = $x("//div[@class='constructionSite']/following-sibling::a[contains(@href, 'view=')]"); if (node.length == 1) { res.underConstruction = node[0].title; res.underConstructionName = node[0].parentNode.getAttribute("class"); var script = node[0].parentNode.getElementsByTagName("script")[0]; if (script != undefined) { var enddate = 0; var currentdate = 0; if (/enddate[^0-9]*([0-9]+)/.exec(script.innerHTML) != null) { enddate = parseFloat(RegExp.$1) * 1000; } if (/currentdate[^0-9]*([0-9]+)/.exec(script.innerHTML) != null) { currentdate = parseFloat(RegExp.$1) * 1000; } if (enddate != 0 && currentdate != 0) { res.underConstruction += ","+(enddate - currentdate + new Date().getTime ()); } } } else if ( node.length > 1) { console.log("Construction Site error"); } else { var cityView = $x("//li[@id='position0']"); if (cityView.length > 0) { res.underConstruction = "-"; res.underConstructionName = ""; } } var nodes = xpath("//li[contains(@id, 'position')]/a[contains(@href, 'view=')]"); if (nodes.snapshotLength > 0) { for (var name in res.buildings) { res.buildings[name].exist = false; } for(var i = 0; i < nodes.snapshotLength; i++) { var node = nodes.snapshotItem(i); var li = node.parentNode; var level = "-"; if (/([0-9]+)/.exec(node.title) != null) { level = RegExp.$1; } var name = li.getAttribute("class"); if (buildings[name] != undefined) { if (res.buildings[name] == undefined) { res.buildings[name] = {}; } res.buildings[name].level = level; res.buildings[name].link = node.href; res.buildings[name].position = /position=([0-9]+)/.exec(node.href)[1]; res.buildings[name].exist = true; } } // 將不存在的建築物資料刪除掉 for (var name in res.buildings) { if (res.buildings[name].exist == false) { delete res.buildings[name]; } } } //townhall population total and growth if (/view=townHall/.test(document.URL)) { updatetownHall(res); } //military-army and fleet unit counts if (/view=cityMilitary-(army|fleet)/.exec(document.URL) != null) { var k = RegExp.$1; var tab = (k == "army") ? "tab1" : "tab2"; var idx = (k == "fleet") ? 13 : 0; if (config["unitnames"] == undefined) { config["unitnames"] = {}; } if (res.units == undefined) { res.units = {}; } var names = xpath("//div[@id='"+tab+"']//table/tbody/tr/th"); var counts = xpath("//div[@id='"+tab+"']//table/tbody/tr[@class='count']/td"); if (names.snapshotLength == counts.snapshotLength) { for(var i = 0; i < names.snapshotLength; i++) { var n = names.snapshotItem(i).title; var unit_id = unitsAndShipsIndexesR[i + idx]; config["unitnames"][unit_id] = n; var c = counts.snapshotItem(i); var cnt = getIntValue(c.innerHTML, 0); if (res.units[unit_id] == undefined) { res.units[unit_id] = {}; } res.units[unit_id].count = cnt; } } } //military-army unit counts if (/view=(barracks|shipyard)/.exec(document.URL) != null) { updateArmyFleet(res, RegExp.$1); } //safehouse if (/view=safehouse/.exec(document.URL) != null) { if(body_id=="safehouse") { updateHideout(res); } } if(/view=academy/.test(document.URL)||/index\.php/.test(document.URL)) { function storeResearchStatic() { try { var scientists = document.getElementById("inputScientists").value; var n = document.getElementById("valueResearch").innerHTML; n = n.substring(1, n.length); var city_id = getNode_value("//form[@id='setScientists']//input[@type='hidden' and @name='cityId']"); var res = getCity(city_id); res.scientists = scientists; res.efficiency = n; setVar("config", serialize(config)); } catch (e) { log("academy: "+e); } } try { var body_id = document.getElementsByTagName("body")[0].id; if(body_id=="academy") { var n = getNode("//form[@id='setScientists']//*[@type='submit']"); n.addEventListener("click", storeResearchStatic, false); var scientists = document.getElementById("inputScientists").value; var n = document.getElementById("valueResearch").innerHTML; n = n.substring(1, n.length); res.scientists = scientists; res.efficiency = n; } } catch (e) { } } if (/view=tavern/.test(document.URL)) { function storeWineUsage() { try { var n = document.getElementById("wineAmount"); var city_id = getNode_value("//form[@id='wineAssignForm']/input[@type='hidden' and @name='id']"); var city = getCity(city_id); city.wineUsage = tavernWineUsage[n.selectedIndex]; setVar("config", serialize(config)); } catch (e) { log("Hiba: "+e); } } var n = getNode("//form[@id='wineAssignForm']//*[@type='submit']"); n.addEventListener("click", storeWineUsage, false); var n = document.getElementById("wineAmount"); res.wineUsage = tavernWineUsage[n.selectedIndex]; } //az upgrade-et leolvassa az upgrade oldalról is if (true) { var n = getNode("//*[@id='buildingUpgrade']//*[@class='buildingLevel']"); if (n != null) { var buildingName = getNode("//body"); //a body.id tartalmazza az aktuálisan nézett épület azonosítóját if (buildingName != null) { var script = n.parentNode.getElementsByTagName("script")[0]; if (script != undefined) { var enddate = 0; var currentdate = 0; if (/enddate[^0-9]*([0-9]+)/.exec(script.innerHTML) != null) { enddate = parseFloat(RegExp.$1) * 1000; //millisecundumban az építési id? vége } if (/currentdate[^0-9]*([0-9]+)/.exec(script.innerHTML) != null) { currentdate = parseFloat(RegExp.$1) * 1000; //millisecundumban az aktuális id?pont } if (enddate != 0 && currentdate != 0) { res.underConstruction = buildings[buildingName.id][0] + " " + (n.innerHTML.replace(/<[^>]*>/g, "")); res.underConstructionName = buildingName.id; res.underConstruction += ","+(enddate - currentdate + new Date().getTime()); } } } } } //add destination to port view //if(/view=port/.test(document.URL)||/index\.php/.test(document.URL)) { if(/view=port/.test(document.URL)) { if(body_id=="port") { updatePort(res); } } } else { if (/view=merchantNavy/.test(document.URL) || body_id == "merchantNavy") { if (SETTING_EXPANDED) { var item = $x("//div[@id='mainview']//div[@id='plunderingTransports' or @class='contentBox']//div[@class='pulldown']//div[@class='content']"); for(var i=0; i<item>< res.snapshotLength; i++) { var n = res.snapshotItem(i); var tr = n.parentNode; if (tr != undefined && tr != null) { tr.setAttribute("class", colorClass+" "+tr.getAttribute("class")); } else { log("tr is undefined! n: "+n); } } } } if (ownAlly != "" || friendlyAllies.length > 0 || hostileAllies.length > 0) { displayHighscoreColor(ownAlly, "hs_ownally"); for(var i = 0; i < friendlyAllies.length; i++) { displayHighscoreColor(friendlyAllies[i], "hs_friendlyally"); } for(var i = 0; i < hostileAllies.length; i++) { displayHighscoreColor(hostileAllies[i], "hs_hostileally"); } //set form's method to "get", to work in other pages as well var forms = document.getElementsByTagName("form"); for(var i = 0; i < forms.length; i++) { var form = forms[i]; if (form != null) { form.method = "get"; } } } } //add a button to transport page so we can store theses links if(/view=transport/.test(document.URL)) { function saveDestination() { var destId = getNode_value("//form[@id='transport']/input[@type='hidden' and @name='destinationCityId']"); var destName = getNodeValue("//div[@class='journeyTarget']/text()"); var journeyTime = getNodeValue("//div[@class='journeyTime']/text()"); if(destName.indexOf(" — ")>0) destName = destName.substring(0, destName.indexOf(" — ")); if((journeyTime.indexOf(" + ") > 0) && (journeyTime.indexOf(" = ") > 0)) journeyTime = journeyTime.substring(journeyTime.indexOf(" + ") + 3, journeyTime.indexOf(" = ")); var addname = prompt(texts["appendDestnName"],destName+"["+journeyTime+"]"); if((addname.length == 0) || (addname.search(/\|/) != -1) || (addname.search(/;/) != -1)) { alert(texts["NameLabelError"]); exit; } var addlocation = window.location; if(config["destinations"][destId] == undefined) config["destinations"][destId] = {}; config["destinations"][destId].link = addlocation+""; config["destinations"][destId].name = addname; setVar("config", serialize(config)); location.replace(window.location); } function removeDestination() { var destId = getNode_value("//form[@id='transport']/input[@type='hidden' and @name='destinationCityId']"); if(confirm(texts["removeDestnConfirm"])) if(config["destinations"][destId] != undefined) delete config["destinations"][destId]; setVar("config", serialize(config)); location.replace(window.location); } try { var body_id = document.getElementsByTagName("body")[0].id; if(body_id="transport") { //var t = document.getElementById('colonizeBtn').parentNode; var t = document.getElementById('missionSummary').parentNode; if (config["destinations"] == undefined) { config["destinations"] = {}; } var destId = getNode_value("//form[@id='transport']/input[@type='hidden' and @name='destinationCityId']"); if(config["destinations"][destId] == undefined) { //save button var n = document.createElement('input'); n.type = "button"; n.value = texts["appendDestn"]; n.setAttribute("class", "button"); n.addEventListener("click", saveDestination, false); t.appendChild(n); } else { //remove button var n = document.createElement('input'); n.type = "button"; n.value = texts["removeDestn"]; n.setAttribute("class", "button"); n.addEventListener("click", removeDestination, false); t.appendChild(n); } } } catch (e) { GM_log(e); } } } function remove_favorites(e) { var obj = e.srcElement ? e.srcElement:e.target; var destid = obj.getAttribute("destid"); var playername = obj.getAttribute("playername"); if(config["myfavorites"][playername] != undefined) { var cityname = config["myfavorites"][playername].city[destid].cityname; if(confirm(texts["removeFavoriteConfirm"].replace(/%s/, playername+" ["+cityname+"]"))) { delete config["myfavorites"][playername].city[destid]; var count=0; for(key in config["myfavorites"][playername].city) count++; if (count==0) delete config["myfavorites"][playername]; saveConfig(); renderTables(); if (obj.tagName=="A") location.replace(window.location); } } } if(/view=island/.test(document.URL) || body_id == "island") { function add_favorites(e) { var destid = e.target.getAttribute("destid"); var cityname = e.target.getAttribute("cityname"); var playername = e.target.getAttribute("playername"); var island_id = $X("//div[@id='cityNav']//input[@name='id']").value; var addname = prompt(texts["addFavoriteName"], playername+" ["+cityname+"]"); if (addname == null) return; if((addname.length == 0) || (addname.search(/\|/) != -1) || (addname.search(/;/) != -1)) { alert(texts["NameLabelError"]); return; } if(config["myfavorites"][playername] == undefined) { config["myfavorites"][playername] = {}; config["myfavorites"][playername].city = {}; config["myfavorites"][playername].order = 0; } config["myfavorites"][playername].city[destid] = { "cityname": cityname, "addname": addname, "island_id":island_id, "coord": city_coord}; saveConfig(); location.replace(window.location); } function add_favorites_button(e) { var t = $X("//div[@id='information']/ul[@class='cityinfo']"); var cityname = $X("//div[@id='information']/ul[@class='cityinfo']/li[@class='name']"); cityname = cityname.childNodes[1].textContent.Trim(); var playername = $X("//div[@id='information']/ul[@class='cityinfo']/li[@class='owner']"); playername = playername.childNodes[1].textContent.Trim(); var destid = e.target.id.replace(/city_/,""); var n = document.createElement('a'); n.textContent = texts["addFavorites"]; n.href = "#"; n.setAttribute("class", "button"); n.setAttribute("style", "margin: 10px auto;"); n.setAttribute("destid", destid); n.setAttribute("cityname", cityname); n.setAttribute("playername", playername); n.addEventListener("click", add_favorites, false); t.appendChild(n); } function remove_favorites_button(e) { var t = $X("//div[@id='information']/ul[@class='cityinfo']"); var destid = e.target.id.replace(/city_/,""); var playername = $X("//div[@id='information']/ul[@class='cityinfo']/li[@class='owner']"); playername = playername.childNodes[1].textContent.Trim(); var n = document.createElement('a'); n.textContent = texts["removeFavorites"]; n.href = "#"; n.setAttribute("class", "button"); n.setAttribute("style", "margin: 10px auto;"); n.setAttribute("destid", destid); n.setAttribute("playername", playername); n.addEventListener("click", remove_favorites, false); t.appendChild(n); } var id = urlParse("id"); if (res.island_id == island_id) { var wood = $X("id('islandfeatures')/li[contains(@class,'wood level')]"); res.woodlevel = wood.className.replace(/[^\d.-]+/g, ""); var tradegood = $X("id('islandfeatures')/li[not(contains(@class, 'wood')) and not(@id)]"); res.tradegoodlevel = tradegood.className.replace(/[^\d.-]+/g, ""); } if (TABLE_FAVORITES) { if (config["myfavorites"] == undefined) { config["myfavorites"] = {}; } } if (TABLE_FAVORITES || TABLE_PLAYERS) { var cities = $x("//li[contains(@id, 'cityLocation')]/ul[@class='cityinfo']"); for (var i=0; i<cities>< infos.length; j++) { var info = infos[j]; var s = info.innerHTML.TrimHTML(); var arr = s.split(":"); if (arr.length > 1) { var key = arr[0].Trim(); var value = arr[1].Trim(); data[j] = value; } } var playername = data[2]; if (destid > 0) { try { players.playersCities[players.cities[destid][2]].cities[destid] = false; } catch (e) { } if (players.playersCities[playername] == undefined) { players.playersCities[playername] = new Object(); } if (players.playersCities[playername].cities == undefined) { players.playersCities[playername].cities = new Object(); } players.playersCities[playername].cities[destid] = true; players.playersCities[playername].alliance = data[4]; players.playersCities[playername].score = data[3]; players.playersCities[playername].citystatus = citystatus; players.cities[destid] = {name: data[0], size: data[1], player: playername, island_id: island_id}; players.islands[island_id] = {coord: city_coord}; } } } } } function getActionCode(root) { return $X("//form[@id='changeCityForm']//input[@type='hidden' and @name='actionRequest']" ,root).value; } /************************************************************************************************** * Render tables *************************************************************************************************/ function renderTables() { language = setLanguage(); getLocalizedTexts(language); var TABLE_CITIES = getCfgValue("TABLE_CITIES", true); var TABLE_RESOURCES = getCfgValue("TABLE_RESOURCES", true); var TABLE_BUILDINGS = getCfgValue("TABLE_BUILDINGS", true); var TABLE_ARMYFLEET = getCfgValue("TABLE_ARMYFLEET", true); var PLAYERS_NORMAL = getCfgValue("PLAYERS_NORMAL", true); var PLAYERS_INACTIVITY = getCfgValue("PLAYERS_INACTIVITY", true); var PLAYERS_BANNED = getCfgValue("PLAYERS_BANNED", true); var PLAYERS_VACATION = getCfgValue("PLAYERS_VACATION", true); var TABLE_RESEARCH = getCfgValue("TABLE_RESEARCH", true); var TABLE_TRANSPORTERS = getCfgValue("TABLE_TRANSPORTERS", true); PROGRESS_BAR_MODE = getCfgValue("PROGRESS_BAR_MODE", "time"); SETTING_EXPANDED = getCfgValue("SETTING_EXPANDED", true); TABLE_FAVORITES = getCfgValue("TABLE_FAVORITES", false); TABLE_PLAYERS = getCfgValue("TABLE_PLAYERS", false); GM_addStyle(getCfgValueNonEmpty("CSS", default_style)); var nodes = xpath("//select[@id='citySelect']/option"); //cities var s = ""; log("TABLE: "+(new Date().getTime() - _startTime)+" msec"); if (TABLE_CITIES) { s += ""; s += ""; s += ""; s += ""; s += ""; s += ""; s += ""; s += ""; s += ""; s += ""; s += ""; s += ""; s += ""; s += ""; s += ""; s += ""; // s += ""; s += ""; s += ""; var sumres = {}; var currenttime = new Date().getTime(); for(var i = 0; i < nodes.snapshotLength; i++) { var city = nodes.snapshotItem(i); var res = getCity(city.value); var happiness = res.happiness; var population = res.population; var bonusspace = res.bonusspace; var townHallLevel = getArrValue(res.buildings["townHall"], "level", "-"); var spacetotal = townHallSpaces[townHallLevel]; if (happiness != "?") { population = getEstimatedPopulation(population, res.prodtime, currenttime, happiness - population); if (parseInt(population) > parseInt(spacetotal) + parseInt(bonusspace)) { population = parseInt(spacetotal) + parseInt(bonusspace); } happiness -= population; } var growthRemainingHours = "∞ "+texts["h"]; var growth = (happiness != "?") ? floatFormat(0.02 * happiness, 2, true) : "?"; if (happiness != "?" && happiness > 0 && bonusspace != "?") { growthRemainingHours = getGrowthRemainingHours(population, parseInt (spacetotal) + parseInt(bonusspace), currenttime, happiness); } var townHallStyle = ""; if (parseInt(population) >= parseInt(spacetotal) + parseInt(bonusspace)) { townHallStyle = " populationfull"; } else { log("population is less than spacetotal "+population+" < "+(parseInt (spacetotal) + parseInt(bonusspace))); } sumres.population += population; //sumspacetotal += parseInt(spacetotal) + parseInt(bonusspace); var cs = ""; var lfcs = langtype; if (parseInt(city_id) == parseInt(city.value)) { cs += " current_city_highlight"; lfcs += " current_city_highlight"; } var spacetotal_title = ""; if (bonusspace != "?") { spacetotal_title = mynumberformat(parseInt(spacetotal) + parseInt (bonusspace))+ " ("+mynumberformat(spacetotal) + "+" + mynumberformat(bonusspace)+")"; } else { spacetotal_title = mynumberformat(spacetotal) + " + ?"; } var strhappiness = "("+texts["Happiness"]+":"+happiness+" "+texts["Growth"] +":"+growth+" "+texts["full"]+":"+growthRemainingHours+")"; var arr = res.underConstruction.split(","); var underConstruction = arr[0]; var counter = createTimeCounter(arr[1]); s += ""; s += ""; s += ""; s += ""; s += ""; s += ""; s += ""; s += ""; s += ""; s += ""; s += ""; s += ""; s += ""; s += ""; s += ""; s += ""; s += ""; s += ""; s += ""; s += ""; } s += "
"+texts["cityName"]+""+texts["Coordinate"]+""+texts["Resource"]+""+texts["ActionPoints"]+""+texts["Population"]+""+texts["FreeWorkers"]+""+texts["Woodworkers"]+""+texts["Specialworkers"]+""+texts["spy"]+""+texts["scientists"]+""+texts["Happiness"]+""+texts["Growth"]+""+texts["Incomegold"]+""+texts["Corruption"]+""+texts["Action"]+""+texts["currentlyBuilding"]+"
"+createLinkToCity(getCityName(city.innerHTML), city.value, i)+""+createLinkToForeignCity(res.city_coord, res.island_id, city.value)+""; s += createLinkToResource(createImg(icons["wood"], "", 16), res.island_id, city.value, i)+" "; s += createLinkToResource(res.woodlevel, res.island_id, city.value, i); s += ""; s += createLinkToTradegoodCond(true, createImg(icons[res.type], "", 16), res.island_id, city.value, i)+" "; s += createLinkToTradegoodCond(true, res.tradegoodlevel, res.island_id, city.value, i); s += ""+createLastUpdateAsTooltip(res.actions, texts ["ActionPoints"], res.prodtime)+""+createTooltip(mynumberformat(population), "Max:"+spacetotal_title)+""+mynumberformat(parseInt(spacetotal) + parseInt(bonusspace))+""+createTooltip(res.freeworkers, texts ["FreeWorkers"]+strhappiness)+""+createTooltip(res.woodworkers, texts["Woodworkers"]) +""+createTooltip(res.specialworkers, texts["Specialworkers"]) +""+createTooltip(res.spy, texts["spy"])+""+createTooltip(res.scientists, texts["scientists"])+""+createTooltip(happiness, texts["Happiness"])+""+createTooltip(growth, growthRemainingHours)+""+res.gold+""+res.corruption+""+underConstruction+""+counter+"
"; s += "
"; } log("TABLE_CITIES: "+(new Date().getTime() - _startTime)+" msec"); if (TABLE_RESOURCES) { var sumspacetotal = 0; s += ""; s += ""; s += ""; s += ""; s += ""; s += ""; s += ""; s += ""; //s += ""; s += ""; s += ""; var sumres = new Resource(""); var sumProd = new Resource(""); sumProd.wineUsage = 0; var currenttime = new Date().getTime(); for(var i = 0; i < nodes.snapshotLength; i++) { var city = nodes.snapshotItem(i); var res = getCity(city.value); var wineUsage; if (res.wineUsage != undefined) { wineUsage = res.wineUsage; } else { var tavernLevel = getArrValue(res.buildings["tavern"], "level", "-"); wineUsage = (tavernLevel > 0 ? tavernWineUsage[tavernLevel] : 0); } sumres.wood += getCurrentResourceAmount(currenttime, res.prodtime, res.wood, res.prodwood); sumres.wine += getCurrentResourceAmount(currenttime, res.prodtime, res.wine, res.prodwine - wineUsage); sumres.marble += getCurrentResourceAmount(currenttime, res.prodtime, res.marble, res.prodmarble); sumres.glass += getCurrentResourceAmount(currenttime, res.prodtime, res.glass, res.prodglass); sumres.sulfur += getCurrentResourceAmount(currenttime, res.prodtime, res.sulfur, res.prodsulfur); sumProd.wood += res.prodwood; sumProd.wine += res.prodwine; sumProd.marble += res.prodmarble; sumProd.glass += res.prodglass; sumProd.sulfur += res.prodsulfur; sumProd.wineUsage += wineUsage; var townHallLevel = getArrValue(res.buildings["townHall"], "level", "-"); var wineTooltip = ""; if (Math.round(res.prodwine) > 0) { wineTooltip = mynumberformat(res.prodwine, true)+" / "+ texts["h"]; } var wineRemainingHours = undefined; if (wineUsage > 0) { wineRemainingHours = floatFormat(getCurrentResourceAmount (currenttime, res.prodtime, res.wine, res.prodwine - wineUsage) / wineUsage, 1) + " "+ texts["h"]; } var wineUsageHtml = wineUsage > 0 ? createProd(-1 * wineUsage, wineRemainingHours) : ""; var happiness = res.happiness; var population = res.population; var bonusspace = res.bonusspace; var spacetotal = townHallSpaces[townHallLevel]; if (happiness != "?") { population = getEstimatedPopulation(population, res.prodtime, currenttime, happiness - population); if (parseInt(population) > parseInt(spacetotal) + parseInt(bonusspace)) { population = parseInt(spacetotal) + parseInt(bonusspace); } happiness -= population; } sumres.population += population; var growthRemainingHours = "∞ "+texts["h"]; var growth = (happiness != "?") ? floatFormat(0.02 * happiness, 2, true) : "?"; if (happiness != "?" && happiness > 0 && bonusspace != "?") { growthRemainingHours = getGrowthRemainingHours(population, parseInt(spacetotal) + parseInt(bonusspace), currenttime, happiness); } var cs = ""; var lfcs = langtype; if (parseInt(city_id) == parseInt(city.value)) { cs += " current_city_highlight"; lfcs += " current_city_highlight"; } var warehouseLevel = getArrValue(res.buildings["warehouse"], "level", "0"); var maxcwood = warehouseWoodCapacities[warehouseLevel] + 1000; var maxcother = warehouseOtherCapacities[warehouseLevel] + 300; s += ""; s += ""+ ""+ ""+ ""+ ""+ ""+ ""+ ""+ ""+ ""+ ""+ ""+ ""+ ""+ ""+ ""; s += ""; s += ""; } s += ""; s += ""; s += ""+ ""+ ""+ ""+ ""+ ""+ ""+ ""+ ""+ ""+ ""+ ""+ ""+ ""+ ""+ ""; s += ""; s += "
"+texts["cityName"]+""+texts["wood"]+""+texts["wine"]+""+texts["marble"]+""+texts["crystal"]+""+texts["sulfur"]+""+texts["currentlyBuilding"]+""+texts["Action"]+"
"+createLinkToCity(getCityName(city.innerHTML), city.value, i)+""+createLinkToResource( createCounter(res.prodtime, res.wood, res.prodwood, false, maxcwood, ""), res.island_id, city.value, i) +""+createProd(res.prodwood)+""+createFillageTimes(res.prodwood, res.wood, maxcwood)+""+createLinkToTradegoodCond(res.prodwine > 0, createCounter(res.prodtime, res.wine, res.prodwine - wineUsage, false, maxcother, ""), res.island_id, city.value, i) +""+wineUsageHtml+""+createProd(res.prodwine)+""+createLinkToTradegoodCond(res.prodmarble > 0, createCounter(res.prodtime, res.marble, res.prodmarble, false, maxcother, ""), res.island_id, city.value, i)+""+createProd(res.prodmarble)+""+createFillageTimes(res.prodmarble, res.marble, maxcother)+""+createLinkToTradegoodCond(res.prodglass > 0, createCounter(res.prodtime, res.glass, res.prodglass, false, maxcother, ""), res.island_id, city.value, i) +""+createProd(res.prodglass)+""+createFillageTimes(res.prodglass, res.glass, maxcother)+""+createLinkToTradegoodCond(res.prodsulfur > 0, createCounter(res.prodtime, res.sulfur, res.prodsulfur, false, maxcother, ""), res.island_id, city.value, i) +""+createProd(res.prodsulfur)+""+createFillageTimes(res.prodsulfur, res.sulfur, maxcother)+""; var enabled = (parseInt(city_id) != parseInt(city.value)) ? true: false; s += createTransportLink(city.value, enabled); s += createDeploymentArmyLink(city.value, enabled); s += createDeploymentFleetLink(city.value, enabled); s += "
"+texts["summary"]+""+createCounter(currenttime, sumres.wood, sumProd.wood)+""+createProd(sumProd.wood)+""+createCounter(currenttime, sumres.wine, sumProd.wine - sumProd.wineUsage, true)+""+createProd(-1 * sumProd.wineUsage)+""+createProd(sumProd.wine)+""+createCounter(currenttime, sumres.marble, sumProd.marble)+""+createProd(sumProd.marble)+""+createCounter(currenttime, sumres.glass, sumProd.glass)+""+createProd(sumProd.glass)+""+createCounter(currenttime, sumres.sulfur, sumProd.sulfur)+""+createProd(sumProd.sulfur)+""+createLink(scriptname, scriptsite, "target='_blank'")+"
"; s += "
"; } log("TABLE_RESOURCES: "+(new Date().getTime() - _startTime)+" msec"); if (TABLE_BUILDINGS) { s += ""; s += ""; try { var body_id = document.getElementsByTagName("body")[0].id; } catch (e) { } var usedIndexes = []; for(var i = 0; i < nodes.snapshotLength; i++) { var city = nodes.snapshotItem(i); var res = getCity(city.value); for(key in buildings) { var level = getArrValue(res.buildings[key], "level", "-"); var link = getArrValue(res.buildings[key], "link", "-"); if (level != "-") { usedIndexes[key] = true; } } } var firstStyle = langtype; for(key in buildings) { if (usedIndexes[key]) { var currentBuildingStyle = ""; if (key == body_id) { currentBuildingStyle = " current_building"; } s += ""; firstStyle = ""; } } s += ""; for(var i = 0; i < nodes.snapshotLength; i++) { var city = nodes.snapshotItem(i); var res = getCity(city.value); s += ""; if (city_idmainView > 0) { cs = (parseInt(city_idmainView) == parseInt(city.value)) ? "current_city_highlight" : ""; } else { cs = (parseInt(city_id) == parseInt(city.value)) ? "current_city_highlight" : ""; } s += ""; var firstStyle = langtype; for(key in buildings) { if (usedIndexes[key]) { var level = getArrValue(res.buildings[key], "level", "-"); var link = getArrValue(res.buildings[key], "link", "-"); if (level == undefined || level == "") { level = "-"; } else if (res.underConstructionName == key) { firstStyle += " upgrading"; level = createTooltip(level, texts["currentlyBuilding"]); } var currentBuildingStyle = ""; if (key == body_id) { currentBuildingStyle = " current_building"; } var upgradelink = "&nbsp\;"; var upgradetext = "&nbsp\;"; var levellink = level; if(level!="-"&&link!="-") { levellink = createLink(level, link, ""); if (res.underConstructionName != key) { upgradelink = link.replace(/view=(.+) \&id=/,"action=CityScreen&function=upgradeBuilding&id="); upgradelink = upgradelink+"&level=" +level; var cost = BuildingExpansionNeeds(key, level, res); var strattr = ""; var strimg = "btn_upgrade-off.jpg"; if (haveEnoughToUpgrade(cost, res)) { strimg = "btn_upgrade.jpg"; strattr = "class='upgradelink' href='"+upgradelink+"' cityid='"+city.value+"' "; } var strconfirm = "confirm='"+getCityName (city.innerHTML)+" "+ buildings[key][0] + " "+texts["Level"] + ":" + (++level) +"'"; upgradetext = ""; var tooltip = NeedsToStriing(cost); upgradetext = createTooltip(upgradetext, tooltip, texts["ResourceNeeds"]+" "+texts["Upgrade"]+":"+level); } } s += ""; s += ""; firstStyle = ""; } } s += ""; } s += "
"+texts["cityName"]+""+createTooltip(createImg(title_icons[key],"","65","65"), buildings[key][0])+"
"+createLinkToCity(getCityName(city.innerHTML), city.value, i)+""+levellink+""+upgradetext+"
"; s += "
"; } log("TABLE_BUILDINGS: "+(new Date().getTime() - _startTime)+" msec"); if (TABLE_ARMYFLEET) { if (config["unitnames"] != undefined) { var names = config["unitnames"]; var usedIndexes = []; var usedIndexesCount = 0; for(var i = 0; i < nodes.snapshotLength; i++) { var city = nodes.snapshotItem(i); var res = getCity(city.value); for(key in names) { if (parseInt(getArrValue(getArrValue(res.units, key), "count", 0)) > 0) { usedIndexes[key] = 1; usedIndexesCount++; } } } if (usedIndexesCount > 0) { s += ""; s += ""; for(key in names) { var name = names[key]; if (usedIndexes[key] == 1) { //s += ""; var info = name+"
"+NeedsToStriing(unit_cost [key]); s += ""; } } s += ""; s += ""; var sum = []; var sumPoint = []; for(var i = 0; i < nodes.snapshotLength; i++) { var city = nodes.snapshotItem(i); var res = getCity(city.value); s += ""; var cs; if (city_idmainView > 0) { cs = (parseInt(city_idmainView) == parseInt(city.value)) ? "current_city_highlight" : ""; } else { cs = (parseInt(city_id) == parseInt(city.value)) ? "current_city_highlight" : ""; } s += ""; var citySum = 0; var citySumPoint = 0; for(key in names) { if (usedIndexes[key] == 1) { var level = getIntValue(getArrValue (getArrValue(res.units, key), "count", "0"), 0); if (level == 0) { level = "-"; } else { sum[key] = (sum[key] == undefined) ? level : sum[key] + level; citySum += level; } var pointPerUnit = getArrValue(config ["unitpoints"], key, "0"); var point = ""; if (pointPerUnit == 0 || level == "-") { } else { point = pointPerUnit * level; sumPoint[key] = (sumPoint[key] == undefined) ? point : sumPoint[key] + point; citySumPoint += point; point = createTooltip (mynumberformat(point), level + " * " + mynumberformat(pointPerUnit) + " "+texts["Point"]); } s += ""; s += ""; } } s += ""; s += ""; s += ""; } s += ""; s += ""; var citySum = 0; var citySumPoint = 0; for(key in names) { if (usedIndexes[key] == 1) { s += ""; s += ""; citySum += sum[key]; citySumPoint += sumPoint[key]; } } s += ""; s += ""; s += ""; s += "
"+texts ["cityName"]+""+name+""+createTooltip(createImg(title_icons[key]), info, texts["unitInfo"])+""+texts["summary"] +"
"+createLinkToCity(getCityName (city.innerHTML), city.value, i)+""+mynumberformat(level)+""+point+""+(citySum != 0 ? mynumberformat(citySum) : "-")+""+(citySumPoint != 0 ? mynumberformat(citySumPoint) : "-")+"
"+texts["summary"]+""+mynumberformat(sum[key])+""+mynumberformat (sumPoint[key])+""+mynumberformat(citySum) +""+mynumberformat(citySumPoint)+"
"; s += "
"; } } } log("TABLE_ARMYFLEET: " + (new Date().getTime() - _startTime)+" msec"); if(TABLE_RESEARCH) { s += ""; // s += "<caption>+texts["scienceReport"]+</caption>"; s += ""; s += ""+ ""+ ""+ ""+ ""+ ""; s += ""; var sSum=0,sMaxSum=0,eSum=0; for(var i = 0; i < nodes.snapshotLength; i++) { var city = nodes.snapshotItem(i); var res = getCity(city.value); //if(i%2==0) s += ""; //else //s += ""; var cs = ""; var lfcs = langtype; if (parseInt(city_id) == parseInt(city.value)) { cs += " current_city_highlight"; lfcs += " current_city_highlight"; } s += ""; var level = getArrValue(res.buildings["academy"], "level", "-"); var link = getArrValue(res.buildings["academy"], "link", "-"); var linkText = level; if(level!="-"&&link!="-") linkText=""+level+""; s += ""; var scientists = getIntValue(res.scientists, 0); var scientistText = scientists; if (scientistText == 0) scientistText = "-"; var efficiency = getIntValue(res.efficiency, 0); sSum += scientists; var currentMax=0; if(level!='-') currentMax = academyCapacities[level]; sMaxSum += currentMax eSum += efficiency; s += ""; s += ""; s += ""; var cost = 8; if(TECH_LETTERCHUTE) cost = 7; s += ""; var link = getArrValue(res.buildings["academy"], "link", "-"); var linkText = ""; if(link!='-') linkText=""+texts["goTo"]+buildings["academy"][1]+""; s += ""; s += ""; } s += ""; s += ""+ ""+ ""+ ""+ ""+ ""+ ""; s += ""; s += "
"+texts["cityName"]+""+texts["constructionLevel"]+""+texts["scientists"]+""+texts["production"]+""+texts["costs"]+"
"+createLinkToCity(getCityName(city.innerHTML), city.value, i)+""+linkText+""+scientistText+""+currentMax+""+createProd(efficiency)+""+createProd(-cost*scientists)+""+linkText+"
"+texts["summary"]+""+sSum+""+sMaxSum+""+createProd(eSum)+""+createProd(-cost*sSum)+"
"; s += "
"; } log("TABLE_RESEARCH: " + (new Date().getTime() - _startTime)+" msec"); if(TABLE_TRANSPORTERS) { s += ""; // s += "<caption>+texts["transportReport"]+</caption>"; s += ""; s += ""+ ""+ ""+ ""+ ""+ ""+ ""+ ""+ ""+ ""; s += ""; for(var i = 0; i < nodes.snapshotLength; i++) { var city = nodes.snapshotItem(i); var res = getCity(city.value); var wineUsage; if (res.wineUsage != undefined) { wineUsage = res.wineUsage; } else { var tavernLevel = getArrValue(res.buildings["tavern"], "level", "-"); wineUsage = (tavernLevel > 0 ? tavernWineUsage[tavernLevel] : 0); } if(res.incomingTransporters == undefined) res.incomingTransporters = []; var lastship={"wood":0,"wine":0,"marble":0,"glass":0,"sulfur":0}; var cs = ""; var lfcs = langtype; if (parseInt(city_id) == parseInt(city.value)) { cs += " current_city_highlight"; lfcs += " current_city_highlight"; } var t = res.incomingTransporters.length; if(t > 0) for(var j = 0; j < t; j++) { var transporter = res.incomingTransporters[j]; lastship["wood"]+=transporter.res["wood"]; lastship["wine"]+=transporter.res["wine"]; lastship["marble"]+=transporter.res["marble"]; lastship["glass"]+=transporter.res["glass"]; lastship["sulfur"]+=transporter.res["sulfur"]; s += ""; if(j == 0) s += ""; s += ""; s += ""; if (transporter.arriveTime>0) { s += ""; s += ""; s += ""; s += ""; s += ""; s += ""; s += ""; } else { s += ""; s += ""; s += ""; s += ""; s += ""; s += ""; s += ""; } s += ""; } } s += ""; s += "
"+texts["cityName"]+""+texts["StartCity"]+""+texts["DestinationCity"]+""+texts["wood"]+""+texts["wine"]+""+texts["marble"]+""+texts["crystal"]+""+texts["sulfur"]+""+texts["Mission"]+""+texts["FinishTime"]+"
"+createLinkToCity(getCityName(city.innerHTML), city.value, i) +""+transporter.startcity+""+transporter.endcity+""+createTooltip(transporter.res["wood"], texts ["FinishResources"]+":"+getCurrentResourceAmount(transporter.arriveTime, res.prodtime, lastship["wood"]+res.wood, res.prodwood))+""+createTooltip(transporter.res["wine"], texts ["FinishResources"]+":"+getCurrentResourceAmount(transporter.arriveTime, res.prodtime, lastship["wine"] + res.wine, res.prodwine - wineUsage))+""+createTooltip(transporter.res["marble"], texts ["FinishResources"]+":"+getCurrentResourceAmount(transporter.arriveTime, res.prodtime, lastship["marble"] + res.marble, res.prodmarble))+""+createTooltip(transporter.res["glass"], texts ["FinishResources"]+":"+getCurrentResourceAmount(transporter.arriveTime, res.prodtime, lastship["glass"] + res.glass, res.prodglass))+""+createTooltip(transporter.res["sulfur"], texts ["FinishResources"]+":"+getCurrentResourceAmount(transporter.arriveTime, res.prodtime, lastship["sulfur"] + res.sulfur, res.prodsulfur))+""+transporter.mission+""+createTimeCounter(transporter.arriveTime)+""+transporter.res["wood"]+""+transporter.res["wine"]+""+transporter.res["marble"]+""+transporter.res["glass"]+""+transporter.res["sulfur"]+""+transporter.mission+""+createTimeCounter(transporter.arriveTime)+"
"; s += "
"; } log("TABLE_TRANSPORTERS: "+(new Date().getTime() - _startTime)+" msec"); if (TABLE_PLAYERS) { var select_cityid = getSelectCity(); var playerNames = []; for(plname in players.playersCities) { var itm = { name: plname, score: players.playersCities[plname].score }; playerNames[playerNames.length] = itm; } playerNames.sort(function(a,b){ var c = getIntValue(a.score); var d = getIntValue(b.score); return (c > d) ? -1 : ((c < d) ? 1 : 0); }); var maxCityNum = 0; for(idx in playerNames) { var plname = playerNames[idx].name; var city_ids = players.playersCities[plname].cities; var citystatus = players.playersCities[plname].citystatus; if (citystatus == undefined) citystatus = ""; if (!PLAYERS_NORMAL && citystatus == "") continue; if (!PLAYERS_INACTIVITY && citystatus == "inactivity") continue; if (!PLAYERS_BANNED && citystatus == "banned") continue; if (!PLAYERS_VACATION && citystatus == "vacation") continue; var i=0; for(id in city_ids) { if (city_ids[id]) i++; } maxCityNum = (i>maxCityNum) ? i :maxCityNum; } s += ""; s += ""; s += ""; s += ""; s += ""; s += ""; s += ""; s += ""; for(idx in playerNames) { var plname = playerNames[idx].name; var city_ids = players.playersCities[plname].cities; var citystatus = players.playersCities[plname].citystatus; if (citystatus == undefined) citystatus = ""; if (!PLAYERS_NORMAL && citystatus == "") continue; if (!PLAYERS_INACTIVITY && citystatus == "inactivity") continue; if (!PLAYERS_BANNED && citystatus == "banned") continue; if (!PLAYERS_VACATION && citystatus == "vacation") continue; var banner = (citystatus == "banned") ? "" : ""; var strattr = "class='deleteplayer' playername='"+plname+"' "; var deletebutton = createImg("skin/advisors/military/icon_close_small.gif", strattr, 16); var citystatushtml = ""; if (citystatus != "") citystatushtml = " class='"+citystatus+"' "; var ss = ""; var citynum = 0; for(id in city_ids) { if (city_ids[id]) { var city = players.cities[id]; if (citynum!=0) ss += ""; ss += ""; ss += ""; ss += ""; ss += ""; if (citynum!=0) ss += ""; citynum++; } } var rowspan = ""; if (citynum != 1) rowspan = " rowspan='"+citynum+"' "; s += ""; s += "
"+texts["Players"]+""+texts["Alliance"]+""+texts["Score"]+""+texts["cityName"]+""+texts["Action"]+"
"+createLinkToForeignCity(createTooltip(city.name, players.islands [city.island_id].coord), city.island_id, id)+""+createLinkToForeignCity(players.islands[city.island_id].coord, city.island_id, id)+""+city.size+""; if (select_cityid>0) ss += createDiplomacyLink(select_cityid, id); //var desabled = true; //if (citystatus != "vacation") var enabled = (citystatus == "vacation") ? false: true; ss += createTransportLink(id, enabled); ss += createPlunderLink(id, enabled); ss += createBlockadeLink(id, enabled); ss += createSendSpyLink(id, city.island_id); enabled = (citystatus == "vacation" || citystatus == "inactivity") ? false: true; ss += createDefendCityLink(id, enabled); ss += createDefendPortLink(id, enabled); ss += "
"+deletebutton+""; s += ""+banner+plname+""; s += "" + players.playersCities[plname].alliance + ""; s += "" + players.playersCities[plname].score + ""; s += ss; s += ""; } s += "
"; s += "
"; } log("TABLE_PLAYERS: "+(new Date().getTime() - _startTime)+" msec"); var body = getNode("//body"); var table_mode = "new_table"; var span = document.getElementById("overview__table"); if (span == null) { span = document.createElement('div'); span.id = "overview__table"; span.align = "center"; span.setAttribute("style", "clear: left;"); span.innerHTML = s; body.appendChild(span); } else { span.innerHTML = s; table_mode = "refresh_table"; } function change_resourcetradegood(e) { var obj = e.srcElement ? e.srcElement:e.target; var city_id = obj.getAttribute("cityid"); if (obj.tagName=="FONT") city_id = obj.parentNode.parentNode.getAttribute("cityid"); if (obj.tagName=="IMG") city_id = obj.parentNode.getAttribute("cityid"); actioncode = changeCity(city_id); } var anodes = $x("//table[contains(@class, '_table')]//a[@class='AutoChange']"); for(var i=0; i<anodes><imgnodes><imgnodes>="0.3.0") { var script = document.createElement('script'); script.type = "text/javascript"; script.src = "/js/wz_tooltip.js"; var body = getNode("//head"); body.appendChild(script); } window.setInterval(TimeCounter, 1000); window.setInterval(TimeResourceCounter, 1000); function WineTime() { function countdown(td, s) { var time = secsToDHMS(s, 0); if (time != td.innerHTML) { td.innerHTML = createTooltip(time, texts["empty"]+":"+resolveTime(s, 1)); } var wait = s < 61 ? 1 : s % 60 + 1; setTimeout(countdown, wait * 1e3, td, s - wait); } function wineConsumptionTime(total, rate) { total = getIntValue(total); rate = Math.abs(getIntValue(rate)); if (!rate) return Infinity; return Math.floor(3600 * total / rate); } function wineLasts(td) { if (td.textContent) return; var total = $X('preceding-sibling::td[2]', td).textContent; var rate = $X('preceding-sibling::td[1]', td).textContent; if (rate) { var left = wineConsumptionTime(total, rate); if (!isFinite(rate)) return; countdown(td, left); } } var td = $x('id("overview__table")/table[@class="resources_table"]/tbody/tr[not(@class="table_footer")]/td [@name="wine"]'); // W if (td) td.map(wineLasts); } var time = new Date().getTime(); setVar("config", serialize(config)); log("time serialize: "+(new Date().getTime() - time)+" msec"); if (getCfgValue("TABLE_PLAYERS", false) == true) { var time = new Date().getTime(); setVar("players", uneval(players)); log("time uneval: "+(new Date().getTime() - time)+" msec"); } var _endTime = new Date().getTime(); log("total time: "+(_endTime - _startTime)+" msec"); /*********************************************************************** * 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; } /************************************************************************************************** * TrimIsland Function ******************************************************************/ function TrimIsland(str){ var ret = "[??:??]"; if (/\[([0-9]+):([0-9]+)\]/.test(str) != null) { ret = "["+twodigit(RegExp.$1)+":"+twodigit(RegExp.$2)+"]"; } return ret; } function secsToDHMS(t, rough, join) { if (t == Infinity) return "∞"; var result = []; var minus = t < 0 ? "-" : ""; if (minus) t = -t; for (var unit in TimeUnits) { var u = unsafeWindow.LocalizationStrings.timeunits.short[unit]; var n = TimeUnits[unit]; var r = t % n; if (r == t) continue; if ("undefined" == typeof rough || rough--) result.push(((t - r) / n) + u); else { result.push(Math.round(t / n) + u); break; } t = r; } return minus + result.join(join || " "); } function urlParse(param, url) { if (!url) url = location.search || ""; var keys = {}; url.replace(/([^=&?]+)=([^&#]*)/g, function(m, key, value) { keys[decodeURIComponent(key)] = decodeURIComponent(value); }); return (param ? keys[param] : keys) || "view" == param && document.body.id; } function changeCity(city_id) { var postdata = getFormInput("//form[@id='changeCityForm']//input"); postdata = postdata + "&cityId="+city_id+"&view=city"; var xmlhttp; if(window.XMLHttpRequest){ xmlhttp = new XMLHttpRequest(); } xmlhttp.open('POST','http://' + location.host + '/index.php',false); xmlhttp.setRequestHeader('User-agent','Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-TW; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); xmlhttp.setRequestHeader('Accept','application/atom+xml,application/xml,text/xml'); xmlhttp.setRequestHeader('Referer','http://' + location.host + '/index.php'); xmlhttp.setRequestHeader('Cooki',document.cookie); xmlhttp.overrideMimeType('text/javascript; charset='+document.characterSet); xmlhttp.send(postdata); var node = getDocument(xmlhttp.responseText); return node.getElementsByTagName("input")[2].value; } function getDocument(responseText) { var html = document.createElement("html"); html.innerHTML = responseText; var response = document.implementation.createDocument("", "", null); response.appendChild(html); return response; } // consumption/replenish rate and emptiness/fillage times: function createFillageTimes(r, d, max) { var t = CalFillageTimes(r, d, max); return (t) ? createTooltip(secsToDHMS(t, 0), texts[r > 0 ? "full" : "empty"]+":"+resolveTime(t, 1)) : ""; } function CalFillageTimes(r, d, max) { if (r) { if (r > 0) { t = (max - d) * 3600 / r; } else { t = d * 3600 / -r; } return t; } } function $(id) { return document.getElementById(id); } function getServerTime(offset) { var Y, M, D, h, m, s, t; [D, M, Y, h, m, s] = $("servertime").textContent.split(/[. :]+/g); t = new Date(Y, parseInt(M, 10)-1, D, h, m, s); return offset ? new Date(t.valueOf() + offset*1e3) : t; } // input: s, bool; output: time or date+time function resolveTime(seconds, timeonly) { // Crée le temps de fin. function z(t) { return (t < 10 ? "0" : "") + t; } var t0 = unsafeWindow.startTime || // 0.2.7 (and earlier) getIntValue(unsafeWindow.updateServerTime.toSource()); // 0.2.8 (onwards?) var t = getServerTime(seconds - (t0 - unsafeWindow.startServerTime) / 1e3); var d = "", now = (new Date); if (t.getDate() != now.getDate() || t.getMonth() != now.getMonth()) { m = t.getMonth(); d = t.getFullYear()+"/"+twodigit(t.getMonth()+1)+"/"+twodigit(t.getDate()); if (2 == timeonly) return d; d += ", "; } var h = z(t.getHours()); var m = z(t.getMinutes()); var s = z(t.getSeconds()); t = d + h + ":" + m + ":" + s; return timeonly ? t : texts["FinishTime"] + ":" + t; } function getCityName(cityhtml) { return Trim(cityhtml.replace(/\[[0-9]+.[0-9]+\]/,"")); } function getFormInput(path) { var nodes = $x(path); if (nodes.length<=0) return null; var postdata = nodes[0].name+"="+nodes[0].value; for(var i = 1; i < nodes.length; i++) { if (nodes[i].name == "actionRequest") nodes[i].value = actioncode; postdata = postdata +"&" + nodes[i].name+"="+nodes[i].value; } return postdata; } function get(url, fn , tag) { GM_xmlhttpRequest({ method: "GET", url: url, headers: { 'User-agent': 'Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-TW; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3', 'Referer': 'http://' + location.host + '/index.php', 'Cookie': document.cookie }, onload: function(responseDetails) { fn(responseDetails.responseText, tag); } }); } function getSelectCity() { return $x("//option", $("citySelect"))[$("citySelect").selectedIndex].value; } function gameVersion() { var v = $X('id("GF_toolbar")//li[@class="version"]/a/span'); return v && v.textContent.replace(/[^\d.]/g, "").replace(/^\./, ""); } function BuildingExpansionNeeds(name, level, res) { if (costs[name]==undefined) return {}; var needs = costs[name][level]; var value = {}; var factor = 1.00; if (TECH_PULLEY) factor -= 0.02; // Pulley if (TECH_GEOMETRY) factor -= 0.04; // Geometry if (TECH_SPIRITLEVEL) factor -= 0.08; // Spirit Level for (var r in needs) if ("t" == r) // no time discount value[r] = needs[r]; else value[r] = Math.floor(needs[r] * factor); return value; } function haveEnoughToUpgrade(cost, res) { have = currentResources(res); for (var resource in cost) { if (resource != "t" && have[resource] < cost[resource]) { return false; } } return true; } function currentResources(res) { return { p: res.freeworkers, P: res.population, g: res.gold, w: res.wood, W: res.wine, M: res.marble, C: res.glass, S: res.sulfur }; } function NeedsToStriing(cost) { function replace(m, icon) { icon = createImg(icons[icon]); return icon; } if (isObject(cost)) { var name = { g: "gold", p: "citizens", u: "upkeep", a: "attack", d: "defend", v: "speed", w: "wood", M: "marble", C: "glass", W: "wine", S: "sulfur", t: "time" }; var html = [] for (var id in cost) { var count = cost[id]; if (count < 0 && opt.nonegative) count = 0; if (name[id]) html.push("$"+ name[id]+" "+count); //else //html.push(count); // (build time) } cost = html.join(" \xA0 "); } return cost.replace(/\$([a-z]{4,11})/g, replace); } function isString(s) { return "string" == typeof s; } function isNumber(n) { return "number" == typeof n; } function isObject(o) { return "object" == typeof o; } function updatetownHall(res, root) { res.gold = Number($X("//div[@id='CityOverview']//li[contains(@class,'incomegold')]//span[@class='value']", root).textContent); log("gold:"+res.gold); res.corruption = $X("//div[@id='CityOverview']//li[@class='corruption']//span[contains(@class,'value')]//span", root).textContent; log("corruption:"+res.corruption); res.woodworkers = $X("//div[@id='PopulationGraph']//div[@class='woodworkers']//span[@class='count']", root).textContent; log("woodworkers:"+res.woodworkers); res.specialworkers = $X("//div[@id='PopulationGraph']//div[@class='specialworkers']//span [@class='count']", root).textContent; log("specialworkers:"+res.specialworkers); res.bonusspace = Number($X("//span[@class='value total']", root).textContent) - townHallSpaces [getArrValue(res.buildings["townHall"], "level")]; log("bonusspace:"+res.bonusspace); res.happiness = Number($X("//div[contains(@class, 'happiness ')]/div[@class='value']", root).textContent) + res.population; log("happiness:"+res.happiness); var wineUsage = $X("//div[@class='serving']//span", root); if (wineUsage != undefined) { var winusage_basic = (gameVersion()<"0.3.0") ? 80 : 60; res.wineUsage = tavernWineUsage[Number(wineUsage.textContent)/winusage_basic]; } log("wineUsage:"+res.wineUsage); res.scientists = Number($X("//div[@id='PopulationGraph']//div[@class='scientists']//span[@class='count']", root).textContent); log("scientists:"+res.scientists); res.efficiency = Number($X("//div[@id='PopulationGraph']//div[@class='scientists']//* [@class='production']/child::text()", root).textContent); log("efficiency:"+res.efficiency); } function updateArmyFleet(res, type, root) { var idx = 0; if (type == "shipyard") { idx = 13; } if (config["unitnames"] == undefined) { config["unitnames"] = {}; } if (config["unitpoints"] == undefined) { config["unitpoints"] = {}; } if (res.units == undefined) { res.units = {}; } var names = $x("//ul[@id='units']/li[contains(@class, 'unit')]/div[@class='unitinfo']/h4", root); var counts = $x("//ul[@id='units']/li[contains(@class, 'unit')]/div[@class='unitinfo']/div[@class='unitcount']", root); if (names.length == counts.length) { for(var i = 0; i < names.length; i++) { var node = names[i]; var n = node.innerHTML; n = n.replace(/\([0-9]+\/[0-9]+\)/g, ""); var cost; try { unit_id = node.parentNode.parentNode.getAttribute("class"); cost = $x("//ul[@id='units']/li[@class='"+unit_id+"']/div[@class='costs']/ul[@class='resources']/li", root); } catch (e) { } config["unitnames"][unit_id] = n; var c = counts[i]; var cnt = getIntValue(c.innerHTML.replace(/<.+>/g, ""), 0); if (res.units[unit_id] == undefined) { res.units[unit_id] = {}; } res.units[unit_id].count = cnt; if (cost != undefined) { config["unitpoints"][unit_id] = 0; for(var j = 0; j < cost.length; j++) { var c = cost[j]; var cl = c.getAttribute("class"); if (unitScoreBasePoints[cl] != undefined) { // console.log(unit_cost[unit_id][unitScoreBaseIndex[cl]]); //if (gameVersion()>="0.3.0") config["unitpoints"][unit_id] += unit_cost[unit_id][unitScoreBaseIndex[cl]] * unitScoreBasePoints[cl]; //else // config["unitpoints"][unit_id] += getIntValue(c.innerHTML) * unitScoreBasePoints[cl]; } } } } } } function updateHideout(res, root) { //var node = $X("//div[@class='contentBox01h'][2]/div[@class='content']/p/span/span[2]/child::text()", root); //res.spy = node.textContent.Trim(); var node = $X("//input[@id='spyCount']", root); if (node != undefined) res.spy = node.value; } function updatePort(res, root) { if(config["destinations"] != undefined && root == undefined) { for(var dest in config["destinations"]) { var n = document.createElement("li"); n.innerHTML = ""+config["destinations"] [dest].name+""; function removeDestination() { if(confirm(texts["removeDestnConfirm"])) if(config["destinations"][dest] != undefined) delete config["destinations"][dest]; setVar("config", serialize(config)); location.replace(window.location); } var b = document.createElement('input'); b.type = "button"; b.value = texts["removeDestn"]; b.setAttribute("class", "button"); b.setAttribute("style", "display: inline; width: auto;"); b.addEventListener("click", removeDestination, false); n.appendChild(b); var node = $X("//div[@class='contentBox01h'][2]/div/ul"); node.appendChild(n); } } res.incomingTransporters = []; function getRes(rak) { rak = rak.replace(/]*\/icon_([^>]+).gif[^0-9]*([0-9.,]+)/g, ";$1:$2;"); rak = rak.replace(/^[^<]*/, ""); rak = rak.replace(/>[^>]*$/, ">"); rak = rak.replace(/<[^>]*>/g, ""); var arr = rak.split(";"); var r = {"wood":0,"wine":0,"marble":0,"glass":0,"sulfur":0}; for (key in arr) { if (arr[key].indexOf(":") >= 0) { var a = arr[key].split(":"); r[a[0]] = getIntValue(a[1]); } } return r; } //record load ship var transporters = $x("//div[@class='contentBox01h'][3]//table[@class='table01']/tbody/tr", root); if (transporters.length>0) { for(var i = 0; i<transporters><"0.3.0") { transporter.res = getRes(Itemnode[3].getAttribute("onmouseover")); } else { transporter.res = {"wood":0,"wine":0,"marble":0,"glass":0,"sulfur":0}; var unit = $x("//div[@class='contentBox01h'][3]//table [@class='table01']/tbody/tr["+(i+1)+"]//td[@class='unit']", root); var count = $x("//div[@class='contentBox01h'][3]//table [@class='table01']/tbody/tr["+(i+1)+"]//td[@class='count']", root); for(var j=0; j<unit>]*\/icon_([^>]+).gif.*/g, "$1"); transporter.res[key] = getIntValue(count[j].textContent); } } var totaltime = 0; var script = Itemnode[7].getElementsByTagName("script"); if (script.length > 0) { transporter.mission = texts["Loading"]; var starttime = 0; if (/enddate:\s([0-9]+)/.exec(script[0].innerHTML) != null) arrivetime = RegExp.$1*1000; if (/currentdate:\s([0-9]+)/.exec(script[0].innerHTML) != null) starttime = RegExp.$1*1000; totaltime = getLocalTime(arrivetime-starttime); } else { transporter.mission = Itemnode[7].innerHTML; } transporter.arriveTime = totaltime; res.incomingTransporters.push(transporter); } } //record arriving ship var transporters = $x("//div[@class='contentBox01h'][4]//table[@class='table01']/tbody/tr", root); if (transporters.length>1) { for(var i = 1; i<transporters><"0.3.0") { transporter.res = getRes(Itemnode[7].getAttribute("onmouseover")); } else { transporter.res = {"wood":0,"wine":0,"marble":0,"glass":0,"sulfur":0}; var unit = $x("//div[@class='contentBox01h'][4]//table [@class='table01']/tbody/tr["+(i+1)+"]//td[@class='unit']", root); var count = $x("//div[@class='contentBox01h'][4]//table [@class='table01']/tbody/tr["+(i+1)+"]//td[@class='count']", root); for(var j=0; j<unit>]*\/icon_([^>]+).gif.*/g, "$1"); transporter.res[key] = getIntValue(count[j].textContent); } } res.incomingTransporters.push(transporter); } } }
 
frechi User

the width of the pictures should be 35px max.
so all buildings could be in only one table without splitting.
if the width is for example 65px only the buildings from ika v.0.2.8 will fit complete into the table. in the next days will be the new version on all servers. so it would be better to change the width to 35px. I've tested it on the testserver and looks great.

Example for default language:
                "townHall" : ["Town Hall", "<img src='/skin/buildings/y100/townHall.gif' width='35'>"],
                 "academy" : ["Academy", "<img src='/skin/buildings/y100/academy.gif' width='35'>"],
                    "port" : ["Trading Port", "<img src='/skin/buildings/y100/port.gif' width='35'>"],
                "shipyard" : ["Shipyard", "<img src='/skin/buildings/y100/shipyard.gif' width='35'>"],
               "warehouse" : ["Warehouse", "<img src='/skin/buildings/y100/warehouse.gif' width='35'>"],
                    "wall" : ["Wall", "<img src='/skin/buildings/y100/wall.gif' width='35'>"],
                  "tavern" : ["Tavern", "<img src='/skin/buildings/y100/tavern.gif' width='35'>"],
                  "museum" : ["Museum", "<img src='/skin/buildings/y100/museum.gif' width='35'>"],
                  "palace" : ["Palace", "<img src='/skin/buildings/y100/palace.gif' width='35'>"],
            "palaceColony" : ["Governor's Residence", "<img src='/skin/buildings/y100/palaceColony.gif' width='35'>"],
                 "embassy" : ["Embassy", "<img src='/skin/buildings/y100/embassy.gif' width='35'>"],
            "branchOffice" : ["Trading Post", "<img src='/skin/buildings/y100/branchOffice.gif' width='35'>"],
               "safehouse" : ["Hideout", "<img src='/skin/buildings/y100/safehouse.gif' width='35'>"],
                "barracks" : ["Barracks", "<img src='/skin/buildings/y100/barracks.gif' width='35'>"],
           "workshop-army" : ["Workshop", "<img src='/skin/buildings/y100/workshop.gif' width='35'>"],
            "carpentering" : ["Carpenter", "<img src='/skin/buildings/y100/carpentering.gif' width='35'>"],
                "forester" : ["forester", "<img src='/skin/buildings/y100/forester.gif' width='35'>"],
              "stonemason" : ["stonemason", "<img src='/skin/buildings/y100/stonemason.gif' width='35'>"],
            "glassblowing" : ["glassblowing", "<img src='/skin/buildings/y100/glassblowing.gif' width='35'>"],
              "winegrower" : ["winegrower", "<img src='/skin/buildings/y100/winegrower.gif' width='35'>"],
               "alchemist" : ["alchemist", "<img src='/skin/buildings/y100/alchemist.gif' width='35'>"],
               "architect" : ["architect", "<img src='/skin/buildings/y100/architect.gif' width='35'>"],
                "optician" : ["optician", "<img src='/skin/buildings/y100/optician.gif' width='35'>"],
                "vineyard" : ["vineyard", "<img src='/skin/buildings/y100/vineyard.gif' width='35'>"],
              "fireworker" : ["fireworker", "<img src='/skin/buildings/y100/fireworker.gif' width='35'>"],

 
lexichlong(LxL) User

You shouldn't change the language array because if kChen you it somewhere that you didn't khow then it won't work. You can Change it by this way:
+ Create new value in var Title_icon.Ex:var title_icons = { "unit slinger" : "/skin/characters/military/x40_y40/y40_slinger_faceright.gif", "unit swordsman" : "/skin/characters/military/x40_y40/y40_swordsman_faceright.gif", "unit phalanx" : "/skin/characters/military/x40_y40/y40_phalanx_faceright.gif", "unit ram" : "/skin/characters/military/x40_y40/y40_ram_faceright.gif", "unit archer" : "/skin/characters/military/x40_y40/y40_archer_faceright.gif", "unit catapult" : "/skin/characters/military/x40_y40/y40_catapult_faceright.gif", "unit marksman" : "/skin/characters/military/x40_y40/y40_marksman_faceright.gif", "unit mortar" : "/skin/characters/military/x40_y40/y40_mortar_faceright.gif", "unit steamgiant" : "/skin/characters/military/x40_y40/y40_steamgiant_faceright.gif", "unit gyrocopter" : "/skin/characters/military/x40_y40/y40_gyrocopter_faceright.gif", "unit bombardier" : "/skin/characters/military/x40_y40/y40_bombardier_faceright.gif", "unit medic" : "/skin/characters/military/x40_y40/y40_medic_faceright.gif", "unit cook" : "/skin/characters/military/x40_y40/y40_cook_faceright.gif", "unit ship_ram" : "/skin/characters/fleet/40x40/ship_ram_r_40x40.gif", "unit ship_ballista" : "/skin/characters/fleet/40x40/ship_ballista_r_40x40.gif", "unit ship_flamethrower" : "/skin/characters/fleet/40x40/ship_flamethrower_r_40x40.gif", "unit ship_catapult" : "/skin/characters/fleet/40x40/ship_catapult_r_40x40.gif", "unit ship_mortar" : "/skin/characters/fleet/40x40/ship_mortar_r_40x40.gif", "unit ship_steamboat" : "/skin/characters/fleet/40x40/ship_steamboat_r_40x40.gif", "unit ship_submarine" : "/skin/characters/fleet/40x40/ship_submarine_r_40x40.gif", "townHall" : "/skin/img/city/building_townhall.gif", "academy" : "/skin/img/city/building_academy.gif", "port" : "/skin/img/city/building_port.gif", "shipyard" : "/skin/img/city/building_shipyard.gif", "warehouse" : "/skin/img/city/building_warehouse.gif", "wall" : "/skin/img/city/building_wall.gif", "tavern" : "/skin/img/city/building_tavern.gif", "museum" : "/skin/img/city/building_museum.gif", "palace" : "/skin/img/city/building_palace.gif", "palaceColony" : "/skin/img/city/building_palaceColony.gif", "embassy" : "/skin/img/city/building_embassy.gif", "branchOffice" : "/skin/img/city/building_branchOffice.gif", "safehouse" : "/skin/img/city/building_safehouse.gif", "barracks" : "/skin/img/city/building_barracks.gif", "workshop-army" : "/skin/img/city/building_workshop.gif"}
+ Change the table_buildings: Change this :createTooltip(......)into this:createTooltip(createImg(title_icons[key]), info, texts["unitInfo"])
Good Luck!

Cross
Presentational HTML allowed.
Use <code> for inline code and <pre> for code blocks. Use &lt; and &gt; for literal < and >.
We help break paragraphs and link your links.
or cancel