// ==UserScript== // @name Power Tools - POC3 With Food Alert // @namespace Hung // @include http://*.kingdomsofcamelot.com/*main_src.php* // @include https://*.kingdomsofcamelot.com/*main_src.php* // @description Enhancements and bug fixes for Kingdoms of Camelot // @require http://tomchapin.me/auto-updater.php?id=98335 // ==/UserScript== var Version = '20110725b'; var Title = 'KOC Power Tools'; var DEBUG_BUTTON = true; var DEBUG_TRACE = false; var DEBUG_TRACE_DRAG = false; var DEBUG_TRACE_AJAX = false; var MAP_DELAY = 1500; var DISABLE_POST_KNIGHT_SKILLS = false; var DISABLE_POST_DEFENSES = false; var ENABLE_SEARCH_TAB = true; var ENABLE_TEST_TAB = true; var SEND_ALERT_AS_WHISPER = false; var TEST_WIDE = false; var TEST_WIDE_CITIES = 7; var History=[]; var URL_CASTLE_BUT = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAXCAMAAAGkBsQ5AAABa1BMVEX%2F%2F8X%2F98X%2F973%2F97X%2F77X%2F7633773%2F76X377X3763%2F5q3%2F5qX%2F5pz35q335qX%2F3pz%2F3pT33pz%2F1pT%2F1oz%2F1oT31pT31oz%2FzoT%2Fznv3zoT%2FxXv%2FxXP%2FxWv3xXv3xXP%2FvWv%2FvWP3vWv3vWP%2FtWP%2FtVr%2FtVLmvWv3tWP3tVr3tVL%2FrVL%2FrUrmtWP3rVL3rUrvrVL%2FpUrvrUr%2FpULmrVrmrVL3pUr3pULmpUL3nDrepULWpVLWpUrmnDrFpUK1pVrOnDqcnFKcnEqMnEp7lHN7lGtzlGNrlGtjjEpajFpShFJSe2NChEJKe1o6hDohjDFCc1oZjDEhhDEQjDEAlDEpezoZhDEhezoQhDEAjDEpczoZezoIhDEhc0IhczoAhDEZczoIezEhazoAezEhY0IAczEAcykIazEhWkIAazEAaykIYzEhUkIAYzEAWjEAUjEAUikASjEASikAQjEAQikAOjEAOikAMTEAMSkAKSlOGAcLAAAACXBIWXMAAAsSAAALEgHS3X78AAABVklEQVQYGQXBPW4TYRiF0ee%2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IZYYKy5QWbMmHQSyZm0MQw0rcRWEydfvXJMHIXYloMaaOEgitYrj81LwRQ2swlAMcUmcKxspMWuOTJEDri0UHYr7ybBEqIQdP%2B%2FUALn13NcVZ8dW6iDpRNy2lQbgAFsvb6Ua5OotLvwigdwMlSNvTvH5xOjIYR4nTvs4dejLAUzXjh289t3bK3pvPV43d%2FTUr1OsPfG9c%2FXzv5uMDxP49%2Fu1AwIAOw%3D%3D"; var provMapCoords = {imgWidth:710, imgHeight:708, mapWidth:670, mapHeight:670, leftMargin:31, topMargin:19}; var serverID; var Options = { includeCity : true, includeMarching:true, includeTraining:false, includeTrainingTotal:false, encRemaining : true, maxIdlePop : false, srcSortBy : 'level', srcMinLevel : 1, srcMaxLevel : 7, wildType : 1, unownedOnly : true, fixTower : true, fixTower2 : true, fixMapDistance: true, fixMsgCount : true, fixWarnZero : true, fixPageNav : true, enhanceARpts : true, allowAlterAR : true, enhanceMsging : true, ptWinIsOpen : false, ptWinDrag : false, ptWinPos : {}, enableFoodWarn : true, foodWarnHours : 24, lastVersion : null, hideOnGoto : true, currentTab : false, gmtClock : true, chatEnhance : true, chatglobal : true, chatwhisper : true, chatbold : false, chatAttack : true, chatLeaders : true, fixKnightSelect : true, attackCityPicker : true, mapCoordsTop : true, dispBattleRounds : true, reportDeleteButton : true, overviewFontSize : 12, overviewAllowOverflow : false, curMarchTab : 'A', playersNoCities : false, enableWhisperAlert : true, enableTowerAlert : true, AllianceLeaders : [], //alertConfig : {aChat:false, aPrefix:'** I\'m being attacked! **', scouting:false, wilds:false, minTroops:10000, spamLimit:10 }, }; var JSON;if(!JSON){JSON={};}(function(){"use strict";function f(n){return n<10?'0'+n:n;}if(typeof Date.prototype.toJSON!=='function'){Date.prototype.toJSON=function(key){return isFinite(this.valueOf())?this.getUTCFullYear()+'-'+f(this.getUTCMonth()+1)+'-'+f(this.getUTCDate())+'T'+f(this.getUTCHours())+':'+f(this.getUTCMinutes())+':'+f(this.getUTCSeconds())+'Z':null;};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(key){return this.valueOf();};}var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'},rep;function quote(string){escapable.lastIndex=0;return escapable.test(string)?'"'+string.replace(escapable,function(a){var c=meta[a];return typeof c==='string'?c:'\\u'+('0000'+a.charCodeAt(0).toString(16)).slice(-4);})+'"':'"'+string+'"';}function str(key,holder){var i,k,v,length,mind=gap,partial,value=holder[key];if(value&&typeof value==='object'&&typeof value.toJSON==='function'){value=value.toJSON(key);}if(typeof rep==='function'){value=rep.call(holder,key,value);}switch(typeof value){case'string':return quote(value);case'number':return isFinite(value)?String(value):'null';case'boolean':case'null':return String(value);case'object':if(!value){return'null';}gap+=indent;partial=[];if(Object.prototype.toString.apply(value)==='[object Array]'){length=value.length;for(i=0;i<length;i+=1){partial[i]=str(i,value)||'null';}v=partial.length===0?'[]':gap?'[\n'+gap+partial.join(',\n'+gap)+'\n'+mind+']':'['+partial.join(',')+']';gap=mind;return v;}if(rep&&typeof rep==='object'){length=rep.length;for(i=0;i<length;i+=1){k=rep[i];if(typeof k==='string'){v=str(k,value);if(v){partial.push(quote(k)+(gap?': ':':')+v);}}}}else{for(k in value){if(Object.hasOwnProperty.call(value,k)){v=str(k,value);if(v){partial.push(quote(k)+(gap?': ':':')+v);}}}}v=partial.length===0?'{}':gap?'{\n'+gap+partial.join(',\n'+gap)+'\n'+mind+'}':'{'+partial.join(',')+'}';gap=mind;return v;}}if(typeof JSON.stringify!=='function'){JSON.stringify=function(value,replacer,space){var i;gap='';indent='';if(typeof space==='number'){for(i=0;i<space;i+=1){indent+=' ';}}else if(typeof space==='string'){indent=space;}rep=replacer;if(replacer&&typeof replacer!=='function'&&(typeof replacer!=='object'||typeof replacer.length!=='number')){throw new Error('JSON.stringify');}return str('',{'':value});};}if(typeof JSON.parse!=='function'){JSON.parse=function(text,reviver){var j;function walk(holder,key){var k,v,value=holder[key];if(value&&typeof value==='object'){for(k in value){if(Object.hasOwnProperty.call(value,k)){v=walk(value,k);if(v!==undefined){value[k]=v;}else{delete value[k];}}}}return reviver.call(holder,key,value);}text=String(text);cx.lastIndex=0;if(cx.test(text)){text=text.replace(cx,function(a){return'\\u'+('0000'+a.charCodeAt(0).toString(16)).slice(-4);});}if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,'@').replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,']').replace(/(?:^|:|,)(?:\s*\[)+/g,''))){j=eval('('+text+')');return typeof reviver==='function'?walk({'':j},''):j;}throw new SyntaxError('JSON.parse');};}}()); var JSON2 = JSON; var Cities = {}; var crestname = {}; var researchLevels = []; var Seed = unsafeWindow.seed; var Tabs = {}; var currentName = 'Overview'; var mainPop; var CPopUpTopClass = 'ptPopTop'; var KOCversion = null; var ptStartupTimer = null; var uW = unsafeWindow; function ptStartup (){ clearTimeout (ptStartupTimer); if (unsafeWindow.ptLoaded) return; var metc = getClientCoords(document.getElementById('main_engagement_tabs')); if (metc.width==null || metc.width==0){ ptStartupTimer = setTimeout (ptStartup, 1000); return; } serverID=/^[a-zA-Z]+([0-9]+)\./.exec(document.location.hostname); serverID=serverID[1]; unsafeWindow.ptLoaded = Version; KOCversion = anticd.getKOCversion(); logit ("KofC client version: "+ KOCversion); readOptions(); //logit ('g_timeoff: '+ unsafeWindow.g_timeoff); Seed = unsafeWindow.seed; var gmstyles = '\ .ptcastleButNon {background-image:url("'+ URL_CASTLE_BUT +'")}\ .ptcastleButSel {background-image:url("'+ URL_CASTLE_BUT_SEL +'")}\ .ptcastleBut {outline:0px; margin-left:0px; margin-right:0px; width:24px; height:26px; font-size:12px; font-weight:bold;}\ .ptcastleBut:hover {border-size:3px; border-color:#000;}\ '; var styles = '.xtab {padding-right: 5px; border:none; background:none; white-space:nowrap;}\ .pthostile td { background:#FF4040; }.ptfriendly td{background:lightblue; }.ptally td{background:royalblue; }\ .ptneutral td { background:#C8C8C8; }.ptunaligned td { background:gold; }\ .xtabBR {padding-right: 5px; border:none; background:none;}\ div.ptDiv {background-color:#f0f0f0;}\ table.ptTab tr td {border:none; background:none; white-space:nowrap;}\ table.ptTabPad tr td {border:none; background:none; white-space:nowrap; padding: 2px 4px 2px 4px;}\ table.ptTabBR tr td {border:none; background:none;}\ table.ptTabLined tr td {border:1px none none solid none;}\ table.ptTabOverview tr td {border-left:1px solid #ccc; white-space:nowrap; padding: 1px;}\ table.ptTabPad tr td.ptentry {background-color:#ffeecc; padding-left: 8px;}\ table.ptNoPad tr td {border:none; background:none; white-space:nowrap; padding:0px}\ table.ptPlayers tr td {background-color:none; padding-left:5px; padding-right:5px;}\ .ptOddrow {background-color:#eee}\ .ptstat {border:1px solid; border-color:#ffffff; font-weight:bold; padding-top:2px; padding-bottom:2px; text-align:center; color:#ffffff; background-color:#357}\ .ptStatLight {color:#ddd}\ .ptentry {padding: 7px; border:1px solid; border-color:#000000; background-color:#ffeecc; white-space:nowrap;}\ .ptErrText {font-weight:bold; color:#600000}\ button::-moz-focus-inner, input[type="submit"]::-moz-focus-inner { border: none; }\ .ptChatAttack {color: #000; font-weight:bold; background-color: #FF4D4D; }\ .ptChatWhisper {font-weight:bold;color:#FF0000}\ .ptChatAlliance {font-weight:bold}\ .ptChatScripter {color:#A56631; font-weight:bold;text-shadow: 1px 1px 1px #AAA; background-color:#E0E0E0;}\ .ptChatDoom {color: #FFF; background: #000; font-weight:bold; text-shadow: 0px 0px 2px #F21B50}\ .ptChatNotice {color: #000; background: #CCF; font-weight:bold; text-decoration:blink;}\ .ptChatOfficers {color:#000; font-weight:bold; background-color:#E0E0E0;}\ .ptChatGlobal {background-color: #CCCCFF}\ .ptChatGlobalBold {font-weight:bold}\ .ptChatGlobalAll {font-weight:bold;background-color: #CCCCFF}\ .ptChatIcon {border: 1px inset black}\ span.whiteOnRed {padding-left:3px; padding-right:3px; background-color:#700; color:white; font-weight:bold}\ span.boldRed {color:#800; font-weight:bold}\ span.boldDarkRed {color:#600; font-weight:bold}\ span.oohfancy {color:#0000; font-weight:bold;text-shadow: 1px 1px 1px #AAA; font-variant:small-caps; text-align:center}\ span.oohfancyi {color:#0000; font-style:italic;text-shadow: 1px 1px 1px #AAA; font-variant:small-caps; text-align:center}\ a.ptButton20 {color:#ffff80}\ hr.ptThin {padding:0px; margin:0px}\ input.pbSubtab {cursor:pointer; width:10em; margin-right:15px;}\ input.pbSubtabSel {background-color:#444; color:white; font-weight:bold; cursor:none !important}\ table.ptMainTab {empty-cells:show; margin-top:5px }\ table.ptMainTab tr td a {color:inherit }\ table.ptMainTab tr td {height:60%; empty-cells:show; padding: 0px 5px 0px 5px; margin-top:5px; white-space:nowrap; border: 1px solid; border-style: none none solid none; }\ table.ptMainTab tr td.spacer {padding: 0px 1.5px;}\ table.ptMainTab tr td.sel {font-weight:bold; font-size:13px; border: 1px solid; border-style: solid solid none solid; background-color:#eed; text-shadow: 0px 0px 1px #333;}\ table.ptMainTab tr td.notSel {font-weight:bold; font-size:13px; border: 1px solid; border-style: solid solid none solid; background-color:#161E8A; color:white; border-color:black; text-shadow: 0px 0px 1px #AAA;}\ tr.ptPopTop td { background-color:#dde; border:none; height: 21px; padding:0px; }\ tr.ptretry_ptPopTop td { background-color:#a00; color:#fff; border:none; height: 21px; padding:0px; }\ input.ptButCancel {background-color:#a00; font-weight:bold; color:#fff}\ .CPopup .CPopMain { background-color:#f8f8f8; padding:6px;}\ .CPopup {border:3px ridge #666} )'; logit ("* KOCpowerTools v"+ Version +" Loaded"); if (TEST_WIDE){ // max cityname len = 15? for(i=0; i<Seed.cities.length; i++){ Seed.cities[i][1] = Seed.cities[i][1] + 'LONGERNAMETEST'; Seed.cities[i][1] = Seed.cities[i][1].substr(0,15); } var numToAdd = TEST_WIDE_CITIES - Seed.cities.length; while (numToAdd-- > 0){ var cityId = Math.random() * 1234567; Seed.cities.push (Seed.cities[0]); } } setCities(); // TODO: Make sure WinPos is visible on-screen ? if (Options.ptWinPos==null || Options.ptWinPos.x==null|| Options.ptWinPos.x=='' || isNaN(Options.ptWinPos.x)){ //logit ( 'Options.ptWinPos: '+ inspect (Options.ptWinPos, 5, 1)); var c = getClientCoords (document.getElementById('main_engagement_tabs')); Options.ptWinPos.x = c.x+4; Options.ptWinPos.y = c.y+c.height; saveOptions (); } mainPop = new CPopup ('ptmain', Options.ptWinPos.x, Options.ptWinPos.y, 749,700, Options.ptWinDrag, function (){ tabManager.hideTab(); Options.ptWinIsOpen=false; saveOptions(); }); GM_addStyle (gmstyles); mainPop.getMainDiv().innerHTML = '<STYLE>'+ styles +'</style>'; getAllianceLeaders(); FoodAlerts.init(); TowerAlerts.init(); MessageCounts.init (); MapDistanceFix.init (); WarnZeroAttack.init (); AllianceReports.init (); messageNav.init(); PageNavigator.init (); ChatStuff.init (); AttackDialog.init(); battleReports.init (); CoordBox.init (); GMTclock.init (); tabManager.init (mainPop.getMainDiv()); //title = uW.document.getElementById('comm_tabs').innerHTML; //title += '<DIV><BR><FONT color=white><B> '+ getMyAlliance()[1] + ' (' + GetServerId() +')</b></font></div>'; //uW.document.getElementById('comm_tabs').innerHTML = title ; if (Options.ptWinIsOpen){ mainPop.show (true); tabManager.showTab(); } window.addEventListener('unload', onUnload, false); if (Options.fixTower) TowerAlerts.enableFixTarget(true); if (Options.fixTower2) TowerAlerts.enableFixFalseReports(true); AddMainTabLink(''+ getMyAlliance()[1] + '', eventHideShow, mouseMainTab); TestSomething.init (); //setInterval (function(){logit (inspect (getClientCoords (mainPop.getMainDiv()), 3, 1))}, 2000); } function onUnload (){ Options.ptWinPos = mainPop.getLocation(); saveOptions(); } var knightRoles = [ ['Foreman', 'politics', 'Pol'], ['Marshall', 'combat', 'Com'], ['Alchemystic', 'intelligence', 'Int'], ['Steward', 'resourcefulness', 'Res'], ]; var CoordBox = { init : function (){ var t = CoordBox; t.boxDiv = searchDOM (document.getElementById('maparea_map'), 'node.className=="mod_coord"', 3, false); t.setEnable (Options.mapCoordsTop); }, setEnable : function (tf){ var t = CoordBox; if (t.boxDiv == null) return; if (tf) t.boxDiv.style.zIndex = '100000'; else t.boxDiv.style.zIndex = '10011'; }, isAvailable : function (){ var t = CoordBox; return !(t.boxDiv==null); }, }; var TestSomething = { init : function (){ t = TestSomething; return; var ft = unsafeWindow.modal_messages.toString().replace (/}\s*$/, 'TESTmyHook(); }'); // logit ('FT: modal_messages = '+ ft); unsafeWindow.TESTmyHook = t.hook; /*** var scr = document.createElement('script'); scr.innerHTML = 'modal_messages = '+ ft; document.body.appendChild(scr); setTimeout ( function (){document.body.removeChild(scr);}, 500); ***/ //with (unsafeWindow){ // eval ('unsafeWindow.modal_messages = '+ ft); // eval ('modal_messages = function (){alert("xxx")}'); logit ("WITH"); unsafeWindow.modal_messages = eval ('function (){alert("xxx")}'); logit ("EVALED"); //} setTimeout ( function(){ var ft=unsafeWindow.modal_messages.toString(); logit('unsafeWindow.modal_messages:\n'+ ft.substr(ft.length-500)); }, 100); }, hook : function (){ logit ('TestSomething.hook'); logit ('tvuid: '+ tvuid); logit ('unsafeWindow.tvuid: '+ unsafeWindow.tvuid); }, } var battleReports = { init : function (){ var t = battleReports; t.getReportDisplayFunc = new CalterUwFunc ('getReportDisplay', [['return s.join("")', 'var themsg=s.join(""); themsg=getReportDisplay_hook(themsg, arguments[1]); return themsg']]); unsafeWindow.getReportDisplay_hook = t.hook; t.getReportDisplayFunc.setEnable (true); t.renderBattleReportFunc = new CalterUwFunc ('MarchReport.prototype.renderBattleReport', [['return k.join("")', 'var themsg=k.join(""); themsg=renderBattleReport_hook(themsg, this.rslt); return themsg']]); unsafeWindow.renderBattleReport_hook = t.hook2; t.renderBattleReportFunc.setEnable (true); t.renderButtonsFunc = new CalterUwFunc ('MarchReport.prototype.generateBackButton', [[/return \"(.*)\"/i, 'var msg="$1"; return battleReports_hook3(msg, this.rptid);']]); unsafeWindow.battleReports_hook3 = t.generateBackButtonHook; t.renderButtonsFunc.setEnable (true); unsafeWindow.deleteAreport = t.e_deleteReport; //setTimeout (function(){logit('MarchReport.prototype.generateBackButton:\n'+ unsafeWindow.MarchReport.prototype.generateBackButton.toString(), 3, 1)}, 100); }, isRoundsAvailable : function (){ var t = battleReports; return t.getReportDisplayFunc.isAvailable(); }, isDeleteAvailable : function (){ var t = battleReports; return t.renderButtonsFunc.isAvailable(); }, generateBackButtonHook : function (msg, rptid){ if (!Options.reportDeleteButton) return msg; var delBut = msg.replace ('onclick=\'', 'onclick=\'deleteAreport('+ rptid +',false); '); delBut = delBut.replace (/<span>(.*)<\/span>/, '<span>'+ unsafeWindow.g_js_strings.commonstr.deletetx +'</span>'); //logit ('DELBUT: '+ delBut); return msg + delBut; }, generateMoreButtonHook : function (msg, rptid){ //if (!Options.reportDeleteButton) // return msg; var MoreBut = msg.replace ('onclick=\'', 'onclick=\'deleteAreport('+ rptid +',false); '); MoreBut = MoreBut.replace (/<span>(.*)<\/span>/, '<span>'+ uW.g_js_strings.commonstr.deletetx +'</span>'); //logit ('DELBUT: '+ delBut); return msg + delBut; }, e_deleteReport : function (rptid){ var t = battleReports; t.ajaxDeleteMyReport (rptid); }, ajaxDeleteMyReport : function (rptid, isUnread, side, isCityReport, notify){ var params = unsafeWindow.Object.clone(unsafeWindow.g_ajaxparams); params.s0rids = rptid; params.s1rids = ''; params.cityrids = ''; new MyAjaxRequest(unsafeWindow.g_ajaxpath + "ajax/deleteCheckedReports.php" + unsafeWindow.g_ajaxsuffix, { method: "post", parameters: params, onSuccess: function (rslt) { if (rslt.ok && isUnread){ unsafeWindow.seed.newReportCount = parseInt(seed.newReportCount) - 1; unsafeWindow.messages_notify_bug() } if (notify) notify (rslt.errorMsg); }, onFailure: function () { if (notify) notify ('AJAX ERROR'); }, }); }, hook2 : function (msg, rslt){ if (rslt.rnds && Options.dispBattleRounds){ msg = msg.replace (/(Attackers.*?<span.*?)<\/div>/im, '$1<BR>Rounds: '+ rslt.rnds +'</div>'); } return msg; }, hook : function (msg, rslt){ if (rslt.rnds && Options.dispBattleRounds){ msg = msg.replace (/(Attackers <span.*?)<\/div>/im, '$1<BR>Rounds: '+ rslt.rnds +'</div>'); } return msg; }, } var anticd = { isInited : false, KOCversion : '?', init: function (){ if (this.isInited) return this.KOCversion; unsafeWindow.cm.cheatDetector.detect = eval ('function (){}'); var scripts = document.getElementsByTagName('script'); for (var i=0; i<scripts.length; i++){ if (scripts[i].src.indexOf('camelotmain') >=0){ break; } } if (i<scripts.length){ var m = scripts[i].src.match (/camelotmain-(.*).js/); if (m) this.KOCversion = m[1]; } this.isInited = true; // more coming soon :) }, getKOCversion : function (){ return this.KOCversion; }, } anticd.init (); /*** <img src='http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/avatars/25/m16.jpg'/> <div class='content'> <div class='info'> <a class='nm' onclick='Chat.viewProfile(this,9640194,false);return false;'>Lord Sasuke_of_leaf</a> <span class='time'>17:17</span> </div> <div class='clearfix'> <div class='tx'> if ur really bored try it </div> </div> </div> <img src="http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/avatars/25/f9.jpg"> <div class="content"> <div class="info"> <a class="nm" onclick="Chat.viewProfile(this,3813948,false);return false;">Lady Aerwyn</a> <b style="color: rgb(165, 102, 49); font-size: 9px;"> says to the alliance:</b> <span class="time">17:32</span> </div> <div class="clearfix"> <div class="tx"> ok, heading out to dinner with family... be back laters </div> </div> </div> WHISPER (chatDivContentHook) ..... <img src='http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/avatars/25/m1.jpg'/> <div class='content'> <div class='info'> <a class='nm' onclick='Chat.viewProfile(this,2282354,false);return false;'>Lord Jetson</a> <b style='color:#A56631;font-size:9px;'> whispers to you:</b> <span class='time'>17:46</span> </div> <div class='clearfix'> <div class='tx'> test </div> </div> </div> <div class="chatwrap clearfix direct"> <img src="http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/avatars/25/m1.jpg"> <div class="content"> <div class="info"> <span class="nm">Lord Jetson</span> <b style="color: rgb(165, 102, 49); font-size: 9px;"> whispers to <a onclick="Chat.viewProfile(this,2282354); return false;" class="nm">jetson</a>:</b> <span class="time">20:47</span> </div> <div class="clearfix"> <div class="tx"> test </div> </div> </div> </div> ****/ var ChatStuff = { chatDivContentFunc : null, getChatFunc : null, init : function (){ var t = ChatStuff; t.chatDivContentFunc = new CalterUwFunc ('Chat.chatDivContent', [['return e.join("");', 'var msg = e.join("");\n msg=chatDivContent_hook(msg);\n return msg;']]); unsafeWindow.chatDivContent_hook = t.chatDivContentHook; unsafeWindow.ptChatIconClicked = t.e_iconClicked; t.setEnable (Options.chatEnhance); uW.Chat.Methods.changeTab = 'Chat.changeTab function (a) {$("mod_comm_list" + this.chatType).hide();$("mod_comm_list" + a).show();$("comm_tabs").className = "comm_tabs seltab" + a;if ( a == 1) $("mod_comm_inpot").style.background = "E080808";this.chatType = a})'; }, isAvailable : function (){ var t = ChatStuff; t.chatDivContentFunc.isAvailable (); }, setEnable : function (tf){ var t = ChatStuff; t.chatDivContentFunc.setEnable (tf); }, e_iconClicked : function (name){ var e = document.getElementById('mod_comm_input'); name = name.replace(/°°/g,"'"); e.value = '@'+ name +' '; }, // "Report No: 5867445" ---> see unsafeWindow.modal_alliance_report_view() chatDivContentHook : function (msg){ var t = ChatStuff; var element_class = ''; var m = /div class='info'>.*<\/div>/im.exec(msg); if (m == null) return msg; var whisp = m[0]; if (m[0].indexOf('whispers') >= 0) { if (Options.chatwhisper) { if (whisp.indexOf('says to the alliance') <0) element_class = 'ptChatWhisper'; } else element_class = ''; } else if (m[0].indexOf('to the alliance') >= 0){ if (Options.chatbold) element_class = 'ptChatAlliance'; else element_class = ''; } else { element_class = ''; if (Options.chatbold) element_class = 'ptChatGlobalBold'; if (Options.chatglobal){ element_class = 'ptChatGlobal'; } if (Options.chatbold && Options.chatglobal) element_class = 'ptChatGlobalAll'; } if (m[0].indexOf('My embassy has') >= 0 && Options.chatAttack) element_class = 'ptChatAttack'; if (m[0].indexOf('My wilderness at') >= 0 && Options.chatAttack) element_class = 'ptChatAttack'; if (m[0].indexOf('NOTICE') >= 0) element_class = 'ptChatNotice'; if (m[0].indexOf('DOOM') >= 0) element_class = 'ptChatDoom'; var scripters = ["7552815","10681588","1747877","2865067","10153485","15182839","1550996","1617431819","9688786","9751486"]; var suid = m[0].substring(m[0].indexOf('Chat.viewProfile(this,')+22,m[0].indexOf(',false);return false;')); var IsMe = false; if (Options.chatLeaders) { if (Options.AllianceLeaders.indexOf(uW.tvuid) >= 0 && suid.substr(0, 3)=="div") IsMe = true; if (Options.AllianceLeaders.indexOf(suid) >= 0 || IsMe) element_class = 'ptChatOfficers'; } IsMe = false; if (scripters.indexOf(uW.tvuid) >= 0 && suid.substr(0, 3)=="div") IsMe = true; if (scripters.indexOf(suid) >= 0 || IsMe) element_class = 'ptChatScripter'; msg = msg.replace ("class='content'", "class='content "+ element_class +"'"); //if (msg.indexOf('claimAllianceChat')<0){ // msg = msg.replace (/([0-9]{1,3})\s*(,|-)\s*([0-9]{1,3})/img, '<A onclick=\"ptGotoMap($1,$3)\">$1$2$3</a>'); //} var m = /(Lord|Lady) (.*?)</im.exec(msg); if (m != null) m[2] = m[2].replace(/\'/g,"°°"); msg = msg.replace (/<img (.*?>)/img, '<A onclick=\"ptChatIconClicked(\''+ m[2] +'\')\"><img class=\"ptChatIcon\" $1</a>'); if (whisp.indexOf('whispers to you') >= 0 && Options.enableWhisperAlert) { if (whisp.indexOf('says to the alliance') < 0) msg +='<span id="dummy"><iframe src="http://koc.god-like.info/doorbell.html" height="0" width="0"></iframe></span>'; } if (whisp.indexOf('My embassy has') >= 0 && Options.enableTowerAlert) { msg +='<span id="dummy"><iframe src="http://koc.god-like.info/alarm2.html" height="0" width="0"></iframe></span>'; } if (whisp.indexOf('My wilderness at') >= 0 && Options.enableTowerAlert) { msg +='<span id="dummy"><iframe src="http://koc.god-like.info/alarm2.html" height="0" width="0"></iframe></span>'; } return msg; }, } // useless :( ...... /***/ /*** RSLT: (string) s0Kid = 57526 (string) s1Kid = 35216 (string) s1KLv = 1 (number) s0KCombatLv = 0 (string) s1KCombatLv = Higher (object) fght = [object Object] (object) s1 = [object Object] (array) u2 = 89000,89000 (string) 0 = 89000 (number) 1 = 89000 (array) u9 = 1000,1000 (string) 0 = 1000 (number) 1 = 1000 (number) rnds = 3 (number) winner = 1 (number) wall = 100 (number) s0atkBoost = 0 (number) s0defBoost = 0 (number) s1atkBoost = 0 (number) s1defBoost = 0.2 (boolean) conquered = false (array) loot = 111139,763000,643000,78000,138000 (number) 0 = 111139 (number) 1 = 763000 (number) 2 = 643000 (number) 3 = 78000 (number) 4 = 138000 (string) errorMsg = Something has gone wrong! Please try again, or refresh if this message reappear ***/ /***/ function displayReport (rptid, side){ var params = unsafeWindow.Object.clone(unsafeWindow.g_ajaxparams); params.rid = rptid; params.side = side; new MyAjaxRequest(unsafeWindow.g_ajaxpath + "ajax/fetchReport.php" + unsafeWindow.g_ajaxsuffix, { method: "post", parameters: params, onSuccess: function (rslt) { logit (inspect (rslt, 5, 1)); if (notify) notify (rslt.errorMsg); }, onFailure: function () { if (notify) notify ('AJAX ERROR'); }, }); } /***/ /*************** WILDS TAB *********************/ var wildNames = { 0: 'Bog', 10: 'Grassland', 11: 'Lake', 20: 'Woods', 30: 'Hills', 40: 'Mountain', 50: 'Plain', }; var mercNames = { 0: 'None', 1: 'Novice', 2: 'Intermediate', 3: 'Veteran', }; Tabs.Wilds = { tabOrder : 35, cont : null, // state : null, upGoldTimer : null, wildList : [], buildList : {}, init : function (div){ var t = Tabs.Wilds; t.cont = div; unsafeWindow.ptButMaxTraps = t.e_butMaxTraps; unsafeWindow.ptInpWildTraps = t.e_inpTraps; unsafeWindow.ptButWildSet = t.e_butWildSet; t.cont.innerHTML = '<DIV id=wildContent style="maxheight:665px; height:665px; overflow-y:auto">'; // t.show (); }, hide : function (){ var t = Tabs.Wilds; clearTimeout (t.upGoldTimer); }, show : function (){ var t = Tabs.Wilds; clearTimeout (t.upGoldTimer); m = '<CENTER>'+ strButton20('RESET', 'id=ptwref') +'</center><TABLE cellspacing=0 cellpadding=0 class=ptTabPad align=center>'; for (var c=0; c<Cities.numCities; c++){ var city = Cities.cities[c]; var cWilds = Seed.wilderness['city'+city.id]; t.wildList[c] = []; var castle = parseInt(Seed.buildings['city'+ city.id].pos0[1]); if(castle == 11) castle = 12; if(castle == 12) castle = 14; var totw = 0; if (matTypeof(cWilds)=='object'){ for (var k in cWilds) ++totw; } m += '<TR><TD colspan=20><DIV class=ptstat><TABLE class=ptNoPad width=100%><TR><TD width=100></td><TD width=90% align=center>'+ city.name +' ('+ city.x +','+ city.y +')</td><TD width=100 align=right>Wilds: '+ totw +' of '+ castle +' </TD></tr></table></div></td></tr>'; var row = 0; var sortem = []; if (matTypeof(cWilds) != 'array') { m += '<TR style="background-color:white; font-weight:bold;" align=right><TD align=left>Wild Type</td><TD></td><TD align=left>Coords</td><TD>Traps</td><TD align=left>Mercenaries</td>\ <TD width=15></td><TD colspan=3 class=entry>'+ htmlTitleLine(' CHANGE DEFENSES ') +'</td></tr>'; for (var k in Seed.wilderness['city'+city.id]) sortem.push (Seed.wilderness['city'+city.id][k]); sortem.sort (function (a,b){ var x; if ((x = b.tileLevel-a.tileLevel)!=0) return x; return a.tileType-b.tileType; }); for (i=0; i<sortem.length; i++){ var wild = sortem[i]; var wildDef = Seed.wildDef['t'+wild.tileId]; if (wildDef==undefined || !wildDef) wildDef = {fort60Count:0, mercLevel:0}; var maxTraps = parseInt(wild.tileLevel)*100; var maxBuild = maxTraps - parseInt(wildDef.fort60Count); t.wildList[c][i] = [wild.tileId, maxBuild]; m += '<TR align=right'+ (row++%2?'':' class=ptOddrow') +'><TD align=left>'+ wildNames[wild.tileType] +'</td>\ <TD>'+ wild.tileLevel +'</td><TD align=center><A onclick="ptGotoMap('+ wild.xCoord +','+ wild.yCoord +')">'+ wild.xCoord +','+ wild.yCoord +'</a></td>\ <TD align=right><B>'+ wildDef.fort60Count +'</b></td><TD align=center><B>'+ mercNames[wildDef.mercLevel] +'</b></td>\ <TD></td><TD align=left class=ptentry><B>Build Traps:</b> <INPUT onchange="ptInpWildTraps(this)" id=ptwt_'+ c +'_'+ i + (maxBuild==0?' DISABLED ':'')+' style="margin:0px; padding:0px" type=text size=3 maxlength=4></td>' if (wildDef.fort60Count < maxTraps) m += '<TD class=ptentry style="padding:0px">'+ strButton14('Max', 'id=ptwx_'+ c +'_'+ i +' onclick="ptButMaxTraps(this)"') +'</td>'; else m += '<TD class=ptentry></td>'; m += '<TD class=ptentry> <B>Mercs:</b> ' + htmlSelector(mercNames, wildDef.mercLevel, 'id=ptwm_'+ c +'_'+ i) +' </td></tr>'; } m += '<TR><TD colspan=6></td><TD class=ptentry align=center colspan=3><TABLE><TR><TD width=40% align=left>Cost: <SPAN id=ptwgc_'+ c +'>0</span></td>\ <TD width=10%>'+ strButton20("SET DEFENSES", 'onclick="ptButWildSet('+ c +')"') +'<TD width=40% align=right>Gold: <SPAN id=ptwgt_'+ c +'>0</span></td></td></tr></table></td></tr>'; } else { m+= '<TR><TD colspan=9> </td></tr>'; } } document.getElementById('wildContent').innerHTML = m + '</table></div>'; document.getElementById('ptwref').addEventListener ('click', t.show, false); t.updateGold (); }, e_butWildSet : function (c){ var t = Tabs.Wilds; var totTraps = 0; var cid = Cities.cities[c].id; t.buildList = {cityId:cid, list:[]}; for (var w=0; w<t.wildList[c].length; w++){ var wild = Seed.wilderness['city'+cid]['t'+t.wildList[c][w][0]]; var wildDef = Seed.wildDef['t'+t.wildList[c][w][0]]; // TODO: Seed.wildDef is null if just aquired if (wildDef==undefined || !wildDef) wildDef = {fort60Count:0, mercLevel:0}; var numTraps = parseInt(document.getElementById('ptwt_'+ c +'_'+ w).value, 10); if (isNaN(numTraps)) numTraps = 0; totTraps += numTraps; if (numTraps > 0) t.buildList.list.push (['T', wild.tileId, numTraps]); var mercId =document.getElementById('ptwm_'+ c +'_'+ w).value; if (wildDef.mercLevel != mercId) t.buildList.list.push (['M', wild.tileId, mercId, wildDef.mercLevel]); } var totCost = totTraps * 200; if (totCost > parseInt(Seed.citystats['city'+cid].gold[0])){ document.getElementById('ptwgc_'+ c).innerHTML = '<SPAN class=boldRed>'+ addCommasInt(totCost) +'</span>'; return; } if (t.buildList.list.length == 0) return; t.setCurtain (true); var popDiv = t.setPopup (true); popDiv.innerHTML = '<TABLE class=ptTab width=100% height=100%><TR><TD>\ <DIV class=ptstat>Setting Wilderness Defenses</div>\ <DIV id=ptWildBuildDiv class=ptDiv style="padding:10px; height:225px; max-height:225px; overflow-y:auto"></div>\ </td></tr><TR><TD align=center>'+ strButton20('CANCEL', 'id=ptWildCancel') +'</td></tr></table>'; document.getElementById('ptWildCancel').addEventListener('click', t.e_buildCancel, false); t.processQue(null); }, e_buildCancel : function (){ var t = Tabs.Wilds; t.setCurtain(false); t.setPopup(false); t.show(); }, processQue : function (errMsg){ var t = Tabs.Wilds; var what = t.buildList.list.shift(); var div = document.getElementById('ptWildBuildDiv'); if (what==null || errMsg){ if (errMsg) div.innerHTML += '<BR><SPAN style="white-space:normal;" class=boldRed>ERROR: '+ errMsg +'</span>'; else div.innerHTML += 'Done.<BR>'; document.getElementById('ptWildCancel').firstChild.innerHTML = 'CLOSE'; return; } if (div.innerHTML != '') div.innerHTML += 'Done.<BR>'; var wild = Seed.wilderness['city'+ t.buildList.cityId]['t'+what[1]]; if (what[0] == 'T'){ div.innerHTML += 'Building '+ what[2] +' traps for '+ Cities.byID[t.buildList.cityId].name +'\'s wilderness at '+ wild.xCoord +','+ wild.yCoord +' ... '; t.postBuyTraps (t.buildList.cityId, what[1], what[2], t.processQue); } else { div.innerHTML += 'Setting Mercenaries to '+ mercNames[what[2]] +' for '+ Cities.byID[t.buildList.cityId].name +'\'s wilderness at '+ wild.xCoord +','+ wild.yCoord +' ... '; t.postHireMercs (t.buildList.cityId, what[1], what[2], what[3], t.processQue); } }, setPopup : function (onoff){ var t = Tabs.Wilds; if (onoff){ var div = document.createElement('div'); div.id = 'ptWildPop'; div.style.backgroundColor = '#fff'; div.style.zindex = mainPop.div.zIndex+2; div.style.opacity = '1'; div.style.border = '3px outset red'; div.style.width = '550px'; div.style.height = '300px'; div.style.display = 'block'; div.style.position = 'absolute'; div.style.top = '100px'; div.style.left = '100px'; t.cont.appendChild (div); return div; } else { t.cont.removeChild (document.getElementById('ptWildPop')); } }, setCurtain : function (onoff){ var t = Tabs.Wilds; if (onoff){ var off = getAbsoluteOffsets (t.cont); var curtain = document.createElement('div'); curtain.id = 'ptWildCurtain'; curtain.style.zindex = mainPop.div.zIndex+1; curtain.style.backgroundColor = "#000000"; curtain.style.opacity = '0.5'; curtain.style.width = t.cont.clientWidth +'px'; curtain.style.height = t.cont.clientHeight +'px'; curtain.style.display = 'block'; curtain.style.position = 'absolute'; curtain.style.top = off.top + 'px'; curtain.style.left = off.left + 'px'; t.cont.appendChild (curtain); } else { t.cont.removeChild (document.getElementById('ptWildCurtain')); } }, e_butMaxTraps : function (e){ var t = Tabs.Wilds; var c = e.id.substr(5,1); var w = e.id.substr(7); var inp = document.getElementById('ptwt_'+ c +'_'+ w); inp.value = t.wildList[c][w][1]; t.e_inpTraps (inp); }, e_inpTraps : function (e){ var t = Tabs.Wilds; var c = e.id.substr(5,1); var w = e.id.substr (7); var tot = 0; for (var i=0; i<t.wildList[c].length; i++) { var val = parseInt(document.getElementById('ptwt_'+ c +'_'+ i).value, 10); if (isNaN(val)) val = 0; tot += val; } document.getElementById('ptwgc_'+ c).innerHTML = addCommasInt(tot * 200); if (isNaN(e.value) || e.value<0 || e.value>t.wildList[c][w][1]){ e.value = ''; e.style.backgroundColor = '#ffaaaa'; } else e.style.backgroundColor = null; }, updateGold : function (){ var t = Tabs.Wilds; for (var c=0; c<Cities.numCities; c++){ var e = document.getElementById('ptwgt_'+ c +''); if (e) e.innerHTML = addCommasInt(Seed.citystats['city'+Cities.cities[c].id].gold[0]); } t.upGoldTimer = setTimeout (t.updateGold, 2000); }, postBuyTraps : function (cid, tid, quant, notify){ if (DISABLE_POST_DEFENSES){ setTimeout (function (){notify(null)}, 1500); return; } var params = unsafeWindow.Object.clone(unsafeWindow.g_ajaxparams); params.cid = cid; params.tid = tid; params.quant = quant; new MyAjaxRequest(unsafeWindow.g_ajaxpath + "ajax/buyWildTraps.php" + unsafeWindow.g_ajaxsuffix, { method: "post", parameters: params, onSuccess: function (rslt) { if (rslt.ok){ if (!Seed.wildDef["t"+ tid]) Seed.wildDef["t"+ tid] = {tileId:tid, fort60Count:0, mercLevel:0}; Seed.wildDef["t"+ tid].fort60Count = parseInt(Seed.wildDef["t"+ tid].fort60Count) + parseInt(quant); } if (notify) notify (rslt.errorMsg); }, onFailure: function () { if (notify) notify ('AJAX ERROR'); }, }); }, postHireMercs : function (cid, tid, newLevel, oldLevel, notify){ if (DISABLE_POST_DEFENSES){ setTimeout (function (){notify('OK, so it\'s not really an error, it\'s just George playing around to see how the error message looks. It\'s a long one, how does it fit? Is it OK? Are you sure? JANE! Get me off of this thing!')}, 1500); return; } var params = unsafeWindow.Object.clone(unsafeWindow.g_ajaxparams); params.cid = cid; params.tid = tid; params.lv = newLevel; params.olv = oldLevel; new MyAjaxRequest(unsafeWindow.g_ajaxpath + "ajax/hireWildMerc.php" + unsafeWindow.g_ajaxsuffix, { method: "post", parameters: params, onSuccess: function (rslt) { if (rslt.ok){ if (!Seed.wildDef["t"+ tid]) Seed.wildDef["t"+ tid] = {tileId:tid, fort60Count:0, mercLevel:0}; Seed.wildDef["t"+ tid].mercLevel = newLevel; } if (notify) notify (rslt.errorMsg); }, onFailure: function () { if (notify) notify ('AJAX ERROR'); }, }); }, } /*************** KNIGHTS TAB *********************/ Tabs.Knights = { tabOrder : 30, cont : null, displayTimer : null, init : function (div){ var t = Tabs.Knights; t.cont = div; unsafeWindow.ptAssignSkill = t.clickedAssignPoints; t.cont.innerHTML = '<STYLE>table.ptTabPad tr.ptwpad {background-color:#ffffff; padding-left:15px}</style>\ <DIV id=ptknightdiv style="max-height:660px; height:660px; overflow-y:auto">'; }, hide : function (){ var t = Tabs.Knights; clearTimeout (t.displayTimer); }, show : function (){ var t = Tabs.Knights; clearTimeout (t.displayTimer); function _dispKnight (roleId, knight){ var rid = roleId; if (roleId==null) rid = 1; var sty=''; if (row++ % 2) sty = 'class=ptOddrow '; m = '<TR '+ sty +'valign=top align=right><TD><B>'+ (roleId==null ? '':knightRoles[rid][0]) +'</b></td><TD align=left>'; if (knight == null) { m += '--------</td><TD colspan=4></td><TD class=ptentry colspan=5></td><TD colspan=2></td></tr>'; } else { var level = parseInt(Math.sqrt(parseInt(knight.experience) / 75)) + 1; var unpoints = level - parseInt(knight.skillPointsApplied); var salary = (parseInt(knight.skillPointsApplied) + 1) * 20; totSalary += salary; var ass = ''; if (knight.knightStatus == 10){ ass = '<TD class=ptentry align=left colspan=4>Marching</td>'; } else { if (unpoints > 0){ unpoints = '<SPAN class="boldRed">'+ unpoints +'</span>'; for (var i=0; i<4; i++){ var sty = 'padding-left:1px;'; if (i == rid) // bold it sty += 'font-weight:bold;color:#116654'; ass += '<TD class=ptentry align=left style="'+ sty +'" ><A style="'+ sty +'" onclick="ptAssignSkill(this,' + cid +','+ knight.knightId +','+ i +')">['+ knightRoles[i][2] +'] </a></td>'; } } else ass = '<TD class=ptentry colspan=4></td>'; } var skills = []; for (var i=0; i<4; i++){ if (i == rid) skills[i] = '<B>'+ knight[knightRoles[i][1]] +'</b>'; else skills[i] = knight[knightRoles[i][1]]; } m += knight.knightName + '</td><TD>'+ skills[0] +'</td><TD>'+ skills[1] +'</td><TD>'+ skills[2] +'</td><TD>' + skills[3] +'</td><TD class=ptentry>'+ unpoints +'</td>'+ ass +'<TD>'+ addCommas(salary) +'</td><TD>'+ level +'</td></tr>'; } return m; } var totSalary = 0; var m = '<TABLE cellspacing=0 align=center class=ptTabPad><TBODY>'; for (var c=0; c<Cities.numCities; c++) { var cid = Cities.cities[c].id; m += '<TR><TD colspan=13><DIV class=ptstat>'+ Cities.cities[c].name +'</div></td></tr>\ <TR class=ptwpad style="font-weight:bold" align=right><TD width=70>Role</td><TD width=160 align=center>Name</td><TD width=26>Pol</td><TD width=26>Com</td>\ <TD width=26>Int</td><TD width=26>Res</td><TD width=90 align=center colspan=5>--- Unassigned ---</td><TD width=40 align=right> Salary </td><TD width=35>Level</td></tr>'; totSalary = 0; var did = {}; var row = 0; for (var i=0; i<knightRoles.length; i++){ var leader = Seed.leaders['city'+cid][knightRoles[i][1]+'KnightId']; if (leader == 0) m += _dispKnight (i, null); else { m += _dispKnight (i, Seed.knights['city'+cid]['knt'+leader]); did['knt'+leader] = true; } } var list = []; for (k in Seed.knights['city'+cid]){ if (!did[k]) list.push (Seed.knights['city'+cid][k]); } list.sort (function (a,b){return parseInt(b.combat)-parseInt(a.combat)}); for (i=0; i<list.length; i++) m += _dispKnight (null, list[i]); m += '<TR align=right><TD colspan=11><B>Total Salary:</b></td><TD>'+ addCommas(totSalary) +'</td></tr>'; } document.getElementById('ptknightdiv').innerHTML = m +'</tbody></table></div>'; t.displayTimer = setTimeout (t.show, 10000); }, clickedAssignPoints : function (e, cid, kid, rid){ var t = Tabs.Knights; clearTimeout (t.displayTimer); var knight = Seed.knights['city'+cid]['knt'+kid]; if (knight.knightStatus == 10){ var row = e.parentNode.parentNode; row.childNodes[7].innerHTML = 'Marching'; return; } sk = []; var unassigned = parseInt(Math.sqrt(parseInt(knight.experience)/75)) + 1 - parseInt(knight.skillPointsApplied); for (var i=0; i<4; i++){ sk[i] = parseInt(knight[knightRoles[i][1]]); if (i == rid) sk[i] += unassigned; } var row = e.parentNode.parentNode; for (i=row.cells.length-1; i>=1; i--) row.deleteCell (i); var newCell=row.insertCell(-1); newCell.colSpan = 12; newCell.align= 'left'; newCell.style.padding='1px 5px 1px 10px'; var div = document.createElement ('div'); div.style.backgroundColor = '#ffffff'; div.style.textAlign = 'center'; div.style.border = '1px solid'; div.style.width = '98%'; div.style.whiteSpace = 'normal'; newCell.appendChild (div); div.innerHTML = 'Assigning '+ unassigned +' skill points to '+ knightRoles[rid][1] +' ... '; t.postSkillPoints (cid, kid, sk[0], sk[1], sk[2], sk[3], function (r){t.postDone(r, div)}); }, postDone : function (rslt, div){ var t = Tabs.Knights; clearTimeout (t.displayTimer); if (rslt.ok){ div.innerHTML += '<B>Done.</b>'; t.displayTimer = setTimeout (t.show, 5000); } else { div.innerHTML += '<BR><SPAN class=boldRed>ERROR: '+ rslt.errorMsg +'</span>'; t.displayTimer = setTimeout (t.show, 10000); } }, postSkillPoints : function (cid, kid, pol, com, int, res, notify){ var params = unsafeWindow.Object.clone(unsafeWindow.g_ajaxparams); params.cid = cid; params.kid = kid; params.p = pol; params.c = com; params.i = int; params.r = res; if (DISABLE_POST_KNIGHT_SKILLS){ setTimeout (function (){notify({ok:true})}, 1500); // setTimeout ( function (){notify({ok:false, errorMsg:"FAKE ERROR message, a long one, to test how it will fit and overflow! Perhaps you'll need to retry?"})} , 2000); return; } new MyAjaxRequest(unsafeWindow.g_ajaxpath + "ajax/skillupKnight.php" + unsafeWindow.g_ajaxsuffix, { method: "post", parameters: params, onSuccess: function (rslt) { if (rslt.ok) { var knight = Seed.knights["city" + cid]["knt" + kid]; var up = pol + com + int + res - knight.politics - knight.combat - knight.intelligence - knight.resourcefulness; knight.politics = pol; knight.combat = com; knight.intelligence = int; knight.resourcefulness = res; knight.skillPointsApplied = (parseInt(knight.skillPointsApplied) + up).toString(); } if (notify) notify (rslt); }, onFailure: function () { if (notify) notify (rslt); }, }); }, }; /**************/ var messageNav = { mmFunc : null, mmsFunc : null, init : function (){ t = messageNav; t.mmFunc = new CalterUwFunc ('modal_messages', [[/}\s*$/, 'setTimeout(messageNav_hook,0); }']]); t.mmsFunc = new CalterUwFunc ('modal_messages_send', [[/{\s*var params/i, '{\nif (modal_messages_send_hook()) return;\nvar params']]); unsafeWindow.messageNav_hook = messageNav.hook; unsafeWindow.modal_messages_send_hook = messageNav.msgSendHook; t.mmFunc.setEnable (true); t.mmsFunc.setEnable (true); }, setEnable : function (tf){ }, isAvailable : function (){ t = messageNav; return t.mmFunc.isAvailable(); }, hook : function (){ if (!Options.enhanceMsging) return; var div = document.getElementById('modal_msg_view_actions'); var but = makeButton20('Forward'); div.appendChild (but); but.addEventListener ('click', messageNav.eventForward, false); div = document.getElementById('modal_msg_write_to').parentNode; div.innerHTML = '<TABLE><TR><TD class=xtab><b>To:</b> <INPUT type=text id=modal_msg_write_to></td><TD class=xtab><SPAN id=ptfwdbut></span></td></tr></table>'; var button = makeButton20('All Officers'); document.getElementById('ptfwdbut').appendChild (button); button.addEventListener ('click', function (){document.getElementById("modal_msg_write_to").value = "<officers>"}, false); }, eventForward : function (){ document.getElementById('modal_msg_write_subj').value = "fwd: " + document.getElementById('modal_msg_view_subj').innerHTML.toString().stripTags(); document.getElementById('modal_msg_write_to').value = ''; var from = document.getElementById('modal_msg_view_from').children[0].innerHTML; var body = document.getElementById('modal_msg_view_body').innerHTML.replace(/\n/g, '').replace(/<br>/gi, '\n').stripTags().replace (/back$/i, ''); document.getElementById('modal_msg_write_txt').value = '[Original message from '+ from +' follows:]\n'+ body; unsafeWindow.modal_messages_compose(); }, msgSendHook : function (){ if (!Options.enhanceMsging) return; var to = document.getElementById("modal_msg_write_to").value.trim(); if (to.toLowerCase() != '<officers>' || getMyAlliance()[0]==0) return false; var params = unsafeWindow.Object.clone(unsafeWindow.g_ajaxparams); params.toIds = getMyAlliance()[0]; params.subject = document.getElementById("modal_msg_write_subj").value +' [Sent to all officers]'; params.message = document.getElementById("modal_msg_write_txt").value; params.type = 'alliance'; new AjaxRequest(unsafeWindow.g_ajaxpath + "ajax/sendMessage.php" + unsafeWindow.g_ajaxsuffix, { method: "post", parameters: params, onSuccess: function (message) { var rslt = eval("(" + message.responseText + ")"); if (rslt.ok) { unsafeWindow.Modal.showAlert(unsafeWindow.g_js_strings.modal_messages_send.msgsent); document.getElementById('modal_msg_write_to').value = ""; document.getElementById('modal_msg_write_subj').value = ""; document.getElementById('modal_msg_write_txt').value = "" } else { unsafeWindow.Modal.showAlert(unsafeWindow.g_js_strings.modal_messages_send.enterexistingname) } }, onFailure: function () { unsafeWindow.Modal.showAlert(unsafeWindow.g_js_strings.modal_messages_send.oopscompose) }, }); return true; }, } var AttackDialog = { init : function (){ var t = AttackDialog; t.modal_attackFunc = new CalterUwFunc ('modal_attack', [[/}\s*$/, 'attackDialog_hook(); }']]); unsafeWindow.attackDialog_hook = t.modalAttackHook; t.modal_attackFunc.setEnable (true); }, setEnable : function (){ }, isKnightSelectAvailable : function (){ var t = AttackDialog; return t.modal_attackFunc.isAvailable(); }, isAttackCityPickerAvailable : function (){ var t = AttackDialog; return t.modal_attackFunc.isAvailable(); }, modalAttackHook : function (){ var t = AttackDialog; if (Options.fixKnightSelect || Options.attackCityPicker){ for (var i=1; i<6; i++) document.getElementById('modal_attack_tab_'+ i).addEventListener('click', t.e_changeMarchType, false); } if (Options.attackCityPicker){ setTimeout (t.initCityPicker, 0); } }, initCityPicker : function (){ var t = AttackDialog; var div = document.getElementById('modal_attack_target_numflag'); // as of KofC version 96; var mySpan; if (div) { div.parentNode.innerHTML += ' <SPAN id=modal_attack_citybuts></span>'; } else { var span = document.getElementById('modal_attack_target_coords'); // KofC version 116+; span.parentNode.parentNode.firstChild.innerHTML += ' <SPAN id=modal_attack_citybuts></span>'; } new CdispCityPicker ('ptatp', document.getElementById('modal_attack_citybuts'), false, t.e_CityButton); var cityIdx = Cities.byID[unsafeWindow.currentcityid].idx; thisCityBut = document.getElementById('ptatp_'+ cityIdx); thisCityBut.style.opacity = '0.5'; thisCityBut.disabled = true; if (document.getElementById('modal_attack_tab_4').className=='selected' || document.getElementById('modal_attack_tab_3').className=='selected') // don't do for attack or scout document.getElementById('modal_attack_citybuts').style.display = 'none'; }, e_CityButton : function (city){ document.getElementById('modal_attack_target_coords_x').value = city.x; document.getElementById('modal_attack_target_coords_y').value = city.y; unsafeWindow.modal_attack_update_time(); }, e_changeMarchType : function (evt){ var t = AttackDialog; var marchType = parseInt(evt.target.id.substr(17)); if (Options.attackCityPicker){ if (marchType==3 || marchType==4) document.getElementById('modal_attack_citybuts').style.display = 'none'; else document.getElementById('modal_attack_citybuts').style.display = 'inline'; } if (Options.fixKnightSelect){ var knightVal = 0; var selector = document.getElementById('modal_attack_knight'); if (selector.length>1 && (marchType==4 || marchType==2)) // if 'attack' or 'reinforce' knightVal = 1; selector.selectedIndex = knightVal; } }, } var AllianceReports = { checkPeriod : 300, allianceNames : [], saveArfunc : unsafeWindow.allianceReports, init : function (){ t = AllianceReports; t.enable (Options.enhanceARpts); t.marvFunc = new CalterUwFunc ('modal_alliance_report_view', [['getReportDisplay', 'getReportDisplay_hook2']]); unsafeWindow.getReportDisplay_hook2 = t.getReportDisplayHook; t.marvFunc.setEnable (true); }, getReportDisplayHook : function (a, b){ var x = ''; try { x = unsafeWindow.getReportDisplay(a,b); } catch (e){ x = 'Error formatting report: '+ e; } return x; }, enable : function (tf){ t = AllianceReports; if (tf) unsafeWindow.allianceReports = t.myAllianceReports; else unsafeWindow.allianceReports = t.saveArfunc; }, myAllianceReports : function (pageNum){ var params = unsafeWindow.Object.clone(unsafeWindow.g_ajaxparams); if (pageNum) params.pageNo = pageNum; params.group = "a"; new MyAjaxRequest(unsafeWindow.g_ajaxpath + "ajax/listReports.php" + unsafeWindow.g_ajaxsuffix, { method: "post", parameters: params, onSuccess: function (rslt) { //logit (inspect (rslt, 1, 1)); displayReports (rslt.arReports, rslt.arPlayerNames, rslt.arAllianceNames, rslt.arCityNames, rslt.totalPages); }, onFailure: function (rslt) { }, }, false); function displayReports (ar, playerNames, allianceNames, cityNames, totalPages){ var msg = new Array(); var myAllianceId = getMyAlliance()[0]; msg.push ("<STYLE>.msgviewtable tbody .myCol div {margin-left:5px; overflow:hidden; white-space:nowrap; color:#000}\ .msgviewtable tbody .myHostile div {font-weight:600; color:#600}\ .msgviewtable tbody .myGray div {color:#666}\ .msgviewtable tbody .myRein div {color:#050}\ .msgviewtable tbody .myWarn div {font-weight:600; color:#442200}\ </style>"); msg.push("<div class='modal_msg_reports'>"); var rptkeys = unsafeWindow.Object.keys(ar); if (matTypeof(ar) != 'array') { //logit ('displayReports: '+ Options.allowAlterAR); if (Options.allowAlterAR) msg.push("<div id='modal_alliance_reports_tablediv' class='modal_msg_list'><table width=675 cellpadding='0' cellspacing='0' class='msgviewtable reportviewtable alliancetable'>"); else msg.push("<div id='modal_alliance_reports_tabledivNKA' class='modal_msg_list'><table width=675 cellpadding='0' cellspacing='0' class='msgviewtable reportviewtable alliancetable'>"); msg.push("<thead><tr><td width=105>Date</td><td width=40>Type</td><td width=150>Attacker</td><td>Target</td><td>View</td></tr></thead><tbody>"); for (var i = 0; i < rptkeys.length; i++) { var rpt = ar[rptkeys[i]]; var colClass = '"myCol"'; rpt.marchType = parseInt(rpt.marchType); rpt.side0AllianceId = parseInt(rpt.side0AllianceId); var targetDiplomacy = getDiplomacy (rpt.side0AllianceId); if (rpt.marchType == 2){ colClass = '"myCol myRein"'; } else if (rpt.side1AllianceId != myAllianceId){ colClass = '"myCol myHostile"'; } else { if (parseInt(rpt.side0TileType) < 50){ // if wild if (parseInt(rpt.side0PlayerId) == 0) colClass = '"myCol myGray"'; else colClass = '"myCol myWarn"'; } else if (parseInt(rpt.side0PlayerId) == 0) { // barb colClass = '"myCol myGray"'; } else { if (targetDiplomacy == 'friendly') colClass = '"myCol myWarn"'; } } //logit (inspect (ar, 3, 1)); msg.push ('<tr valign=top'); if (i%2 == 0) msg.push(" class=stripe"); msg.push("><TD class="+ colClass +"><div>"); msg.push(unsafeWindow.formatDateByUnixTime(rpt.reportUnixTime)); msg.push ('<BR>Rpt #'); msg.push (rpt.reportId); msg.push("</div></td><TD class="+ colClass +"><div>"); if (rpt.marchType == 1) msg.push (unsafeWindow.g_js_strings.commonstr.transport); else if (rpt.marchType == 3) msg.push (unsafeWindow.g_js_strings.commonstr.scout); else if (rpt.marchType == 2) msg.push ('Reinf'); else msg.push (unsafeWindow.g_js_strings.commonstr.attack); // attacker ... msg.push ("</div></td><TD class="+ colClass +"><div>"); if (parseInt(rpt.side1PlayerId) != 0) msg.push(escape(playerNames["p" + rpt.side1PlayerId])) else msg.push ('?Unknown?'); msg.push (' '); msg.push (coordLink(rpt.side1XCoord, rpt.side1YCoord)); msg.push ('<BR>'); if (rpt.side1AllianceId != myAllianceId){ msg.push (allianceNames['a'+rpt.side1AllianceId]); msg.push (' ('); msg.push (getDiplomacy(rpt.side1AllianceId)); msg.push (')'); } else { msg.push ('<BR>'); } msg.push ('</div></td>'); // target ... msg.push ("<TD class="+ colClass +"><DIV>"); var type = parseInt(rpt.side0TileType); if (type < 50){ // wild msg.push(unsafeWindow.g_mapObject.types[type].toString().capitalize()); msg.push(" Lvl " + rpt.side0TileLevel) if (parseInt(rpt.side0PlayerId) != 0) { // IF OWNED, show owner ... msg.push (' ['); msg.push (escape(playerNames["p" + rpt.side0PlayerId])); msg.push ('] '); } } else { if (parseInt(rpt.side0PlayerId) == 0) { // barb msg.push(unsafeWindow.g_js_strings.commonstr.barbariancamp); msg.push(" Lvl " + rpt.side0TileLevel) } else { // city msg.push (escape(playerNames["p" + rpt.side0PlayerId])); msg.push (' - '); msg.push (cityNames['c'+ rpt.side0CityId]); } } msg.push (' '); msg.push (coordLink(rpt.side0XCoord, rpt.side0YCoord)); if (rpt.side0AllianceId!=0 && rpt.side0AllianceId!=myAllianceId){ msg.push ('<BR>'); msg.push (allianceNames['a'+rpt.side0AllianceId]); msg.push (' ('); msg.push (targetDiplomacy); msg.push (')'); } /*** MY reports, reins works ... <div><a href="#" onclick="jQuery('#modal_msg_body').trigger('viewReinforcedReport', ['6076798','67674','Elroy','IV','13412958','Duke_Swan','6329','Erisvil',662,477]);return false;">View Report</a></div> OK: <a onclick=" $("modal_alliance_reports_tabledivNKA").id="modal_alliance_reports_tablediv"; modal_alliance_report_view("6044155",0,51,9,2282354,"Jetson","M","Joe7z6bq","M",4,668,437,1299747584,0,643,407);return false;">View</a></div> ERROR (Reinf): <a onclick=" $("modal_alliance_reports_tabledivNKA").id="modal_alliance_reports_tablediv"; modal_alliance_report_view("6043602",1,51,9,13487684,"Fred8135i","M","Jetson","M",2,188,696,1299746211,0,23,518);return false;">View</a> modal_alliance_report_view("6043602",1,51,9,13487684,"Fred8135i","M","Jetson","M",2,188,696,1299746211,0,23,518);return false;'>View</a> modal_alliance_report_view("6043602",1,51,9,13487684,"Fred8135i","M","Jetson","M",2,188,696,1299746211,0,23,518);return false;">View Report</a></div> modal_alliance_report_view("6043602",1,51,9,13487684,"Fred8135i","M","Jetson","M",2,188,696,1299746211,0,23,518);return false;">View Report</a></div> ***/ // 'view report' link ... if (Options.allowAlterAR) msg.push("</div></td><TD class="+ colClass +"><div><a onclick=' modal_alliance_report_view(\""); // ONCLICK ??? else msg.push("</div></td><TD class="+ colClass +"><div><a onclick=' $(\"modal_alliance_reports_tabledivNKA\").id=\"modal_alliance_reports_tablediv\"; modal_alliance_report_view(\""); // ONCLICK ??? msg.push(rpt.reportId); msg.push('",'); if (parseInt(rpt.side1AllianceId) == parseInt(Seed.allianceDiplomacies.allianceId)) msg.push(1); else msg.push(0); msg.push(","); msg.push(rpt.side0TileType); msg.push(","); msg.push(rpt.side0TileLevel); msg.push(","); msg.push(rpt.side0PlayerId); msg.push(',"'); if (parseInt(rpt.side0PlayerId) != 0) msg.push(escape(playerNames["p" + rpt.side0PlayerId])); else msg.push(unsafeWindow.g_js_strings.commonstr.enemy); msg.push('","'); if (parseInt(rpt.side0PlayerId) != 0) msg.push(escape(playerNames["g" + rpt.side0PlayerId])); else msg.push(0) msg.push('","'); if (parseInt(rpt.side1PlayerId) > 0) msg.push(escape(playerNames["p" + rpt.side1PlayerId])); msg.push('","'); if (parseInt(rpt.side1PlayerId) != 0) msg.push(escape(playerNames["g" + rpt.side1PlayerId])); msg.push('",'); msg.push(rpt.marchType); msg.push(","); msg.push(rpt.side0XCoord); msg.push(","); msg.push(rpt.side0YCoord); msg.push(","); msg.push(rpt.reportUnixTime); msg.push(","); if (parseInt(rpt.reportStatus) == 2) msg.push(1); else msg.push(0); if (rpt.side1XCoord) { msg.push(","); msg.push(rpt.side1XCoord); msg.push(","); msg.push(rpt.side1YCoord) } else { msg.push(",,"); } msg.push(");return false;'>View</a></div></td></tr>"); } msg.push("</tbody></table></div>"); } msg.push("</div><div id='modal_report_list_pagination'></div>"); document.getElementById('allianceContent').innerHTML = msg.join(""); if (pageNum) { unsafeWindow.ctrlPagination("modal_report_list_pagination", totalPages, "allianceReports", pageNum) } else { unsafeWindow.ctrlPagination("modal_report_list_pagination", totalPages, "allianceReports") } } }, } // end AllianceReports singleton /************************ Food Alerts *************************/ var FoodAlerts = { init : function (){ var f = FoodAlerts; f.e_eachMinute(); }, minuteTimer : null, e_eachMinute : function (){ var f = FoodAlerts; var now = unixTime(); row = []; for(i=0; i < Cities.numCities; i++) { var rp = getResourceProduction (Cities.cities[i].id); var foodleft = parseInt(Seed.resources["city" + Cities.cities[i].id]['rec1'][0])/3600; var usage = rp[1] - parseInt(Seed.resources["city" + Cities.cities[i].id]['rec1'][3]); row[i] = rp[1] - usage; var timeLeft = parseInt(Seed.resources["city" + Cities.cities[i].id]['rec1'][0]) / 3600 / (0-usage) * 3600; var msg = ''; if (usage < 0) { if (Options.enableFoodTower && timeLeft<(6*3600)) { msg += 'My city ' + Cities.cities[i].name.substring(0,10) + ' (' + Cities.cities[i].x +','+ Cities.cities[i].y + ')'; msg += ' is low on food. Remaining: '+addCommasWhole(foodleft)+' ('+timestrShort(timeLeft)+') Upkeep: '+addCommas(usage); sendChat ("/a " + msg); } } } f.minuteTimer = setTimeout (f.e_eachMinute, 1800000); }, } /************************ Tower Alerts ************************/ var TowerAlerts = { viewImpendingFunc : null, generateIncomingFunc : null, fixTargetEnabled : false, towerMarches : {}, // track all marches that have been posted to alliance chat init : function (){ var t = TowerAlerts; var s = GM_getValue ('towerMarches_'+GetServerId()); if (s != null) t.towerMarches = JSON2.parse (s); t.viewImpendingFunc = new CalterUwFunc ('attack_viewimpending_view', [[/Modal.showModal\((.*)\)/im, 'Modal.showModal\($1\); ptViewImpending_hook(a);']]); unsafeWindow.ptViewImpending_hook = t.viewImpending_hook; t.viewImpendingFunc.setEnable (true); t.generateIncomingFunc = new CalterUwFunc ('attack_generateincoming', [[/.*} else {\s*e = true;\s*}/im, '} else { e = ptGenerateIncoming_hook(); }']]); unsafeWindow.ptGenerateIncoming_hook = t.generateIncoming_hook; }, // fix 'target', add button viewImpending_hook : function (atkinc){ var t = TowerAlerts; var div = document.getElementById('modal_attackimpending_view'); var isFalse = false; if (t.fixTargetEnabled){ var city = Cities.byID[atkinc.toCityId]; var target = ''; if (!city || (atkinc.marchType!=3 && atkinc.marchType!=4)){ target = '<B>FALSE REPORT!</b>'; isFalse = true; } else if (city.tileId == atkinc.toTileId){ target = city.name + ' ('+ city.x + ','+ city.y +')'; } else { wilds = Seed.wilderness['city'+atkinc.toCityId]; m = ''; for (k in wilds){ if (wilds[k].tileId == atkinc.toTileId){ m = 'at '+ wilds[k].xCoord + ','+ wilds[k].yCoord; break; } } target = city.name + ', <B>WILD '+ m +'</b>'; } div.childNodes[0].innerHTML = '<B>Target: </b>'+ target; } if (!isFalse){ var d = document.createElement ('div'); d.innerHTML = '<BR><TABLE><TR><TD><a id=towerPostToChat class=button20><span>Post to Alliance Chat</span></a></td></tr></table>'; div.appendChild (d); document.getElementById('towerPostToChat').addEventListener('click', function (){t.e_buttonPostToChat(atkinc)}, false); } }, // fix false reports generateIncoming_hook : function (){ return false; }, enableFixFalseReports : function (tf){ var t = TowerAlerts; t.generateIncomingFunc.setEnable (tf); }, enableFixTarget : function (tf){ var t = TowerAlerts; t.fixTargetEnabled = tf; }, isFixTargetAvailable : function (){ var t = TowerAlerts; return t.viewImpendingFunc.isAvailable(); }, isFixFalseReportsAvailable : function (){ var t = TowerAlerts; return t.generateIncomingFunc.isAvailable(); }, postToChatOptions : {aChat:false}, setPostToChatOptions : function (obj){ var t = TowerAlerts; t.postToChatOptions = obj; clearTimeout(t.secondTimer); }, e_buttonPostToChat : function (march){ var t = TowerAlerts; t.postToChat (march, true); unsafeWindow.Modal.hideModal(); }, postToChat : function (m, force){ var t = TowerAlerts; if (DEBUG_TRACE) logit ("checkTower(): INCOMING at "+ unixTime() +": \n"+ inspect (m, 8, 1)); if (m.marchType == null) // bogus march (returning scouts) return; if (ENABLE_TEST_TAB) Tabs.Test.addDiv ("Incoming!<BR><PRE style='margin:0px;'>" + inspect (m, 8, 1) +'</pre>'); if (m.marchType == 3){ if (!t.postToChatOptions.scouting && !force) return; atkType = 'scouted'; } else if (m.marchType == 4){ atkType = 'attacked'; } else { return; } var target, atkType, who; var city = Cities.byID[m.toCityId]; if ( city.tileId == m.toTileId ) target = 'city at '+ city.x +','+ city.y; else { if (!t.postToChatOptions.wilds && !force) return; target = 'wilderness'; for (k in Seed.wilderness['city'+m.toCityId]){ if (Seed.wilderness['city'+m.toCityId][k].tileId == m.toTileId){ target += ' at '+ Seed.wilderness['city'+m.toCityId][k].xCoord +','+ Seed.wilderness['city'+m.toCityId][k].yCoord; break; } } } if (Seed.players['u'+m.pid]) who = Seed.players['u'+m.pid].n; else if (m.players && m.players['u'+m.pid]) who = m.players['u'+m.pid].n; else who = 'Unknown'; if (m.fromXCoord) who += ' at '+ m.fromXCoord +','+ m.fromYCoord; var msg = ''; if (!force) msg = t.postToChatOptions.aPrefix +' '; msg += 'My '+ target +' is being '+ atkType +' by '+ who +'. Incoming Troops (arriving in '+ unsafeWindow.timestr(parseInt(m.arrivalTime - unixTime())) +') : '; var totTroops = 0; for (k in m.unts){ var uid = parseInt(k.substr (1)); msg += m.unts[k] +' '+ unsafeWindow.unitcost['unt'+uid][0] +', '; totTroops += m.unts[k]; } if ((totTroops < t.postToChatOptions.minTroops) && !force) return; msg = msg.slice (0, -2); msg += '.'; if ( city.tileId == m.toTileId ){ var emb = getCityBuilding(m.toCityId, 8); if (emb.count > 0){ var availSlots = emb.maxLevel; for (k in Seed.queue_atkinc){ if (Seed.queue_atkinc[k].marchType==2 && Seed.queue_atkinc[k].toCityId==m.toCityId && Cities.byID[Seed.queue_atkinc[k].fromCityId]==null){ // if (Seed.queue_atkinc[k].marchType==2 && Cities.byID[Seed.queue_atkinc[k].fromCityId]==null){ --availSlots; } } msg += ' My embassy has '+ availSlots +' of '+ emb.maxLevel +' slots available.'; } } if (ENABLE_TEST_TAB) Tabs.Test.addDiv (msg); if (SEND_ALERT_AS_WHISPER) sendChat ("/"+ Seed.player.name +' '+ msg); // Whisper to myself else sendChat ("/a "+ msg); // Alliance chat }, } function parseIntNan (n){ x = parseInt(n, 10); if (isNaN(x)) return 0; return x; } function parseIntZero (n){ if (n == '') return 0; return parseInt(n, 10); } /*********************************** Players TAB ***********************************/ function officerId2String (oid){ if (oid==null) return ''; else if (oid==3) return 'Officer'; else if (oid==2) return 'Vice Chance'; else if (oid==1) return 'Chancellor'; return ''; } Tabs.AllianceList = { tabOrder : 25, tabLabel : 'Players', cont : null, dat : [], /*** ajax/viewCourt.php: (boolean) ok = true (array) courtItems = (string) dailyActionFlag = 0 (object) playerInfo = [object Object] (string) datejoinUnixTime = 1294440708 (string) truceExpireUnixTime = 0 (string) userId = 4394121 (string) displayName = Vakasade (string) email = (string) fbuid = 100000977751880 (string) playerSex = F (string) usertype = 1 (string) status = 1 (string) dateJoined = 2011-01-07 14:51:48 (string) lastLogin = 2011-03-13 13:11:34 (string) eventTimestamp = 0000-00-00 00:00:00 (string) eventStatus = 1 (string) warStatus = 1 (string) allianceId = 85 (number) might = 1192710 (string) title = 57 (string) truceExpireTimestamp = 0000-00-00 00:00:00 (string) fogExpireTimestamp = 0000-00-00 00:00:00 (string) cnt_newmsg = 0 (string) cnt_friendreq = 0 (string) cnt_logins = 3910 (string) cnt_passreset = 0 (string) cnt_connections = 0 (string) avatarId = 11 (undefined) photo_host: null = null (undefined) photo_dir: null = null (undefined) photo_subdir: null = null (undefined) photo_name: null = null (string) allianceName = The Flying Circus (number) cityCount = 2 (undefined) errorMsg: null = null ***/ fetchPlayerCourt : function (uid, notify){ var params = unsafeWindow.Object.clone(unsafeWindow.g_ajaxparams); params.pid = uid; new MyAjaxRequest(unsafeWindow.g_ajaxpath + "ajax/viewCourt.php" + unsafeWindow.g_ajaxsuffix, { method: "post", parameters: params, onSuccess: function (rslt) { logit ("ajax/viewCourt.php\n"+ inspect (rslt, 3, 1)); notify (rslt); }, onFailure: function (rslt) { notify (rslt); }, }); }, fetchTEST : function (pageNum, notify){ // as in alliance list, sorted by rank, 10 per page var params = unsafeWindow.Object.clone(unsafeWindow.g_ajaxparams); params.pageNo = 1; params.numPerPage = 100; params.perPage = 100; params.results = 100; params.numResults = 100; new MyAjaxRequest(unsafeWindow.g_ajaxpath + "ajax/allianceGetMembersInfo.php" + unsafeWindow.g_ajaxsuffix, { method: "post", parameters: params, onSuccess: function (rslt) { logit ("ajax/allianceGetMembersInfo.php:\n"+ inspect (rslt, 5, 1)); notify (rslt); }, onFailure: function (rslt) { notify ({errorMsg:'AJAX error'}); }, }); }, init : function (div){ var t = Tabs.AllianceList; t.cont = div; unsafeWindow.PTgetMembers = t.eventGetMembers; unsafeWindow.PTPaintMembers = t.GetDataForMap; unsafeWindow.PTpd = t.clickedPlayerDetail; unsafeWindow.PTpl = t.clickedPlayerLeaderboard; unsafeWindow.PTpl2 = t.clickedPlayerLeaderboard2; unsafeWindow.PTalClickPrev = t.eventListPrev; unsafeWindow.PTalClickNext = t.eventListNext; unsafeWindow.PCplo = t.clickedPlayerGetLastLogin; Lastlogin=0; t.show(); }, /* init : function (div){ var t = Tabs.AllianceList; t.cont = div; //t.fetchTEST(); unsafeWindow.PTgetMembers = t.eventGetMembers; unsafeWindow.PTpd = t.clickedPlayerDetail; unsafeWindow.PTpl = t.clickedPlayerLeaderboard; if (getMyAlliance()[0] == 0) { t.cont.innerHTML = '<BR><BR><CENTER>You need to be in an alliance to use this feature.</center>'; t.state = 1; return; } var m = '<div ><DIV class=ptentry><TABLE width=100% cellpadding=0>\ <TR><TD class=xtab align=right></td><TD class=xtab>Enter all or part of a player name: </td>\ <TD width=80% class=xtab><INPUT id=allPlayName size=20 type=text /> <INPUT id=playSubmit type=submit value="Find Player" /></td>\ <TD class="xtab ptErrText"><SPAN id=ptplayErr></span></td></tr>\ <TR><TD class=xtab>OR: </td><TD class=xtab> Enter all or part of an alliance name: </td>\ <TD class=xtab><INPUT id=allAllName type=text /> <INPUT id=allSubmit type=submit value="Find Alliance" /> <INPUT id=myAllSubmit type=submit value="'+ getMyAlliance()[1] +'" /></td>\ <TD class="xtab ptErrText"><SPAN id=ptallErr></span></td></tr>\ </table><span style="vertical-align:middle;" id=altInput></span></div>\ <div style="overflow-y:auto;"; id=allListOut ></div></div>'; t.cont.innerHTML = m; document.getElementById('allSubmit').addEventListener ('click', t.eventSubmit, false); document.getElementById('myAllSubmit').addEventListener ('click', t.eventMyAllianceSubmit, false); document.getElementById('playSubmit').addEventListener ('click', t.eventPlayerSubmit, false); document.getElementById('allAllName').addEventListener ('focus', function (){document.getElementById('ptallErr').innerHTML='';}, false); document.getElementById('allPlayName').addEventListener ('focus', function (){document.getElementById('ptplayErr').innerHTML='';}, false); }, */ hide : function (){ }, show : function (){ var t = Tabs.AllianceList; if (t.state == null){ if (getMyAlliance()[0] == 0) { t.cont.innerHTML = '<BR><BR><CENTER>You need to be in an alliance to use this feature.</center>'; t.state = 1; return; } var m = '<DIV class=ptentry><TABLE width=100% cellpadding=0>\ <TR><TD class=xtab align=right></td><TD class=xtab>Enter all or part of a player name: </td>\ <TD width=80% class=xtab><INPUT id=allPlayName size=20 type=text /> <INPUT id=playSubmit type=submit value="Find Player" /></td>\ <TD class="xtab ptErrText"><SPAN id=ptplayErr></span></td></tr>\ <TR><TD class=xtab>OR: </td><TD class=xtab> Enter all or part of an alliance name: </td>\ <TD class=xtab><INPUT id=allAllName type=text /> <INPUT id=allSubmit type=submit value="Find Alliance" /></td>\ <TD class="xtab ptErrText"><SPAN id=ptallErr></span></td></tr>\ <TR><TD class=xtab><INPUT align=left id=allListSubmit type=submit value="List Alliances" /></td>\ <TD class=xtab><INPUT align=right id=idMyAllSubmit type=submit value="'+ getMyAlliance()[1] +'"/>\ <TD class=xtab></td><TD class=xtab><span align=right <b>Model ETA with: </b></span>\ <div><select id="idFindETASelect">\ <option value="0,250" > -- Select -- </option>\ <option value="0,180" > Supply </option>\ <option value="0,200" > Militia </option>\ <option value="0,3000" > Scout </option>\ <option value="0,300" > Pikeman </option>\ <option value="0,275" > Swordsman </option>\ <option value="0,250" > Archer </option>\ <option value="1,1000" > Cavalry </option>\ <option value="1,750" > Heavy Cavalry </option>\ <option value="1,150" > Supply Wagon </option>\ <option value="1,100" > Balista </option>\ <option value="1,120" > Ram </option>\ <option value="1,80" > Catapult </option>\ </select></div>\ </td></tr>\ </table><span style="vertical-align:middle;" id=altInput></span></div><SPAN id=allListOut></span>'; t.cont.innerHTML = m; document.getElementById('allPlayName').addEventListener ('keypress', function(e) {if ( e.which == 13) document.getElementById('playSubmit').click();}, false); document.getElementById('allAllName').addEventListener ('keypress', function(e) {if ( e.which == 13) document.getElementById('allSubmit').click();}, false); document.getElementById('allSubmit').addEventListener ('click', t.eventSubmit, false); document.getElementById('playSubmit').addEventListener ('click', t.eventPlayerSubmit, false); //document.getElementById('ffbuidsubmit').addEventListener ('click', t.eventPlayerUIDSubmit, false); document.getElementById('allAllName').addEventListener ('focus', function (){document.getElementById('ptallErr').innerHTML='';}, false); document.getElementById('allPlayName').addEventListener ('focus', function (){document.getElementById('ptplayErr').innerHTML='';}, false); document.getElementById('allListSubmit').addEventListener ('click', t.eventListSubmit, false); //document.getElementById('allGotoPage').addEventListener ('click', t.gotoPage, false); document.getElementById('idMyAllSubmit').addEventListener ('click', t.showMyAlliance, false); document.getElementById('idFindETASelect').addEventListener ('click', t.handleEtaSelect, false); //document.getElementById('allGotoPage').disabled = true; document.getElementById('idFindETASelect').disabled = true; t.ModelCity=Cities.cities[0]; t.curPage = 0; t.MaxPage = -1; t.state = 1; } }, pName : '', eventPlayerSubmit : function (){ var t = Tabs.AllianceList; document.getElementById('ptplayErr').innerHTML=''; var name = document.getElementById('allPlayName').value; name = name.replace(/\'/g,"_"); t.pName = name; if (name.length < 3){ document.getElementById('ptplayErr').innerHTML = 'Enter at least 3 characters'; return; } document.getElementById('altInput').innerHTML = ''; document.getElementById('allListOut').innerHTML = '<BR><BR><CENTER>Searching ...</center>'; t.fetchPlayerList (name, t.eventGotPlayerList); }, eventGotPlayerList : function (rslt){ var t = Tabs.AllianceList; if (!rslt.ok){ document.getElementById('allListOut').innerHTML = rslt.errorMsg; return; } t.playerList = rslt.matchedUsers; var uList = []; for (k in rslt.matchedUsers) uList.push (rslt.matchedUsers[k].userId); t.fetchPlayerStatus (uList, function(r){t.eventGotPlayerOnlineList(r)}); }, eventGotPlayerOnlineList : function (rslt){ var t = Tabs.AllianceList; if (!rslt.ok){ document.getElementById('allListOut').innerHTML = rslt.errorMsg; return; } var m = '<DIV class=ptstat>Showing players matching <B>"'+ t.pName +'"</b></div>\ <DIV style="height:575px; max-height:575px; overflow-y:auto">\ <TABLE width=100% align=center class=ptTab cellspacing=0><TR style="font-weight:bold"><TD>Name                  </td>\ <TD align=right>UserId              </td><TD>Might    </td><TD> Online</td><TD> Facebook </td><TD width=75%>Lookup </td></tr>'; var row=0; var cl=''; for (k in t.playerList){ var u = t.playerList[k]; if (++row % 2) cl = 'class=ptOddrow '; else cl = ''; m += '<TR '+ cl +'valign=top><TD>'+ u.genderAndName +'</td><TD><A target="_tab" href="http://koc.dunno.com/index.sjs?f=ServersByUser&user_id='+ u.userId +'">' + u.userId + '</a></SPAM></td><TD align=right>'+ addCommasInt(u.might) +'</td>\ <TD>'+ (rslt.data[u.userId]?" <SPAN class=boldDarkRed>ONLINE</span>":"") +'</td>\ <TD align=center><A target="_tab" href="http://www.facebook.com/profile.php?id='+ u.fbuid +'">profile</a></td>\ <TD><SPAN onclick="PTpd(this, '+ u.userId +')"><A>details</a> <BR></span><SPAN onclick="PTpl2(this,'+ u.userId+','+rslt.data[u.userId]+')"><A>leaderboard</a><BR></span><SPAN onclick="PCplo(this, \''+ u.userId +'\')"><A>last Login</a></span></td></tr>'; } m += '</table></div>'; document.getElementById('allListOut').innerHTML = m; }, asName : '', eventPlayerUIDSubmit : function (){ var t = Tabs.AllianceList; document.getElementById('ptplayErr').innerHTML=''; var uid = document.getElementById('allPlayName').value; var params = unsafeWindow.Object.clone(unsafeWindow.g_ajaxparams); params.uid = uid; MyAjaxRequest(unsafeWindow.g_ajaxpath + "ajax/getUserGeneralInfo.php" + unsafeWindow.g_ajaxsuffix, { method: "post", parameters: params, onSuccess: function (rslt) { t.asName = rslt.userInfo[0].name; }, onFailure: function (rslt) { document.getElementById('allListOut').innerHTML = '<BR><BR><CENTER>Searching ...Not Found</center>'; return; }, }); t.pName = t.asName; document.getElementById('altInput').innerHTML = ''; document.getElementById('allListOut').innerHTML = '<BR><BR><CENTER>Searching ...</center>'; t.fetchPlayerList (t.asName, t.eventGotPlayerList); }, clickedPlayerDetail : function (span, uid){ var t = Tabs.AllianceList; span.onclick = ''; span.innerHTML = "fetching details ..."; t.fetchPlayerInfo (uid, function (r) {t.gotPlayerDetail(r, span)}); }, clickedPlayerLeaderboard : function (span, uid){ var t = Tabs.AllianceList; span.onclick = ''; span.innerHTML = "fetching leaderboard info ..."; t.fetchLeaderboard (uid, function (r) {t.gotPlayerLeaderboard(r, span)}); }, clickedPlayerLeaderboard2 : function (span, uid,status){ var t = Tabs.AllianceList; span.onclick = ''; span.innerHTML = "fetching leaderboard info ... "; t.fetchLeaderboard (uid, function (r) {t.gotPlayerLeaderboard2(r, span,uid,status)}); }, clickedPlayerGetLastLogin : function (span, uid){ var t = Tabs.AllianceList; span.onclick = ''; span.innerHTML = "fetching login date ..."; t.fetchPlayerLastLogin (uid, function (r) {t.gotPlayerLastLogin(r, span)}); }, gotPlayerLeaderboard2 : function (rslt,span,uid,status){ // alert(uid+'/'+status); var t = Tabs.AllianceList; if (!rslt.ok){ span.innerHTML = rslt.errorMsg; return; } if (rslt.totalResults == 0){ span.innerHTML = '<B>Leaderboard:</b> Not found! (misted?)'; return; } var myA = getMyAlliance (); t.dat = []; //logit ("gotPlayerLeaderboard2 -1 "+JSON2.stringify(rslt)); var p = rslt.results[0]; if ( myA[0] == p.allianceId) t.friendEta = true; else t.friendEta = false; for (var c=0; c<p.cities.length; c++){ t.dat.push ([p.displayName, parseInt(p.might), p.officerType, parseInt(p.numCities), parseInt(p.cities[c].tileLevel), parseInt(p.cities[c].xCoord), parseInt(p.cities[c].yCoord), p.cities[c].cityName, 0, status,0,p.userId]); } t.setDistances (Cities.cities[0].x, Cities.cities[0].y); t.ModelCity=Cities.cities[0]; t.setEta(); t.fetchPlayerLastLogin (uid, function (r) {t.displayPlayer(p.allianceName,r)}); //t.fetchPlayerLastLogin(); //t.displayPlayer (p.allianceId); }, gotPlayerLeaderboard : function (rslt, span){ var t = Tabs.AllianceList; if (!rslt.ok){ span.innerHTML = rslt.errorMsg; return; } if (rslt.totalResults == 0){ span.innerHTML = '<B>Leaderboard:</b> Not found! (misted?)'; return; } var p = rslt.results[0]; var an = p.allianceName; if (!an || an=='' || p.officerType==4) an = 'none'; else an += ' ('+ officerId2String(p.officerType) +')'; pStr = JSON2.stringify(p); logit (pStr); m = '<TABLE cellspacing=0 class=ptTab><TR><TD><B>Leaderboard: </b></td><TD colspan=2> Might: '+ p.might +' Alliance: '+ an +'</td></tr>'; for (var i=0; i<p.cities.length; i++){ var c = p.cities[i]; var created = ''; if (c.dateCreated && c.dateCreated.substr(0,2)=='20') created = ' created: ' + c.dateCreated.substr(0,10); m += '<TR><TD align=right><B>City #'+ (i+1) +':</b></td><TD> '+ c.cityName +' (<a onclick="ptGotoMap ('+ c.xCoord +',' +c.yCoord+ ')">'+ c.xCoord +','+ c.yCoord +'</a>)</td><TD width=75%> level: ' + c.tileLevel +' status: '+ cityStatusString (c.cityStatus) + created +'</td></tr>'; } span.innerHTML = m + '</table>'; }, gotPlayerDetail : function (rslt, span){ var t = Tabs.AllianceList; if (!rslt.ok){ span.innerHTML = rslt.errorMsg; return; } var u = rslt.userInfo[0]; var a = 'None'; if (u.allianceName) a = u.allianceName +' ('+ getDiplomacy(u.allianceId) + ')'; var m = '<TABLE cellspacing=0 class=ptTab><TR><TD><B>Details:</b> </td><TD>Alliance: '+ a +' Cities: ' + u.cities +' Population: '+ u.population +'</td></tr><TR><TD></td><TD>Provinces: '; var pids = u.provinceIds.split (','); var p = []; for (var i=0; i<pids.length; i++) p.push(unsafeWindow.provincenames['p'+pids[i]]); span.innerHTML = m + p.join (', ') +'</td></tr></table>'; }, eventMyAllianceSubmit : function (){ var t = Tabs.AllianceList; document.getElementById('allListOut').innerHTML = '<BR><BR><CENTER>Searching ...</center>'; t.fetchAllianceMemberList (getMyAlliance()[0], null, t.eventGotMemberList); }, aName : '', eventSubmit : function (){ var t = Tabs.AllianceList; document.getElementById('ptallErr').innerHTML=''; t.aName = document.getElementById('allAllName').value; if (t.aName.length < 3){ document.getElementById('ptallErr').innerHTML = 'Enter at least 3 characters'; return; } var myA = getMyAlliance (); document.getElementById('altInput').innerHTML = ''; document.getElementById('allListOut').innerHTML = '<BR><BR><CENTER>Searching ...</center>'; if (myA[0]!=0 && myA[1].toLowerCase().indexOf(t.aName.toLowerCase())>=0 ) t.fetchAllianceList (t.aName, myA[0], t.eventGotAllianceList); else t.fetchAllianceList (t.aName, null, t.eventGotAllianceList); }, eventListSubmit : function (){ var t = Tabs.AllianceList; var myA = getMyAlliance (); document.getElementById('allListOut').innerHTML = '<BR><BR><CENTER>Searching...</center>'; if (myA[0]!=0 ) { t.curPage=1; t.fetchOtherAllianceInfo ( 1, t.eventGotOtherAlliancePage); //document.getElementById('allGotoPage').disabled = false; } else { document.getElementById('allListOut').innerHTML = 'You must be an alliance member to use this feature.'; } }, eventGotAllianceList : function (rslt){ var t = Tabs.AllianceList; if (!rslt.ok){ document.getElementById('allListOut').innerHTML = rslt.errorMsg; return; } var m = '<DIV class=ptstat>Showing alliances matching <B>"'+ t.aName +'"</b></div>\ <TABLE><TR style="font-weight:bold"><TD class=xtab>Alliance Name</td><TD class=xtab>Rank</td><TD class=xtab>Members</td>\ <TD align=right class=xtab>Might</td><TD class=xtab>Diplomacy</td><TD class=xtab></td></tr>'; for (k in rslt.alliancesMatched){ var all = rslt.alliancesMatched[k]; var dip = ''; if (all.relation && all.relation==1) dip = 'Friendly'; else if (all.relation && all.relation==2) dip = 'Hostile'; m += '<TR><TD class=xtab>'+ all.allianceName +'</td><TD align=right class=xtab>'+ all.ranking +'</td><TD align=right class=xtab>'+ all.membersCount +'</td>\ <TD align=right class=xtab>'+ addCommasInt(all.might) +'</td><TD class=xtab>'+ dip +'</td>\ <TD class=xtab><a onclick="PTgetMembers('+ all.allianceId +')">View Members</a></td>\ <TD class=xtab><a onclick="PTPaintMembers('+ all.allianceId +')">'+unsafeWindow.g_js_strings.commonstr.viewmap+'</a></td></tr>'; } document.getElementById('allListOut').innerHTML = m; }, showMyAlliance : function (){ var t = Tabs.AllianceList; var myA = getMyAlliance (); document.getElementById('allListOut').innerHTML = '<BR><BR><CENTER> ...</center>'; if (myA[0]!=0 ) { t.eventGetMembers(myA[0]); } else { document.getElementById('allListOut').innerHTML = 'You must be an alliance member to use this feature.'; } }, curPage : 0, MaxPage : 0, eventListNext : function (amt){ var t = Tabs.AllianceList; if( parseInt(amt) >= 9999 ) t.curPage = t.MaxPage; else { t.curPage = parseInt(t.curPage) + parseInt(amt); if ( t.curPage > t.MaxPage) { t.curPage = t.MaxPage; } } document.getElementById('allListOut').innerHTML = '<BR><BR><CENTER>Searching...</center>'; t.fetchOtherAllianceInfo (t.curPage, t.eventGotOtherAlliancePage); }, eventListPrev : function (amt){ var t = Tabs.AllianceList; if(amt <= -1) t.curPage = 1; else { t.curPage-=amt; if ( t.curPage < 1 ) { t.curPage = 1; } } document.getElementById('allListOut').innerHTML = '<BR><BR><CENTER>Searching...</center>'; t.fetchOtherAllianceInfo (t.curPage, t.eventGotOtherAlliancePage); }, gotoPage : function (){ var t = Tabs.AllianceList; //var val = document.getElementById('idPageNum').value; if (t.MaxPage < 0 ) { document.getElementById('allListOut').innerHTML = 'List Alliances first.'; return; } if (t.MaxPage < 0 || val > t.MaxPage || val < 1) { document.getElementById('allListOut').innerHTML = 'Page number out of range'; return; } //t.curPage = val; document.getElementById('allListOut').innerHTML = '<BR><BR><CENTER> ...</center>'; t.fetchOtherAllianceInfo (t.curPage, t.eventGotOtherAlliancePage); }, eventGotOtherAlliancePage : function (rslt){ var t = Tabs.AllianceList; if (!rslt.ok){ document.getElementById('allListOut').innerHTML = rslt.errorMsg; return; } // document.getElementById('idPageNum').value = t.curPage; t.MaxPage=rslt.noOfPages; //document.getElementById('idMaxPageNum').innerHTML = 'of ' + t.MaxPage; var m = '<div style="overflow:auto; height:556px;width:564px;"><TABLE><thead><TR style="font-weight:bold"> \ <th class=xtab>Alliance Name</th><th class=xtab>Rank</th><th class=xtab>Members</th>\ <th align=right class=xtab>Might</th><th class=xtab>Diplomacy</th><th class=xtab></th></tr></thead><tbody>'; document.getElementById('allListOut').innerHTML = m; for (var i=0; i<rslt.otherAlliances.length; i++) { var alliance = rslt.otherAlliances[i]; var dip = ''; dip = getDiplomacy(alliance.allianceId); m += '<TR class="'+ dip + '"><TD class=xtab>' + alliance.name +'</td><TD align=right class=xtab>'+ alliance.ranking +'</td><TD align=right class=xtab>'+ alliance.membersCount +'</td>\ <TD align=right class=xtab>'+ addCommasInt(alliance.might) +'</td><TD class=xtab>'+ dip +'</td>\ <TD class=xtab><a onclick="PTgetMembers('+ alliance.allianceId +')">'+uW.g_js_strings.commonstr.members+'</a></td>\ <TD class=xtab><a onclick="PTPaintMembers('+ alliance.allianceId +')">'+uW.g_js_strings.commonstr.viewmap+'</a></td></tr>'; } m += '</tbody></TABLE><div style="font-weight:bold"; height:20px;width:560px; ><span> <a onclick="PTalClickPrev(-1)"> [Begin] </a><a onclick="PTalClickPrev(10)"> [-10] </a><a onclick="PTalClickPrev(5)"> [-5] </a><a onclick="PTalClickPrev(1)"> [Prev] </a> \ <a onclick="PTalClickNext(1)"> [Next] </a><a onclick="PTalClickNext(5)"> [+5] </a><a onclick="PTalClickNext(10)"> [+10] </a><a onclick="PTalClickNext(9999)"> [End] </a> </span></div>'; m += '</div>'; document.getElementById('allListOut').innerHTML = m; }, showCurrentPage : function (){ var t = Tabs.AllianceList; var myA = getMyAlliance (); document.getElementById('allListOut').innerHTML = '<BR><BR><CENTER> ...</center>'; if (myA[0]!=0 ) { t.fetchOtherAllianceInfo ( t.curPage, t.eventGotOtherAlliancePage); } else { t.fetchOtherAllianceInfo ( t.curPage, t.eventGotOtherAlliancePage); } }, eventGotMemberList : function (rslt){ var t = Tabs.AllianceList; if (!rslt.ok){ document.getElementById('allListOut').innerHTML = rslt.errorMsg; return; } t.memberListRslt = rslt; var uList = []; for (k in rslt.results) uList.push (rslt.results[k].userId); t.fetchPlayerStatus (uList, function(r){t.eventGotMemberOnlineList(r)}); }, eventGotMemberOnlineList : function (rslt){ var t = Tabs.AllianceList; var numInvalid = 0; var numPlayers = 0; var myA = getMyAlliance (); t.dat = []; for (var i=0; i<t.memberListRslt.results.length; i++){ p = t.memberListRslt.results[i]; if (p.userId == 0){ ++numInvalid; } else { ++numPlayers; if ( myA[0] == p.allianceId) t.friendEta = true; else t.friendEta = false; for (var c=0; c<p.cities.length; c++){ t.dat.push ([p.displayName, parseInt(p.might), p.officerType, parseInt(p.numCities), parseInt(p.cities[c].tileLevel), parseInt(p.cities[c].xCoord), parseInt(p.cities[c].yCoord), p.cities[c].cityName, 0, rslt.data[p.userId]?1:0,'NA',p.userId]); } } } t.setDistances (Cities.cities[0].x, Cities.cities[0].y); t.ModelCity=Cities.cities[0]; t.setEta(); t.displayMembers (t.memberListRslt.allianceName, numPlayers); }, // sort and display reDisp : function (){ var t = Tabs.AllianceList; function sortFunc (a, b){ var t = Tabs.AllianceList; if (typeof(a[t.sortColNum]) == 'number'){ if (t.sortDir > 0) return a[t.sortColNum] - b[t.sortColNum]; else return b[t.sortColNum] - a[t.sortColNum]; } else if (typeof(a[t.sortColNum]) == 'boolean'){ // TODO !! return 0; } else { if (t.sortDir > 0) return a[t.sortColNum].localeCompare(b[t.sortColNum]); else return b[t.sortColNum].localeCompare(a[t.sortColNum]); } } t.dat.sort (sortFunc); var m = ''; for (var i=0; i<t.dat.length; i++){ m += '<TR style="max-height:30px"><TD class=xxtab>'+ t.dat[i][0] +'</td><TD align=right class=xxtab>'+ addCommasInt(t.dat[i][1]) +'</td><TD align=center class=xxtab>'+ t.dat[i][3] +'</td><TD class=xxtab>'+ officerId2String(t.dat[i][2]) +'</td><TD class=xxtab>'+ (t.dat[i][9]?'<SPAN class=boldDarkRed>ONLINE</span>':'') +'</td><TD class=xxtab>'+ t.dat[i][7] +'</td><TD align=right class=xxtab>'+ t.dat[i][4] +'</td><TD align=center class=xxtab><DIV onclick="ptGotoMap('+ t.dat[i][5] +','+ t.dat[i][6] +')"><A>'+ t.dat[i][5] +','+ t.dat[i][6] +'</a></div></td>\ <TD align=right class=xxtab style="padding-right:20px;">'+ t.dat[i][8].toFixed(2) +'</td>\ </td><TD nowrap class=xxtab>'+ (t.dat[i][10]?'<SPAN>'+ (t.dat[i][10]>0?timestr(t.dat[i][10],1):'NA') +'</span>':'<SPAN>NA</span>') +'<td class=xxtab><SPAN onclick="PCplo(this, \''+ t.dat[i][11] +'\')"><A>last Login</a></span><td></tr>'; } var tbody = document.getElementById('allBody'); tbody.style.maxHeight = ''; tbody.innerHTML = m; if (parseInt(tbody.clientHeight) > 470){ tbody.style.height = '470px'; tbody.style.maxHeight = '470px'; } //new CtableToText('tabAllMembers').toText(); }, setDistances : function (x, y){ var t = Tabs.AllianceList; for (var i=0; i<t.dat.length; i++) t.dat[i][8] = distance (x, y, t.dat[i][5], t.dat[i][6]); }, friendEta:false, setEta : function (){ var t = Tabs.AllianceList; for (var i=0; i<t.dat.length; i++) { if (t.dat[i][8]) { var eta = t.estETA(parseFloat(t.dat[i][8])); if (t.friendEta) t.dat[i][10] = eta.friendETA; else t.dat[i][10] = eta.ETA; } } }, handleEtaSelect : function (){ var t = Tabs.AllianceList; t.setEta(); t.reDisp(); }, sortColNum : 8, sortDir : 1, displayMembers : function (allName, numPlayers){ var t = Tabs.AllianceList; function alClickSort (e){ var t = Tabs.AllianceList; var newColNum = e.id.substr(8); document.getElementById('clickCol'+t.sortColNum).className = 'clickable'; e.className='clickable clickableSel'; if (newColNum == t.sortColNum) t.sortDir *= -1; else t.sortColNum = newColNum; t.reDisp(); } unsafeWindow.PTalClickSort = alClickSort; var m = '<STYLE>.clickable{background-color:#ddd; border:2px outset; border-color:#555; padding-left:5px; padding-right:5px}\ .clickableSel{background-color:#ffffcc;}\ .xxtab{background-color:none; padding-left:5px; padding-right:5px;} </style>\ <DIV class=ptstat ><TABLE id=tabAllMembers cellpadding=0 width=100%><TR font-weight:bold"><TD class=xtab> '+ allName +'</td>\ <TD class=xtab width=80% align=center>Distance is from <SPAN id=distFrom>'+ Cities.cities[0].name +' ('+ Cities.cities[0].x +','+ Cities.cities[0].y +')</span></td><TD class=xtab align=right>'+ numPlayers +' players found </td></tr></table></div>\ <div style="max-height:470px; height:470px; overflow-y:auto;"><TABLE id=tabAllMembers align=center cellpadding=0 cellspacing=0><THEAD style="overflow-y:hidden;">\ <TR style="font-weight:bold"><TD id=clickCol0 onclick="PTalClickSort(this)" class=clickable><A><DIV>Player</div></a></td>\ <TD id=clickCol1 onclick="PTalClickSort(this)" class=clickable align=center><A><DIV>Might</a></div></td>\ <TD id=clickCol3 onclick="PTalClickSort(this)" class=clickable><A><DIV>Cities</a></div></td>\ <TD id=clickCol2 onclick="PTalClickSort(this)" class=clickable align=center><A><DIV>Rank</a></div></td>\ <TD id=clickCol9 onclick="PTalClickSort(this)" class=clickable align=center><A><DIV>Online</a></div></td>\ <TD id=clickCol7 onclick="PTalClickSort(this)" class=clickable><A><DIV>City Name</a></div></td>\ <TD id=clickCol4 onclick="PTalClickSort(this)" class=clickable><A><DIV>Lvl</a></div></td>\ <TD id=clickCol5 onclick="PTalClickSort(this)" class=clickable><A><DIV>Coords</a></div></td>\ <TD id=clickCol8 onclick="PTalClickSort(this)" class=clickable><A><DIV>Distance</a></div></td>\ <TD id=clickCol10 onclick="PTalClickSort(this)" class=clickable><A><DIV>Eta</a></div></td>\ <TD class=clickable><A><DIV>Last Login</a></div></td></tr></thead>\ <TBODY id=allBody style="background-color:#ffffff;"></tbody></table></div>'; document.getElementById('allListOut').innerHTML = m; //style="top:670px; left:0px; position:absolute; document.getElementById('altInput').innerHTML = '<HR><TABLE width=100% cellpaddding=0><TR align=center>\ <TD class=xtab>Show distance from: X: <INPUT size=2 type=text id=plyrX /> Y: <INPUT size=2 type=text id=plyrY /> Or, choose city: <span id=dmcoords></span></td></tr></table>'; document.getElementById('clickCol'+t.sortColNum).className = 'clickable clickableSel'; t.reDisp(); new CdispCityPicker ('plyrdcp', document.getElementById ('dmcoords'), true, t.eventCoords, 0).bindToXYboxes(document.getElementById('plyrX'), document.getElementById('plyrY')); document.getElementById('dmcoords').addEventListener ('click', function(){ //alert(t.eventCoords); //t.clickCity(CdispCityPicker); },false); document.getElementById('idFindETASelect').disabled = false; }, displayPlayer : function (allName,rslt){ var t = Tabs.AllianceList; function alClickSort (e){ var t = Tabs.AllianceList; var newColNum = e.id.substr(8); document.getElementById('clickCol'+t.sortColNum).className = 'clickable'; e.className='clickable clickableSel'; if (newColNum == t.sortColNum) t.sortDir *= -1; else t.sortColNum = newColNum; t.reDisp(); } unsafeWindow.PTalClickSort = alClickSort; var m = '<STYLE>.clickable{background-color:#ddd; border:2px outset; border-color:#555; padding-left:5px; padding-right:5px}\ .clickableSel{background-color:#ffffcc;}\ .xxtab{background-color:none; padding-left:5px; padding-right:5px;} </style>\ <DIV class=ptstat ><TABLE id=tabAllMembers cellpadding=0 width=100%><TR font-weight:bold"><TD class=xtab>Alliance: '+ allName +'</td>\ <TD class=xtab width=80% align=center>Last login: <SPAN id=lastlogin>'+ rslt.playerInfo.lastLogin+'</span></td><TD class=xtab align=right></td></tr></table></div>\ <div style="max-height:470px; height:470px; overflow-y:auto;"><TABLE id=tabAllMembers align=center cellpadding=0 cellspacing=0><THEAD style="overflow-y:hidden;">\ <TR style="font-weight:bold"><TD id=clickCol0 onclick="PTalClickSort(this)" class=clickable><A><DIV>Player</div></a></td>\ <TD id=clickCol1 onclick="PTalClickSort(this)" class=clickable align=center><A><DIV>Might</a></div></td>\ <TD id=clickCol3 onclick="PTalClickSort(this)" class=clickable><A><DIV>Cities</a></div></td>\ <TD id=clickCol2 onclick="PTalClickSort(this)" class=clickable align=center><A><DIV>Rank</a></div></td>\ <TD id=clickCol9 onclick="PTalClickSort(this)" class=clickable align=center><A><DIV>Online</a></div></td>\ <TD id=clickCol7 onclick="PTalClickSort(this)" class=clickable><A><DIV>City Name</a></div></td>\ <TD id=clickCol4 onclick="PTalClickSort(this)" class=clickable><A><DIV>Lvl</a></div></td>\ <TD id=clickCol5 onclick="PTalClickSort(this)" class=clickable><A><DIV>Coords</a></div></td>\ <TD id=clickCol8 onclick="PTalClickSort(this)" class=clickable><A><DIV>Distance</a></div></td>\ <TD id=clickCol10 onclick="PTalClickSort(this)" class=clickable><A><DIV>Eta</a></div></td>\ <TD class=clickable><A><DIV>Last Login</a></div></td></tr></thead>\ <TBODY id=allBody style="background-color:#ffffff;"></tbody></table></div>\ <DIV width:100%; style="top:670px; left:0px; position:absolute; background-color:#ffffff; border-top:1px solid; margin-top:8px; color:#700; font-weight:bold;">'; document.getElementById('allListOut').innerHTML = m; //style="top:670px; left:0px; position:absolute; document.getElementById('altInput').innerHTML = '<HR><TABLE width=100% cellpaddding=0><TR align=center>\ <TD class=xtab>Show distance from: X: <INPUT size=2 type=text id=plyrX /> Y: <INPUT size=2 type=text id=plyrY /> Or, choose city: <span id=dmcoords></span></td></tr></table>'; document.getElementById('clickCol'+t.sortColNum).className = 'clickable clickableSel'; t.reDisp(); new CdispCityPicker ('plyrdcp', document.getElementById ('dmcoords'), true, t.eventCoords, 0).bindToXYboxes(document.getElementById('plyrX'), document.getElementById('plyrY')); document.getElementById('idFindETASelect').disabled = false; }, eventCoords : function (city, x, y){ var t = Tabs.AllianceList; var m = ''; if (city != null) m = city.name +' ('+ city.x +','+ city.y +')'; else m = x +','+ y; var distFrom = document.getElementById('distFrom'); if (distFrom) distFrom.innerHTML = m; t.ModelCity=city; t.JumpCity(city.name); t.setDistances(x,y); t.setEta(); t.reDisp(); }, eventGetMembers : function (aid){ var t = Tabs.AllianceList; document.getElementById('allListOut').innerHTML = '<BR><BR><CENTER>Searching ...</center>'; t.fetchAllianceMemberList (aid, null, t.eventGotMemberList); }, fetchAllianceMemberList : function (allianceId, allianceName, notify) { var t = Tabs.AllianceList; var params = unsafeWindow.Object.clone(unsafeWindow.g_ajaxparams); params.perPage = 100; if (allianceName) params.allianceName = allianceName; if (allianceId && allianceId != 0) params.allianceId = allianceId; new MyAjaxRequest(unsafeWindow.g_ajaxpath + "ajax/getUserLeaderboard.php" + unsafeWindow.g_ajaxsuffix, { method: "post", parameters: params, onSuccess: function (rslt) { notify (rslt); }, onFailure: function (rslt) { notify ({errorMsg:'AJAX error'}); }, }); }, GetDataForMap : function (allianceId) { var t = Tabs.AllianceList; var params = uW.Object.clone(uW.g_ajaxparams); var Data=[]; params.perPage = 100; params.allianceId = allianceId; new MyAjaxRequest(uW.g_ajaxpath + "ajax/getUserLeaderboard.php" + uW.g_ajaxsuffix, { method: "post", parameters: params, onSuccess: function (rslt) { var city = ''; for (var i=0; i<rslt.results.length; i++) { //alert(rslt.results[i].toSource()); if (rslt.results[i]['userId'] !=0){ player = rslt.results[i]['cities']; for (var ii=0; ii<player.length; ii++) Data.push ({X:player[ii]['xCoord'],Y:player[ii]['yCoord']}); } } if (Data != []) t.PaintDataOnMap(Data); }, onFailure: function (rslt) { notify ({errorMsg:'AJAX error'}); }, }); }, PaintDataOnMap : function(Data){ var provMapCoordsA = {imgWidth:710, imgHeight:708, mapWidth:670, mapHeight:670, leftMargin:31, topMargin:19}; var map = '<DIV id=ptAlliProvMap style="height:'+ provMapCoordsA.imgHeight +'px; width:'+ provMapCoordsA.imgWidth +'px; background-repeat:no-repeat; background-image:url(\''+ URL_PROVINCE_MAP +'\')"></div>'; //Data = [{X:"700", Y:"700"}, {X:"600", Y:"600"}, {X:"500", Y:"500"},{X:"400", Y:"400"},{X:"300", Y:"300"},{X:"200", Y:"200"},{X:"100", Y:"100"},{X:"0", Y:"0"},{X:"750", Y:"750"}, {X:"650", Y:"650"}, {X:"550", Y:"550"},{X:"450", Y:"450"},{X:"350", Y:"350"},{X:"250", Y:"250"},{X:"150", Y:"150"},{X:"50", Y:"50"}]; document.getElementById('allListOut').innerHTML = map; var eMap = document.getElementById('ptAlliProvMap'); for (var cc=0; cc<Seed.cities.length; cc++) { var city = Seed.cities; var Xplot = parseInt((provMapCoordsA.mapWidth * parseInt(city[cc][2])) / 750); var Yplot = parseInt((provMapCoordsA.mapHeight * parseInt(city[cc][3])) / 750); var cf = document.createElement ('div'); cf.style.background = 'black'; cf.style.opacity = '1.0'; cf.style.position='relative'; cf.style.display='block'; cf.style.width='14px'; cf.style.height='16px'; cf.style.border='1px solid #fff'; cf.style.color = 'white'; cf.style.textAlign = 'center'; cf.style.top = (Yplot+provMapCoordsA.topMargin-(cc*16)-8) +'px'; cf.style.left = (Xplot+provMapCoordsA.leftMargin-7) +'px'; cf.innerHTML = (cc+1) +''; eMap.appendChild(cf); } for (var i=0;i<Data.length;i++) { var x = parseInt(Data[i]['X']); var y = parseInt(Data[i]['Y']); var xplot = parseInt((provMapCoordsA.mapWidth * x) / 750); var yplot = parseInt((provMapCoordsA.mapHeight * y) / 750); var ce= document.createElement ('div'); ce.style.background = 'red'; ce.style.opacity = '1.0'; ce.style.position='relative'; ce.style.display='block'; ce.style.width='4px'; ce.style.height='4px'; ce.style.top = (yplot+provMapCoordsA.topMargin -(4*i)-((Seed.cities.length)*18)) +'px'; ce.style.left = (xplot+provMapCoordsA.leftMargin -2) +'px'; eMap.appendChild(ce); } }, fetchLeaderboard : function (uid, notify) { var t = Tabs.AllianceList; var params = unsafeWindow.Object.clone(unsafeWindow.g_ajaxparams); params.userId = uid; new MyAjaxRequest(unsafeWindow.g_ajaxpath + "ajax/getUserLeaderboard.php" + unsafeWindow.g_ajaxsuffix, { method: "post", parameters: params, onSuccess: function (rslt) { notify (rslt); }, onFailure: function (rslt) { notify ({errorMsg:'AJAX error'}); }, }); }, fetchAllianceList : function (allianceName, myAid, notify) { // at least 3 chars :) var t = Tabs.AllianceList; function combineResults (rsltA, rsltM, notify){ if (!rsltA.ok){ if (rsltA.msg.indexOf("No alliance found under")!=0 || !rsltM.ok){ notify (rsltA); return; } rsltA.ok = true; rsltA.count = 0; rsltA.alliancesMatched = {}; } if (rsltM.ok){ rsltA.alliancesMatched['a'+rsltM.allianceInfo.allianceId] = {allianceId: rsltM.allianceInfo.allianceId, allianceName: rsltM.allianceInfo.allianceName, membersCount: rsltM.allianceInfo.members, relation: null, might: rsltM.allianceInfo.might, ranking: rsltM.allianceInfo.ranking}; ++rsltA.count; } notify (rsltA); } var params = unsafeWindow.Object.clone(unsafeWindow.g_ajaxparams); params.allianceName = allianceName; new MyAjaxRequest(unsafeWindow.g_ajaxpath + "ajax/allianceGetSearchResults.php" + unsafeWindow.g_ajaxsuffix, { method: "post", parameters: params, onSuccess: function (rslt) { if (myAid!=null && myAid>0) t.fetchMyAllianceInfo (function (r){ combineResults (rslt, r, notify)}); else notify (rslt); }, onFailure: function (rslt) { notify ({errorMsg:'AJAX error'}); }, }); }, fetchOtherAllianceInfo : function (pageNum, notify){ // as in alliance list, sorted by rank, 10 per page var params = unsafeWindow.Object.clone(unsafeWindow.g_ajaxparams); params.pageNo = pageNum; params.cityId = unsafeWindow.currentcityid; new MyAjaxRequest(unsafeWindow.g_ajaxpath + "ajax/allianceGetOtherInfo.php" + unsafeWindow.g_ajaxsuffix, { method: "post", parameters: params, onSuccess: function (rslt) { notify (rslt); }, onFailure: function (rslt) { notify ({errorMsg:'AJAX error'}); }, }); }, fetchMyAllianceInfo : function (notify){ var params = unsafeWindow.Object.clone(unsafeWindow.g_ajaxparams); new MyAjaxRequest(unsafeWindow.g_ajaxpath + "ajax/allianceGetInfo.php" + unsafeWindow.g_ajaxsuffix, { method: "post", parameters: params, onSuccess: function (rslt) { notify (rslt); }, onFailure: function (rslt) { notify ({errorMsg:'AJAX error'}); }, }); }, fetchPlayerList : function (name, notify){ // at least 3 chars!! var params = unsafeWindow.Object.clone(unsafeWindow.g_ajaxparams); params.searchName = name; params.subType = "ALLIANCE_INVITE"; new MyAjaxRequest(unsafeWindow.g_ajaxpath + "ajax/searchPlayers.php" + unsafeWindow.g_ajaxsuffix, { method: "post", parameters: params, onSuccess: function (rslt) { notify (rslt); }, onFailure: function (rslt) { notify ({errorMsg:'AJAX error'}); }, }); }, fetchPlayerInfo : function (uid, notify){ var params = unsafeWindow.Object.clone(unsafeWindow.g_ajaxparams); params.uid = uid; new MyAjaxRequest(unsafeWindow.g_ajaxpath + "ajax/getUserGeneralInfo.php" + unsafeWindow.g_ajaxsuffix, { method: "post", parameters: params, onSuccess: function (rslt) { notify (rslt); }, onFailure: function (rslt) { notify ({errorMsg:'AJAX error'}); }, }); }, /*** ajax/getOnline.php: (string) ok = true (object) data = [object Object] (boolean) 4394121 = false (undefined) errorMsg: null = null ***/ fetchPlayerStatus : function (uidArray, notify){ var params = unsafeWindow.Object.clone(unsafeWindow.g_ajaxparams); params.checkArr = uidArray.join(','); new MyAjaxRequest(unsafeWindow.g_ajaxpath + "ajax/getOnline.php" + unsafeWindow.g_ajaxsuffix, { method: "post", parameters: params, onSuccess: function (rslt) { notify (rslt); }, onFailure: function (rslt) { notify ({errorMsg:'AJAX error'}); }, }); }, fetchPlayerLastLogin : function (uid, notify){ var params = unsafeWindow.Object.clone(unsafeWindow.g_ajaxparams); params.pid = uid; new MyAjaxRequest(unsafeWindow.g_ajaxpath + "ajax/viewCourt.php" + unsafeWindow.g_ajaxsuffix, { method: "post", parameters: params, onSuccess: function (rslt) { notify (rslt); }, onFailure: function (rslt) { notify ({errorMsg:'AJAX error'}); }, }); }, gotPlayerLastLogin : function (rslt, span){ var t = Tabs.AllianceList; if (!rslt.ok){ span.innerHTML = rslt.errorMsg; return; } var p = rslt.playerInfo; var lastLogin = rslt.playerInfo.lastLogin; if (lastLogin) { m = '<span style="color:black">Last login: '+lastLogin+'</span>'; } else { m = '<span style="color:red">No login date found: '+lastLogin+'</span>'; } span.innerHTML = m + ''; }, ModelCity : {}, estETA : function(dist) { // Need Relief Station Levels to estimate transport, reinf, or reassign times. var t = Tabs.AllianceList; var ret={ETA:0,etaStr:'NA',friendETA:0,friendEtaStr:'NA'}; var cityID; if (dist <= 0) return ret; var EtaType = document.getElementById('idFindETASelect'); var baseSpeedSel = EtaType.options[EtaType.selectedIndex].value; var m = baseSpeedSel.split(','); var horse = 0; var baseSpeed = 0; if(m) { horse = parseInt(m[0]); baseSpeed = parseInt(m[1]); } if (baseSpeed == 0) return ret; var mmLvl = parseInt(Seed.tech.tch11);//Magical Mapping var Speed = 0; if (horse){ //HorsesSiegeSpeed = Base * (1 + MM/10) * (1 + AH/20) var hsLvl = parseInt(Seed.tech.tch12);//Alloy Horse Shoes Speed = baseSpeed * (1 + mmLvl/10.0) * (1 + hsLvl/20.0); } else { //FootSpeed = Base * (1 + MM/10) Speed = baseSpeed * (1 + mmLvl/10.0); } //Grid Speed (tiles/second) = Speed (100ths/min) / 6000 var gSpeed = 0; var estSec; if (Speed>0) { gSpeed = Speed/6000.0;//0.48333 mm=10, hs=9 estSec = (parseFloat(dist)/gSpeed).toFixed(0); } ret.ETA = (parseInt((estSec+''))+30); ret.etaStr = timestr (ret.ETA,1); //ret.etaStr = ret.ETA + ', ' + timestr (ret.ETA,1); //RS - Cities Relief Station Level //Friendly Speed = Speed * (1 + RS/2) if (t.ModelCity) { cityID = t.ModelCity.id; var building = getCityBuilding (cityID, 18); if (building) { fSpeed = Speed * (1 + parseInt(building.maxLevel)/2); gSpeed = fSpeed/6000; estSec = (dist/gSpeed).toFixed(0); ret.friendETA = parseInt((estSec+''))+30; ret.friendEtaStr = timestr ((ret.friendETA+''),1); } } return ret; }, JumpCity:function(city) { var t = Tabs.AllianceList; for (i=0;i<Seed.cities.length;i++) { if (Seed.cities[i][1]==city) var cityNum=i; } cityNum++; var obj = document.getElementById('citysel_'+cityNum); return t.ClickWin(window,obj,'click'); }, ClickWin:function(win,obj,evtName) { var evt = win.document.createEvent("MouseEvents"); evt.initMouseEvent(evtName, true, true, win, 0, 0, 0, 0, 0, false, false, false, false, 0, null); return !obj.dispatchEvent(evt); }, }; /*********************************** Test TAB ***********************************/ Tabs.Test = { tabOrder : 100, tabDisabled : !ENABLE_TEST_TAB, cont : null, init : function (div){ var t = Tabs.Test; t.cont = div; var citySelect = ' <SELECT id=fakeCity>'; for (var c=0; c<Cities.numCities; c++) { aCity = Cities.cities[c].name + ' ('+Cities.cities[c].x + ','+ Cities.cities[c].y+')'; citySelect += '<option value=\''+c+'\'>'+aCity+'</option>'; } citySelect += '</select>'; var m = '<TABLE><TR><TD align=right>Scout: </td><TD><INPUT type=checkbox id=fakeIsScout></td></tr>\ <TR><TD align=right>Wild: </td><TD><INPUT type=checkbox id=fakeIsWild></td></tr>\ <TR><TD align=right>False Report: </td><TD><INPUT type=checkbox disabled id=fakeFalse></td></tr>\ <TR><TD align=right>Seconds: </td><TD><INPUT type=text size=4 value=300 id=fakeSeconds></td></tr>\ <TR><TD align=right># of Supply: </td><TD><INPUT type=text size=6 value=0 id=faketroop0></td></tr>\ <TR><TD align=right># of Militia: </td><TD><INPUT type=text size=6 value=0 id=faketroop1></td></tr>\ <TR><TD align=right># of Scouts: </td><TD><INPUT type=text size=6 value=0 id=faketroop2></td></tr>\ <TR><TD align=right># of Pikes: </td><TD><INPUT type=text size=6 value=0 id=faketroop3></td></tr>\ <TR><TD align=right># of Swords: </td><TD><INPUT type=text size=6 value=0 id=faketroop4></td></tr>\ <TR><TD align=right># of Archers: </td><TD><INPUT type=text size=6 value=0 id=faketroop5></td></tr>\ <TR><TD align=right># of Calvary: </td><TD><INPUT type=text size=6 value=0 id=faketroop6></td></tr>\ <TR><TD align=right># of Heavy Cav: </td><TD><INPUT type=text size=6 value=0 id=faketroop7></td></tr>\ <TR><TD align=right># of Wagons: </td><TD><INPUT type=text size=6 value=0 id=faketroop8></td></tr>\ <TR><TD align=right># of Ballistas: </td><TD><INPUT type=text size=6 value=0 id=faketroop9></td></tr>\ <TR><TD align=right># of Battering Ram: </td><TD><INPUT type=text size=6 value=0 id=faketroop10></td></tr>\ <TR><TD align=right># of Catapults: </td><TD><INPUT type=text size=6 value=0 id=faketroop11></td></tr>\ <TR><TD align=right>Fake name to use: </td><TD><INPUT type=text size=13 value=THIS_IS_A_TEST id=fakeName></td></tr>\ <TR><TD align=right>Target city: </td><TD>'+citySelect+'</td></tr>\ <TR><TD colspan=2 align=center><INPUT id=testSendMarch type=submit value="Fake Attack" \></td></tr></table>\ <INPUT id=ptReloadKOC type=submit value="Reload KOC" \>\ <BR><DIV id=testDiv style="background-color:#fffff0; maxwidth:675; max-height:430px; height:430px; overflow-y:auto;"></div>'; t.cont.innerHTML = m; document.getElementById('testSendMarch').addEventListener ('click', t.clickFakeAttack, false); document.getElementById('ptReloadKOC').addEventListener ('click', t.reloadKOC, false); function xyNotify(city, x, y){ var m = '[ Notified: '+ (city?city.name:'null') +', x='+ x +', y='+ y +' ]'; document.getElementById('testNotify').innerHTML = m; } }, hide : function (){ }, show : function (){ }, reloadKOC : function (){ var goto = 'http://apps.facebook.com/kingdomsofcamelot/?s='+getServerId(); var t = '<FORM target="_top" action="'+ goto +'" method=post><INPUT id=xxptButReload type=submit value=RELOAD><INPUT type=hidden name=s value="'+ getServerId() +'"</form>'; var e = document.createElement ('div'); e.innerHTML = t; document.body.appendChild (e); setTimeout (function (){document.getElementById('xxptButReload').click();}, 0); }, writeDiv : function (msg){ var t = Tabs.Test; if (t.state != null) document.getElementById('testDiv').innerHTML = msg; }, addDiv : function (msg){ var t = Tabs.Test; if (t.state != null) document.getElementById('testDiv').innerHTML += msg; }, createFakeAttack : function (cityNum, isScout, isWild, isFalse, secs, troops, name){ var marchId = 'm'+ (88888 + Math.floor(Math.random()*11111)); var march = {}; if (matTypeof(Seed.queue_atkinc)=='array') Seed.queue_atkinc = {}; if (isFalse) march.marchType = 0; else if (isScout) march.marchType = 3; else march.marchType = 4; march.toCityId = Cities.cities[cityNum].id; if (isWild) { keys = unsafeWindow.Object.keys(Seed.wilderness['city'+Cities.cities[cityNum].id]); march.toTileId = Seed.wilderness['city'+Cities.cities[cityNum].id][keys[0]].tileId; } else { march.toTileId = Cities.cities[cityNum].tileId; } secs = parseInt(secs); march.arrivalTime = unixTime() + secs; march.departureTime = unixTime() - 10; march.unts = {} for(i=0; i<12; i++){ if(troops[i] > 0) march.unts["u"+(i+1)] = addCommas(troops[i]); } march.pid = 1234567; march.score = 9; march.mid = marchId.substr(1); march.players = {} march.players.u1234567 = {} march.players.u1234567.n = name; march.players.u1234567.t = 60; march.players.u1234567.m = 5441192; march.players.u1234567.s = 'M'; march.players.u1234567.w = 1; march.players.u1234567.a = 1; march.players.u1234567.i = 5; Seed.queue_atkinc[marchId] = march; Seed.players.u1234567 = march.players.u1234567; }, clickFakeAttack : function (){ var t = Tabs.Test; var isScout = document.getElementById('fakeIsScout').checked; var isWild = document.getElementById('fakeIsWild').checked; var isFalse = document.getElementById('fakeFalse').checked; var troops = []; for(i=0; i<12; i++) troops[i] = parseInt(document.getElementById('faketroop'+i).value); var secs = parseInt(document.getElementById('fakeSeconds').value); var name = document.getElementById('fakeName').value; var city = document.getElementById('fakeCity').value; t.createFakeAttack (city, isScout, isWild, isFalse, secs, troops ,name); }, } /*********************************** Info Tab ***********************************/ Tabs.Info = { tabOrder: 40, tabLabel: 'Info', cont: null, provMapCoords: {imgWidth:710, imgHeight:708, mapWidth:670, mapHeight:670, leftMargin:31, topMargin:19, bottomMargin:43}, init: function (div){ var t = Tabs.Info; t.cont = div; fortmight = {u53: "4", u55: "7", u60: "1", u61: "2", u62: "3"}; var t = Tabs.Info; rownum = 0; var m = '<STYLE>.xtabH {background:#ffffe8; border:none; padding-right: 5px; padding-left: 5px; margin-left:10px; } ' + '.xtabHL { background:#ffffe8; border-width: 1px; border-style: none none none solid; padding-right:5px; padding-left:5px; margin-left:10px; } ' + '.xtabL { background:none; border-width: 1px; border-style: none none none solid; padding-right:5px; padding-left: 5px; margin-left:10px; } ' + '.xtabLine { padding:0px; spacing:0px; height:1px; border-color:black; border-width: 1px; border-style: none none solid none }</style>' + '<DIV style="height:650px; max-height:650px; overflow-y:auto; overflow-x:hidden"><DIV class=ptstat>UNIT INFORMATION</div><BR /><TABLE align=center cellpadding=1 cellspacing=0>' + '<TR align=center><TD class=xtab></td><TD class=xtabHL colspan=6><B>COST TO BUILD</b></td><TD class=xtabHL colspan=7><B>STATS</b></td><TD class=xtabHL><B>UPKEEP</b></td></tr>' + '<TR valign=bottom align=right><TD class=xtab></td><TD class=xtabHL>Food</td><TD class=xtabH>Wood</td><TD class=xtabH>Stone</td><TD class=xtabH>Ore</td><TD class=xtabH>Pop</td>' + '<TD class=xtabH>Time</td><TD class=xtabHL>Might</td><TD class=xtabH>Life</td><TD class=xtabH>Atk</td><TD class=xtabH>Def</td><TD class=xtabH>Speed</td><TD class=xtabH>Range</td><TD class=xtabH>Load</td>' + '<TD class=xtabHL>Food</td></tr><TR style="height:1px;"><TD style="padding:0px; spacing:0px; height:1px; border-color:black; border-width: 1px; border-style: none none solid none" colspan=15></td></tr>'; for (ui=1; ui<13; ui++){ rsty = ((++rownum % 2)?'':' style="background: #e8e8e8" '); cost = unsafeWindow.unitcost['unt'+ui]; stats = unsafeWindow.unitstats['unt'+ui]; food = unsafeWindow.unitupkeeps[ui]; might = unsafeWindow.unitmight['u'+ui]; m += '<TR '+ rsty +'align=right><TD class=xtab align=left><B>' + cost[0] + '</b></td><TD class=xtabL>' + cost[1] + '</td><TD class=xtab>' + cost[2] + '</td><TD class=xtab>' + cost[3] + '</td><TD class=xtab>' + cost[4] + '</td><TD class=xtab>' + cost[6] + '</td><TD class=xtab>' + timestr(cost[7]) + '</td><TD class=xtabL>' + might + '</td><TD class=xtab>' + stats[0] + '</td><TD class=xtab>' + stats[1] + '</td><TD class=xtab>' + stats[2] +'</td><TD class=xtab>'+ stats[3] +'</td><TD class=xtab>' + stats[4] + '</td><TD class=xtab>'+ stats[5] + '</td><TD class=xtabL>'+ food +'</td></tr>'; } m += '<TR class=xtabLine><TD colspan=15 class=xtabLine></td></tr>'; for (k in unsafeWindow.fortcost){ rsty = ((++rownum % 2)?'':' style="background: #e8e8e8" '); cost = unsafeWindow.fortcost[k]; fi = k.substring(3); stats = unsafeWindow.fortstats['unt'+fi]; might = fortmight['u'+fi]; name = cost[0].replace ('Defensive',''); name = name.replace ('Wall-Mounted',''); m += '<TR '+ rsty + 'align=right><TD align=left class=xtab><B>' + name + '</b></td><TD class=xtabL>' + cost[1] + '</td><TD class=xtab>'+ cost[2] + '</td><TD class=xtab>'+ cost[3] + '</td><TD class=xtab>'+ cost[4] +'</td><TD class=xtab>' + cost[6] + '</td><TD class=xtab>' + timestr(cost[7]) + '</td><TD class=xtabL>' + might + '</td><TD class=xtab>'+ stats[0] + '</td><TD class=xtab>' + stats[1] + '</td><TD class=xtab>'+ stats[2] + '</td><TD class=xtab>'+ stats[3] + '</td><TD class=xtab>'+ stats[4] +'</td><TD class=xtab>' + stats[5] + '</td><TD class=xtabL>0</td></tr>'; } m += '<TR class=xtabLine><TD colspan=15 class=xtabLine></td></tr></table>'; function _displayrow (name, row){ style = ((rownum++ % 2)?'':' style = "background: #e8e8e8"'); m += '<TR' + style + '><TD align=right><B>' + name + '</B></td>'; for (i=0; i<row.length; i++) m += ((row[i]==0)?'<td align=right><SPAN class=boldRed>0</SPAN></td>':'<td align=right>'+addCommas(parseInt(row[i]))+'</td>'); m += '</tr>'; } m += '<BR /><DIV class=ptstat>RESEARCH</div><BR /><SPAN id="Research"> </SPAN><BR><DIV class=ptstat>TROOP TRAINING & DEFENSE BUILDING ESTIMATES</div>' + '<BR /><TABLE align=center cellpadding=1 cellspacing=0><TABLE align=center cellpadding=1 cellspacing=0><TR align=right><TD></td>'; infoRows = []; for (r=0; r<24; r++) infoRows[r] = []; for(i=0; i<Cities.numCities; i++) { cityID = 'city'+ Cities.cities[i].id; m += "<TD align=center valign=bottom width=60px><B>" + Cities.cities[i].name.replace(/ /g, "<BR>") + "</B></TD>"; getTroopDefTrainEstimates(cityID); infoRows[0][i] = Cities.cities[i].numBarracks; infoRows[1][i] = Cities.cities[i].totLevelsBarracks; infoRows[2][i] = Cities.cities[i].foremanBasePoliticsScore; infoRows[3][i] = Cities.cities[i].marshallCombatScore; infoRows[5][i] = Cities.cities[i].stableLevel; infoRows[6][i] = Cities.cities[i].workshopLevel; for (var j=1; j<13; j++) infoRows[j+6][i] = ((Cities.cities[i]['Troop'+j+'Time'] > 0)?(3600 / Cities.cities[i]['Troop'+j+'Time']):0); infoRows[19][i] = Cities.cities[i]['Def53Time']; if (infoRows[19][i] > 0) infoRows[19][i] = 3600 / infoRows[19][i]; infoRows[20][i] = Cities.cities[i]['Def55Time']; if (infoRows[20][i] > 0) infoRows[20][i] = 3600 / infoRows[20][i]; infoRows[21][i] = Cities.cities[i]['Def60Time']; if (infoRows[21][i] > 0) infoRows[21][i] = 3600 / infoRows[21][i]; infoRows[22][i] = Cities.cities[i]['Def61Time']; if (infoRows[22][i] > 0) infoRows[22][i] = 3600 / infoRows[22][i]; infoRows[23][i] = Cities.cities[i]['Def62Time']; if (infoRows[23][i] > 0) infoRows[23][i] = 3600 / infoRows[23][i]; } m += "</tr>"; rownum=0; _displayrow ("Number of Barracks", infoRows[0]); _displayrow ("Total Barracks Level", infoRows[1]); _displayrow ("Foreman Base Politics", infoRows[2]); _displayrow ("Marshall Combat", infoRows[3]); _displayrow ("Stable Level", infoRows[5]); _displayrow ("Workshop Level", infoRows[6]); m += "<TR><TD></TD><TD nowrap align=center colspan="+(Cities.numCities)+"><B>Number able to be trained per hour</B></TD></TR>"; _displayrow ("Supply Troop", infoRows[7]); _displayrow ("Militiaman", infoRows[8]); _displayrow ("Scout", infoRows[9]); _displayrow ("Pikeman", infoRows[10]); _displayrow ("Swordsman", infoRows[11]); _displayrow ("Archer", infoRows[12]); _displayrow ("Cavalry", infoRows[13]); _displayrow ("Heavy Cavalry", infoRows[14]); _displayrow ("Supply Wagon", infoRows[15]); _displayrow ("Ballista", infoRows[16]); _displayrow ("Battering Ram", infoRows[17]); _displayrow ("Catapult", infoRows[18]); m += "<TR><TD></TD><TD nowrap align=center colspan="+(Cities.numCities)+"><B>Number able to be built per hour</B></TD></TR>"; _displayrow ("Crossbow", infoRows[19]); _displayrow ("Trebuchet", infoRows[20]); _displayrow ("Trap", infoRows[21]); _displayrow ("Caltrop", infoRows[22]); _displayrow ("Spiked Barrier", infoRows[23]); m += "</TABLE><BR />"; m += '<DIV class=ptstat>CITY REQUIREMENTS</div><BR /><SPAN id="cityRequirements"> </SPAN><BR />'; m += '<BR><DIV class=ptstat>DISTANCE CALCULATOR (Also plots location on Province Map)</div><DIV class=ptentry><TABLE align=center cellpadding=1 cellspacing=0>' + '<TR><TD class=xtab align=right><B>First Location: </b></td><TD class=xtab> X: <INPUT id=calcX type=text\> Y: <INPUT id=calcY type=text\> Or, choose city: <SPAN id=ptloc1></span></td></tr>' + '<TR><TD class=xtab><B>Second Location: </b></td><TD class=xtab> X: <INPUT id=calcX2 type=text\> Y: <INPUT id=calcY2 type=text\> Or, choose city: <SPAN id=ptloc2></span></td></tr></table>' + '<CENTER><DIV style="width:50%; font-size:14px; border: 1px solid; background-color:white; margin:20px 3px 3px 0px; padding:4px" id=ptdistout></div><BR />' + '<DIV><B>Calculate ETA from <SPAN id="idETAFrom"></SPAN> to <SPAN id="idETATo"></SPAN> with: </B><select id="idETASelect">' + '<OPTION value="0">-- Select --</OPTION>'; for (ui=1; ui<13; ui++) m += '<OPTION value="' + ui + '">' + unsafeWindow.unitcost['unt'+ui][0] + '</OPTION>'; m += '</SELECT></DIV><DIV style="width:50%; font-size:14px; border: 1px solid; background-color:white; margin:20px 3px 3px 0px; padding:4px" id=ptETAout></div></CENTER></div><BR>'; m += '<DIV class=ptstat>PROVINCE MAP</div><DIV id=ptProvMap style="height:'+ t.provMapCoords.imgHeight +'px; width:'+ t.provMapCoords.imgWidth +'px; background-repeat:no-repeat; background-image:url(\''+ URL_PROVINCE_MAP +'\')"></div>'; m += '<BR /><DIV class=ptstat>MISCELLANEOUS INFO</div>Tools version: '+ Version + '<BR />KoC client version: '+ KOCversion +'<BR />' + '<a href="http://koc.dunno.com/index.sjs?f=KocMapViewer&server_id='+serverID+'">KoC Map Viewer</a>, e.g. right-click and open in a new tab<BR />' + '<INPUT id=ptButDebug type=submit name="SEED" value="DEBUG"></div>'; t.cont.innerHTML = m; document.getElementById('ptButDebug').addEventListener('click', function (){debugWin.doit()}, false); for (var c=0; c<Cities.numCities; c++) t.makeCityImg (c, document.getElementById('ptProvMap')); new CdispCityPicker ('ptloc1', document.getElementById('ptloc1'), true, t.eventFromLocChanged, 0).bindToXYboxes(document.getElementById('calcX'), document.getElementById('calcY')); new CdispCityPicker ('ptloc2', document.getElementById('ptloc2'), true, t.eventLocChanged, ((Cities.numCities>1)?1:0)).bindToXYboxes(document.getElementById('calcX2'), document.getElementById('calcY2')); t.eventFromLocChanged(Cities.cities[0], Cities.cities[0].x, Cities.cities[0].y); document.getElementById('idETASelect').addEventListener ('change', t.eventLocChanged, false); }, hide: function (){ }, show: function (){ function rlShow(rl) { var retval = '<TD nowrap><B>'+rl.Name+'</B></TD><TD align=right><B> '; nlETA = ((rl.NextLevelETA > 0)?('(' + (rl.Level + 1) + ': ' + timestr(rl.NextLevelETA) + ')'):''); retval += ((rl.Level < 9)?('<SPAN class=boldRed>' + rl.Level + '</SPAN></B></TD><TD nowrap> ' + nlETA + '</TD>'):(rl.Level + '</B></TD><TD nowrap> ' + nlETA + '</TD>')); return retval; }; var m = ''; getResearchLevels(); m += '<TABLE align=center cellpadding=1 cellspacing=0>' + '<TR>' + rlShow(researchLevels[1]) + '<TD width=10></TD>' + rlShow(researchLevels[6]) + '<TD width=10></TD>' + rlShow(researchLevels[12]) + '</TR>' + '<TR>' + rlShow(researchLevels[2]) + '<TD></TD>' + rlShow(researchLevels[8]) + '<TD></TD>' + rlShow(researchLevels[13]) + '</TR>' + '<TR>' + rlShow(researchLevels[3]) + '<TD></TD>' + rlShow(researchLevels[9]) + '<TD></TD>' + rlShow(researchLevels[14]) + '</TR>' + '<TR>' + rlShow(researchLevels[4]) + '<TD></TD>' + rlShow(researchLevels[15]) + '<TD></TD>' + rlShow(researchLevels[10]) + '</TR>' + '<TR>' + rlShow(researchLevels[5]) + '<TD></TD>' + rlShow(researchLevels[11]) + '<TD></TD>' + rlShow(researchLevels[16]) + '</TR></TABLE>'; document.getElementById('Research').innerHTML = m; var crest = {}; for (k in crestname) crest[k] = (Seed.items['i'+k]?Seed.items['i'+k]:0); var crestreq = { 3:{1101:4, 1102:2, 1103:1}, 4:{1103:4, 1104:3, 1105:1}, 5:{1106:4, 1107:3, 1108:2}, 6:{1109:4, 1110:3, 1111:2}, 7:{1112:4, 1113:3, 1114:2} }; m = '<TABLE align=center cellpadding=1 cellspacing=0>' + '<TR CLASS="xtabH"><TH class=xtab></TH><TH class=xtabHL>Owned/Required 1</TH><TH class=xtabHL>Owned/Required 2</TH><TH class=xtabHL>Owned/Required 3</TH></TR>' + '<TR style="height:1px;"><TD style="padding:0px; spacing:0px; height:1px; border-color:black; border-width: 1px; border-style: none none solid none" colspan=4></td></tr>'; var numFriends = 0; Friends = Seed.appFriends; for (k in Friends) numFriends++; var cityCount = Cities.numCities; csty = ((cityCount == 1)?'':' style="color:#060; font-weight:bold"'); m += '<TR><TD class=xtab'+csty+'><B>City 2</B></TD>'; m += ((parseInt(Seed.player.title) < 7)?('<TD class=xtabL><SPAN class=boldRed>'+Seed.player.title+'/7 Player Level</SPAN></TD>'):('<TD class=xtabL'+csty+'>'+Seed.player.title+'/7 Player Level</TD>')); m += ((numFriends < 10 && cityCount == 1)?('<TD class=xtabL><SPAN class=boldRed>'+numFriends+'/10 Friends</SPAN></TD>'):('<TD class=xtabL'+csty+'>'+numFriends+'/10 Friends</TD>')); m += '<TD class=xtabL'+csty+'> </TD></TR>' rownum = 1; for(k in crestreq){ rsty = ((++rownum % 2)?'':' style="background: #e8e8e8" '); csty = ((k <= cityCount)?' style="color:#060; font-weight:bold"':''); m += '<TR '+rsty+'><TD class=xtab'+csty+'><B>City '+k+'</B></TD>'; for(u in crestreq[k]) { if (k <= cityCount) m+='<TD class=xtabL'+csty+'>'+crest[u]+'/'+crestreq[k][u]+' '+crestname[u]+ '</TD>'; else m+='<TD class=xtabL><SPAN class=bold'+((crest[u] < crestreq[k][u])?'Red':'Green')+'>'+crest[u]+'/'+crestreq[k][u]+' '+crestname[u]+ '</SPAN></TD>'; } m += '</TR>'; } m += '</TABLE></SPAN>'; document.getElementById('cityRequirements').innerHTML = m; }, makeCityImg: function (cityNum, eMap){ var t = Tabs.Info; var city = Cities.cities[cityNum]; var x = parseInt((t.provMapCoords.mapWidth * city.x) / 750); var y = parseInt((t.provMapCoords.mapHeight * city.y) / 750); var ce = document.createElement ('div'); ce.style.background = '#700'; ce.style.opacity = '1.0'; ce.style.position='relative'; ce.style.display='block'; ce.style.width='14px'; ce.style.height='16px'; ce.style.border='1px solid #fff'; ce.style.color = 'white'; ce.style.textAlign = 'center'; ce.style.top = (y+t.provMapCoords.topMargin-(cityNum*18)-8) +'px'; ce.style.left = (x+t.provMapCoords.leftMargin-7) +'px'; eMap.appendChild(ce); ce.innerHTML = (cityNum+1) +''; }, plotCityImg: function (cityNum, eMap, x, y){ var t = Tabs.Info; var xplot = parseInt((t.provMapCoords.mapWidth * x) / 750); var yplot = parseInt((t.provMapCoords.mapHeight * y) / 750); if(document.getElementById('plotmap_'+cityNum) == null){ var ce = document.createElement ('div'); ce.style.background = 'white'; ce.id = 'plotmap_'+cityNum; ce.style.opacity = '1.0'; ce.style.position='relative'; ce.style.display='block'; ce.style.width='14px'; ce.style.height='16px'; ce.style.border='1px solid #fff'; ce.style.color = 'black'; ce.style.textAlign = 'center'; } else ce = document.getElementById('plotmap_'+cityNum); ce.style.top = (yplot+t.provMapCoords.topMargin-((Cities.numCities+cityNum)*18)-8) +'px'; ce.style.left = (xplot+t.provMapCoords.leftMargin-7) +'px'; eMap.appendChild(ce); ce.innerHTML = (cityNum+1) +''; }, eventLocChanged: function (city, x, y){ var t = Tabs.Info; var x1 = parseInt(document.getElementById('calcX').value); var x2 = parseInt(document.getElementById('calcX2').value); if (isNaN(x2)) return; var y1 = parseInt(document.getElementById('calcY').value); var y2 = parseInt(document.getElementById('calcY2').value); var m = 'The distance from '+ x1 +','+ y1 +' to '+ x2 +','+ y2 +' is: <B>'+ distance (x1, y1, x2, y2).toFixed(2) +'</b>'; var cityId1; if (city == null || city.id == undefined) cityId1 = getCityIdFromXY(x1, y1); else cityId1 = city.id; cityId2 = getCityIdFromXY(x2, y2); var friendHostile = ''; if (cityId1 != -1 && cityId2 != -1) friendHostile = 'F'; else friendHostile = 'FH'; document.getElementById('ptdistout').innerHTML = m; document.getElementById('idETAFrom').innerHTML = x1 +','+ y1; document.getElementById('idETATo').innerHTML = x2 +','+ y2; var dist = distance (x1, y1, x2, y2); m = estimateTroopETA(dist, cityId1, document.getElementById('idETASelect').value, friendHostile); if (m.ETAstr != null) document.getElementById('ptETAout').innerHTML = m.ETAstr; t.plotCityImg(0, document.getElementById('ptProvMap'), x1, y1); t.plotCityImg(1, document.getElementById('ptProvMap'), x2, y2); }, eventFromLocChanged: function (city, x, y){ var t = Tabs.Info; var x1 = parseInt(document.getElementById('calcX').value); var x2 = parseInt(document.getElementById('calcX2').value); if (isNaN(x2)) return; var y1 = parseInt(document.getElementById('calcY').value); var y2 = parseInt(document.getElementById('calcY2').value); var m = 'The distance from '+ x1 +','+ y1 +' to '+ x2 +','+ y2 +' is: <B>'+ distance (x1, y1, x2, y2).toFixed(2) +'</b>'; var cityId1; if (city == null || city.id == undefined) cityId1 = getCityIdFromXY(x1, y1); else cityId1 = city.id; cityId2 = getCityIdFromXY(x2, y2); var friendHostile = ''; if (cityId1 != -1 && cityId2 != -1) friendHostile = 'F'; else friendHostile = 'FH'; document.getElementById('ptdistout').innerHTML = m; document.getElementById('idETAFrom').innerHTML = x1 +','+ y1; document.getElementById('idETATo').innerHTML = x2 +','+ y2; var dist = distance (x1, y1, x2, y2); m = estimateTroopETA(dist, cityId1, document.getElementById('idETASelect').value, friendHostile); if (m.ETAstr != null) document.getElementById('ptETAout').innerHTML = m.ETAstr; t.plotCityImg(0, document.getElementById('ptProvMap'), x1, y1); t.plotCityImg(1, document.getElementById('ptProvMap'), x2, y2); }, } /*********************************** Options Tab ***********************************/ Tabs.Options = { tabOrder : 40, cont : null, fixAvailable : {}, init : function (div){ var t = Tabs.Options; t.cont = div; try { m = '<TABLE class=ptTab>\ <TR><TD colspan=2><B>Config:</b></td></tr>\ <TR><TD><INPUT id=ptAllowWinMove type=checkbox /></td><TD>Enable window drag (move window by dragging top bar with mouse)</td></tr>\ <TR><TD><INPUT id=ptHideOnGoto type=checkbox /></td><TD>Hide window when clicking on map coordinates.</td></tr>\ <TR><TD><INPUT id=ptEnableFoodWarn type=checkbox /></td><TD>Show \'food left\' in RED if food will run out in less than \ <INPUT id=optFoodHours type=text size=3 value="'+ Options.foodWarnHours +'"> hours, does NOT affect the food alert anymore!</td></tr>\ <TR><TD><INPUT id=ptEnableFoodTower type=checkbox /></td><TD>Enable Tower food alert. (Warning set to 6 hours, checked every 30min.)</td></tr>\ <TR><TD><INPUT id=ptEnableWisperAlert type=checkbox /></td><TD>Enable sound alert on whisper<SPAN class=boldRed> (NEW)</span></td></tr>\ <TR><TD><INPUT id=ptEnableTowerAlert type=checkbox /></td><TD>Enable sound alert on tower alert in chat<SPAN class=boldRed> (NEW)</span></td></tr>\ <TR><TD colspan=2><B>Chat Layout:</b></td></tr>\ <TR><TD><INPUT id=togChatStuff type=checkbox /></td><TD>Enable Chat Enable Chat enhancements (clickable coords, click on icon to whisper, colors).</td></tr>\ <TR><TD><INPUT id=togChatGlobal type=checkbox /></td><TD>Enable Global background color.</td></tr>\ <TR><TD><INPUT id=togChatWhisper type=checkbox /></td><TD>Enable Whisper in Red Font.</td></tr>\ <TR><TD><INPUT id=togChatBold type=checkbox /></td><TD>Enable Chat in Bold Font.</td></tr>\ <TR><TD><INPUT id=togChatAttack type=checkbox /></td><TD>Enable Red background on tower alert.<SPAN class=boldRed> (NEW)</span></td></tr>\ <TR><TD><INPUT id=togChatLead type=checkbox /></td><TD>Enable grey background for alliance Leaders.<SPAN class=boldRed> (NEW)</span></td></tr>\ <TR><TD colspan=2><B>KofC Features:</b></td></tr>\ <TR><TD><INPUT id=togMsgCountFix type=checkbox /></td><TD>Change message icons place(Msg/Reports) and allign them.</td></tr>'; m += '<TR><TD><INPUT id=togAllRpts type=checkbox /></td><TD>Enable enhanced Alliance Reports.</td></tr>\ <TR><TD><INPUT id=togAllowAlter type=checkbox /></td><TD>Allow other scripts to change format of Alliance Reports.</td></tr>\ <TR><TD><INPUT id=togEnhanceMsging type=checkbox /></td><TD>Enable enhanced messaging ("forward" and "all officers" buttons).</td></tr>\ <TR><TD><INPUT id=togPageNav type=checkbox /></td><TD>Enhanced page navigation for messages and reports.</td></tr>\ <TR><TD><INPUT id=togWarnZero type=checkbox /></td><TD>Warn if attempting to march to location 0,0.</td></tr>\ <TR><TD><INPUT id=togGmtClock type=checkbox /></td><TD>Enable GMT clock next to "Camelot Time" </td></tr>\ <TR><TD><INPUT id=togAttackPicker type=checkbox /></td><TD>Enable target city picker in attack dialog (reinforce, reassign and transport)</td></tr>\ <TR><TD><INPUT id=togBatRounds type=checkbox /></td><TD>Display # of rounds in battle reports</td></tr>\ <TR><TD><INPUT id=togAtkDelete type=checkbox /></td><TD>Enable delete button when displaying battle report</td></tr>\ <TR><TD colspan=2><BR><BR><B>KofC Bug Fixes:</b></td></tr>\ <TR><TD><INPUT id=togTowerFix type=checkbox /></td><TD>Fix tower report to show exact target (city, wild or invalid)</td></tr>\ <TR><TD><INPUT id=togMapDistFix type=checkbox /></td><TD>Fix map to show distances from currently selected city, instead of always the first city.</td></tr>\ <TR><TD><INPUT id=togTowerFix2 type=checkbox /></td><TD>Fix false attack alerts created from scouting missions.</td></tr>\ <TR><TD><INPUT id=togKnightSelect type=checkbox /></td><TD>Do not automatically select a knight when changing march type to scout, transport or reassign</td></tr>\ <TR><TD><INPUT id=togCoordBox type=checkbox /></td><TD>Keep map coordinate box/bookmarks on top of troop activity</td></tr>\ </table><BR><BR><HR>Note that if a checkbox is greyed out there has probably been a change of KofC\'s code, rendering the option inoperable.'; t.cont.innerHTML = m; t.togOpt ('ptEnableFoodWarn', 'enableFoodWarn'); t.togOpt ('ptEnableFoodTower', 'enableFoodTower'); t.togOpt ('ptEnableWisperAlert', 'enableWhisperAlert'); t.togOpt ('ptEnableTowerAlert', 'enableTowerAlert'); t.togOpt ('ptHideOnGoto', 'hideOnGoto'); t.togOpt ('ptAllowWinMove', 'ptWinDrag', mainPop.setEnableDrag); t.togOpt ('togAllowAlter', 'allowAlterAR'); t.togOpt ('togTowerFix', 'fixTower', TowerAlerts.enableFixTarget, TowerAlerts.isFixTargetAvailable); t.togOpt ('togTowerFix2', 'fixTower2', TowerAlerts.enableFixFalseReports, TowerAlerts.isFixFalseReportsAvailable); t.togOpt ('togMsgCountFix', 'fixMsgCount', MessageCounts.init); t.togOpt ('togMapDistFix', 'fixMapDistance', MapDistanceFix.enable, MapDistanceFix.isAvailable); t.togOpt ('togWarnZero', 'fixWarnZero', WarnZeroAttack.setEnable, WarnZeroAttack.isAvailable); t.togOpt ('togPageNav', 'fixPageNav', PageNavigator.enable, PageNavigator.isAvailable); t.togOpt ('togGmtClock', 'gmtClock', GMTclock.setEnable); t.togOpt ('togChatStuff', 'chatEnhance', ChatStuff.setEnable, ChatStuff.isAvailable); t.togOpt ('togChatGlobal', 'chatglobal'); t.togOpt ('togChatWhisper', 'chatwhisper'); t.togOpt ('togChatBold', 'chatbold'); t.togOpt ('togChatAttack', 'chatAttack'); t.togOpt ('togChatLead', 'chatLeaders'); t.togOpt ('togKnightSelect', 'fixKnightSelect', AttackDialog.setEnable, AttackDialog.isKnightSelectAvailable); t.togOpt ('togAttackPicker', 'attackCityPicker', AttackDialog.setEnable, AttackDialog.isCityPickerAvailable); t.togOpt ('togEnhanceMsging', 'enhanceMsging', messageNav.setEnable, messageNav.isAvailable); t.togOpt ('togCoordBox', 'mapCoordsTop', CoordBox.setEnable, CoordBox.isAvailable); t.togOpt ('togBatRounds', 'dispBattleRounds', null, battleReports.isRoundsAvailable); t.togOpt ('togAtkDelete', 'reportDeleteButton', null, battleReports.isDeleteAvailable); document.getElementById('optFoodHours').addEventListener ('change', function () { var x = document.getElementById('optFoodHours').value; if (isNaN(x) || x<0.01 || x>99999){ document.getElementById('optFoodHours').value = Options.foodWarnHours; return; } Options.foodWarnHours = x; saveOptions(); }, false); var checkbox = document.getElementById('togAllRpts'); if (Options.enhanceARpts) checkbox.checked = true; checkbox.addEventListener ('change', function() {Options.enhanceARpts=document.getElementById('togAllRpts').checked; saveOptions(); AllianceReports.enable(Options.enhanceARpts);}, false); } catch (e) { t.cont.innerHTML = '<PRE>'+ e.name +' : '+ e.message +'</pre>'; } }, hide : function (){ }, show : function (){ }, togOpt : function (checkboxId, optionName, callEnable, callIsAvailable){ var t = Tabs.Options; var checkbox = document.getElementById(checkboxId); if (callIsAvailable && callIsAvailable()==false){ checkbox.disabled = true; return; } if (Options[optionName]) checkbox.checked = true; checkbox.addEventListener ('change', new eventToggle(checkboxId, optionName, callEnable).handler, false); function eventToggle (checkboxId, optionName, callOnChange){ this.handler = handler; var optName = optionName; var callback = callOnChange; function handler(event){ Options[optionName] = this.checked; saveOptions(); if (callback != null) callback (this.checked); } } }, } /******************* KOC Map interface ****************/ Map = { /*** 0: bog 10: grassland 11: lake 20: woods 30: hills 40: mountain 50: plain 51: city / barb 53: misted city ***/ generateBlockList : function(left, top, width) { var width5 = parseInt(width / 5); var bl = []; for (x=0; x<width5; x++){ xx = left + (x*5); if (xx > 745) xx -= 750; for (y=0; y<width5; y++){ yy = top + (y*5); if (yy > 745) yy -= 750; bl.push ('bl_'+ xx +'_bt_'+ yy); } } return bl.join(","); }, callback : null, request : function (left, top, width, cb) { if (DEBUG_TRACE) logit (" 1 Map.request(): "+ left +' , '+ top +' , '+ width); left = parseInt(left / 5) * 5; top = parseInt(top / 5) * 5; width = parseInt((width+4) / 5) * 5; var blockString = this.generateBlockList(left, top, width); Map.callback = cb; if (unsafeWindow.SANDBOX) return RequestMAPTEST(left, top, width, callback); var params = unsafeWindow.Object.clone(unsafeWindow.g_ajaxparams); params.blocks = blockString; new MyAjaxRequest(unsafeWindow.g_ajaxpath + "ajax/fetchMapTiles.php" + unsafeWindow.g_ajaxsuffix, { method: "post", parameters: params, onSuccess: function (rslt) { if (DEBUG_TRACE) logit (" 2 Map.request Map = "+ inspect (Map, 2, 1, 2)); Map.callback(left, top, width, rslt); }, onFailure: function (rslt) { Map.callback(left, top, width, rslt); } }); }, }; /*************************************** Train Tab ***********************************************/ Tabs.Train = { tabOrder : 15, cont : null, timer : null, stats : {}, selectedCity : {}, trainTimer : null, running : false, init : function (div){ var t = Tabs.Train; t.cont = div; unsafeWindow.cancelTrain = t.butcancelTrain; unsafeWindow.cancelFort = t.butcancelFort; s = "<DIV id=trainTopSelect>\ <DIV class=ptstat id=trainheader>Train troops and build wall/field defenses</div><DIV style='height:5px'></div><DIV class=ptentry>\ <DIV style='text-align:center; margin-bottom:5px;'>Select City: <span id=ptspeedcity></span></div>\ <TABLE class=ptTab width=100%><TR valign=top><TD width=50%>\ <TABLE align=center><TR><TD align=right>Troop Type: </td><TD colspan=2>\ <SELECT id=ptttType>\ <option value='1'>Supply Troop</option>\ <option value='2'>Militiaman</option>\ <option value='3'>Scout</option>\ <option value='4'>Pikeman</option>\ <option value='5'>Swordsman</option>\ <option value='6'>Archer</option>\ <option value='7'>Cavalry</option>\ <option value='8'>Heavy Cavalry</option>\ <option value='9'>Supply Wagon</option>\ <option value='10'>Ballista</option>\ <option value='11'>Battering Ram</option>\ <option value='12'>Catapult</option>\ </select> (max <span id=ptttSpMax></span>)</td></tr>\ <TR><TD align=right># per slot: </td><TD><INPUT id='ptttInpPS' size=5 type='text' value='0'\></td>\ <TD><INPUT id='ptttButMaxPS' type=submit value='max'\> (max <span id=ptttSpMaxPS>0</span>)</td></tr>\ <TR><TD align=right># of slots: </td><TD><INPUT id='ptttInpSlots' size=2 type='text' value='1'\></td>\ <TD width=75%><INPUT id='ptttButMaxSlots' type=submit value='max'\> (max <span id=ptttSpMaxSlots>1</span>)</td></tr>\ <TR><TD align=right>Limited by:</td><td><span id=ptttLimiter class=boldRed></span></TD><TD><span id=ptttEstimate></span></TD></TR>\ <TR><TD align=right valign=top>Set Workers idle: </td><TD colspan=2><INPUT type=CHECKBOX id=chkPop"+ (Options.maxIdlePop?' CHECKED ':'') +"> \ <SPAN style='white-space:normal;'>Allows you to train more troops. May temporarily set idle population negative.</span>\ <br><INPUT type=CHECKBOX id=chkTut> \ <SELECT id=tutelage>\ <option value='36'>Lancelot's Tutelage</option>\ <option value='37'>Arthur's Tutelage</option>\ <option value='38'>Merlin's Tutelage</option>\ </select>\ </td></tr>\ <TR><TD colspan=3 align=center><DIV style='height:10px'></div><INPUT id='ptttButDo' type=submit value='Train Troops'\></td></tr>\ </table></td><TD width=20></td><TD style='border-left:solid 2px;' width=50% align=center>\ <TABLE align=center><TR><TD align=right>Defense Type: </td><TD colspan=2>\ <SELECT id=pttdType>\ <option value='53'>Crossbow</option>\ <option value='55'>Trebuchet</option>\ <option value='60'>Trap</option>\ <option value='61'>Caltrop</option>\ <option value='62'>Spiked Barrier</option>\ </select> (<span id=pttdSpMax></span>)</td></tr>\ <TR><TD align=right># per slot: </td><TD><INPUT id='pttdInpPS' size=5 type='text' value='0'\></td>\ <TD><INPUT id='pttdButMaxPS' type=submit value='max'\> (max <span id=pttdSpMaxPS>0</span>)</td></tr>\ <TR><TD align=right># of slots: </td><TD><INPUT id='pttdInpSlots' size=2 type='text' value='1'\></td>\ <TD width=75%><INPUT id='pttdButMaxSlots' type=submit value='max'\> (max <span id=pttdSpMaxSlots>1</span>)</td></tr>\ <TR><td align=right>Limited by:</td><TD><span id=pttdLimiter class=boldRed></span></td><TD><span id=pttdEstimate></span></TD></tr>\ <TR align=center><TD colspan=3><SPAN id=pttdSpace></span></td></tr>\ <TR><TD colspan=3 align=center><DIV style='height:10px'>\ <SELECT id=siege>\ <option value='0'><CENTER>--- "+unsafeWindow.g_js_strings.commonstr.speedup+" ---</center></option>\ <option value='26'>"+ unsafeWindow.itemlist.i26.name+"</option>\ </select></div>\ <TR><TD colspan=3 align=center><DIV style='height:10px'></div><INPUT id='pttdButDo' type=submit value='Build Defenses'\></td></tr></table>\ </td></tr></table></div></div>\ <TABLE align=center width=425 class=ptTab><TR><TD><div id=ptTrainStatus style='overflow-y:auto; max-height:78px; height: 78px;'></div></td></tr></table>\ <div style='height: 330px; background: #e8ffe8'>\ <TABLE width=100% class=ptTab><TR><TD colspan=3><DIV id=divSTtop></div></td></tr>\ <TR><TD width=50% style='padding-left:15px; padding-right:15px'><DIV style='text-align:center'><B>Troop Queue (<SPAN id=statTTtot></span>)</b><BR><HR></div><DIV id=divSTleft style='overflow-y: auto; height:210px; max-height:210px'></div></td>\ <TD width=50% style='padding-left:15px; padding-right:15px'><DIV style='text-align:center'><B>Defense Queue (<SPAN id=statDTtot></span>)</b><BR><HR></div><DIV id=divSTright style='overflow-y: auto; height:210px; max-height:210px'></div></td></tr>\ </div>"; t.cont.innerHTML = s; var dcp = new CdispCityPicker ('ptspeed', document.getElementById('ptspeedcity'), true, t.clickCitySelect, 0); t.TTspMax = document.getElementById ('ptttSpMax'); t.TTspMaxPS = document.getElementById ('ptttSpMaxPS'); t.TTspMaxSlots = document.getElementById ('ptttSpMaxSlots'); t.TTbutMaxSlots = document.getElementById ('ptttButMaxSlots'); t.TTbutMaxPerSlot = document.getElementById ('ptttButMaxPS'); t.TTinpPerSlot = document.getElementById ('ptttInpPS'); t.TTinpSlots = document.getElementById ('ptttInpSlots'); t.TTselType = document.getElementById ('ptttType'); t.TTbutDo = document.getElementById ('ptttButDo'); t.TTlimiter = document.getElementById ('ptttLimiter'); t.TDspMax = document.getElementById ('pttdSpMax'); t.TDspMaxPS = document.getElementById ('pttdSpMaxPS'); t.TDspMaxSlots = document.getElementById ('pttdSpMaxSlots'); t.TDbutMaxSlots = document.getElementById ('pttdButMaxSlots'); t.TDbutMaxPerSlot = document.getElementById ('pttdButMaxPS'); t.TDinpPerSlot = document.getElementById ('pttdInpPS'); t.TDinpSlots = document.getElementById ('pttdInpSlots'); t.TDselType = document.getElementById ('pttdType'); t.TDbutDo = document.getElementById ('pttdButDo'); t.TDspSpace = document.getElementById ('pttdSpace'); t.TDlimiter = document.getElementById ('pttdLimiter'); t.divTrainStatus = document.getElementById ('ptTrainStatus'); t.TTinpSlots.addEventListener ('change', t.updateTopTroops, false); t.TTbutMaxPerSlot.addEventListener ('click', t.clickTroopMaxPS, false); t.TTbutMaxSlots.addEventListener ('click', t.clickTroopMaxSlots, false); t.TTselType.addEventListener ('change', t.changeTroopSelect, false); t.TTbutDo.addEventListener ('click', t.clickTroopDo, false); t.TDinpSlots.addEventListener ('change', t.updateTopDef, false); t.TDselType.addEventListener ('change', t.changeDefSelect, false); t.TDbutMaxPerSlot.addEventListener ('click', t.clickDefMaxPS, false); t.TDbutMaxSlots.addEventListener ('click', t.clickDefMaxSlots, false); t.TDbutDo.addEventListener ('click', t.clickDefDo, false); document.getElementById ('chkPop').addEventListener ('change', t.clickCheckIdlePop, false); t.changeTroopSelect(); t.changeDefSelect(); }, hide : function (){ var t = Tabs.Train; clearTimeout (t.timer); }, show : function (){ var t = Tabs.Train; clearTimeout (t.timer); t.displayCityStats(); t.changeTroopSelect(); t.changeDefSelect(); t.timer = setTimeout (t.show, 2000); }, /******* TROOPS ******/ updateTopTroops : function (){ var t = Tabs.Train; var slots = parseInt(t.TTinpSlots.value, 10); if (isNaN(slots) || slots<0) slots = 0; t.TTspMax.innerHTML = t.stats.MaxTrain; t.TTlimiter.innerHTML = t.stats.Limiter; t.TTspMaxSlots.innerHTML = t.stats.barracks - t.stats.queued; if (slots<1 || (t.stats.barracks-t.stats.queued < 1)) t.TTspMaxPS.innerHTML = 0; else t.TTspMaxPS.innerHTML = parseInt(t.stats.MaxTrain / slots); }, clickTroopMaxPS : function (){ var t = Tabs.Train; var slots = parseInt(t.TTinpSlots.value, 10); if (slots<1 || (t.stats.barracks-t.stats.queued < 1)) t.TTinpPerSlot.value = 0; else t.TTinpPerSlot.value = parseInt(t.stats.MaxTrain / slots); }, clickTroopMaxSlots : function (){ var t = Tabs.Train; t.TTinpSlots.value = t.stats.barracks - t.stats.queued; }, clickCitySelect : function (city){ var t = Tabs.Train; t.selectedCity = city; t.lastQueString = null; t.lastDQueString = null; t.displayCityStats (); t.changeTroopSelect(); t.changeDefSelect(); t.JumpCity(city.name); }, JumpCity:function(city) { var t = Tabs.AllianceList; for (i=0;i<Seed.cities.length;i++) { if (Seed.cities[i][1]==city) var cityNum=i; } cityNum++; var obj = document.getElementById('citysel_'+cityNum); return t.ClickWin(window,obj,'click'); }, ClickWin:function(win,obj,evtName) { var evt = win.document.createEvent("MouseEvents"); evt.initMouseEvent(evtName, true, true, win, 0, 0, 0, 0, 0, false, false, false, false, 0, null); return !obj.dispatchEvent(evt); }, clickCheckIdlePop : function (){ var t = Tabs.Train; if (document.getElementById ('chkPop').checked) Options.maxIdlePop = true; else Options.maxIdlePop = false; saveOptions (); t.displayCityStats (); t.changeTroopSelect (); }, limitingFactor : null, changeTroopSelect : function (){ var t = Tabs.Train; var cityId = t.selectedCity.id; // unitcost: NAME, Food, Wood, Stone, Ore, Gold, Pop, ? var id = t.TTselType.value; t.lastTroopSelect = id; var uc = unsafeWindow.unitcost['unt'+id]; var max = 9999999999; var limiter = 'Unknown'; if ( (t.stats.food / uc[1]) < max) { max = t.stats.food / uc[1]; limiter = 'Food'; } if ( (t.stats.wood / uc[2]) < max) { max = t.stats.wood / uc[2]; limiter = 'Wood'; } if ( (t.stats.stone / uc[3]) < max) { max = t.stats.stone / uc[3]; limiter = 'Stone'; } if ( (t.stats.ore / uc[4]) < max) { max = t.stats.ore / uc[4]; limiter = 'Ore'; } if ( (t.stats.idlePop / uc[6]) < max) { max = t.stats.idlePop / uc[6]; limiter = 'Idle Population'; } t.limitingFactor = null; var uc = unsafeWindow.unitcost['unt'+id]; var max = 9999999999; if ( (t.stats.food / uc[1]) < max){ max = t.stats.food / uc[1]; t.limitingFactor = 'food'; } if ( (t.stats.wood / uc[2]) < max){ max = t.stats.wood / uc[2]; t.limitingFactor = 'wood'; } if ( (t.stats.stone / uc[3]) < max){ max = t.stats.stone / uc[3]; t.limitingFactor = 'stone'; } if ( (t.stats.ore / uc[4]) < max){ max = t.stats.ore / uc[4]; t.limitingFactor = 'ore'; } if ( (t.stats.idlePop / uc[6]) < max){ max = t.stats.idlePop / uc[6]; t.limitingFactor = 'pop'; } t.stats.MaxTrain = parseInt (max); t.stats.Limiter = limiter; if (t.stats.MaxTrain < 0) t.stats.MaxTrain = 0; if (matTypeof(uc[8]) == 'object'){ for (k in uc[8]){ // check building requirement var b = getCityBuilding (cityId, k.substr(1)); if (b.maxLevel < uc[8][k][1]){ t.stats.MaxTrain = 0; t.stats.Limiter = 'Building'; t.limitingFactor = null; break; } } } if (matTypeof(uc[9]) == 'object'){ for (k in uc[9]){ // check tech requirement if (parseInt(Seed.tech['tch'+k.substr(1)]) < uc[9][k][1]){ t.stats.MaxTrain = 0; t.limitingFactor = null; t.stats.Limiter = 'Research'; break; } } } if (t.limitingFactor){ document.getElementById('ptttr_'+ t.limitingFactor).className = 'boldRed'; } t.updateTopTroops(); }, clickTroopDo : function (){ var t = Tabs.Train; var cityId = t.selectedCity.id; var unitId = t.TTselType.value; var perSlot = parseInt(t.TTinpPerSlot.value, 10); var numSlots = parseInt(t.TTinpSlots.value, 10); t.displayCityStats (); if (t.running){ t.stopTraining('<SPAN class=boldRed>Training cancelled by user</span>'); return; } if (perSlot<1){ t.divTrainStatus.innerHTML = '<FONT COLOR=#550000>Number of troops per slot must be greater than 0.</font>'; return; } if (perSlot*numSlots > t.stats.MaxTrain){ t.divTrainStatus.innerHTML = '<FONT COLOR=#550000>Can\'t train that many troops (max is '+ t.stats.MaxTrain +' total)</font>'; return; } if (numSlots<1 || numSlots>t.stats.barracks - t.stats.queued){ t.divTrainStatus.innerHTML = '<FONT COLOR=#550000>Invalid number of slots.</font>'; return; } if (document.getElementById ('chkTut').checked) var tut = document.getElementById ('tutelage').value; else var tut = 0; t.TDbutDo.disabled = true; t.TTbutDo.className = 'ptButCancel'; t.TTbutDo.value = 'CANCEL'; var que = []; for (var i=0; i<numSlots; i++) que.push (['T', unitId, parseInt (perSlot)]); t.divTrainStatus.innerHTML = ''; t.running = true; t.doQueue (cityId, tut, que); }, /******* DEF ******/ updateTopDef : function (){ var t = Tabs.Train; var slots = parseInt(t.TDinpSlots.value, 10); if (isNaN(slots) || slots<0) slots = 0; t.TDspMax.innerHTML = 'max:'+ t.stats.MaxDefTrain +' owned:'+ t.stats.defOwned; t.TDlimiter.innerHTML = t.stats.DefLimiter; t.TDspMaxSlots.innerHTML = t.stats.wallLevel-t.stats.Dqueued; if (slots<1) t.TDspMaxPS.innerHTML = 0; else t.TDspMaxPS.innerHTML = parseInt(t.stats.MaxDefTrain / slots); t.TDspSpace.innerHTML = 'Wall level: <B>'+ t.stats.wallLevel +'</b><BR>Wall space: '+ (t.stats.wallSpaceUsed+t.stats.wallSpaceQueued) +'/<B>'+ t.stats.wallSpace +'</b><BR>\ Field space: '+ (t.stats.fieldSpaceUsed+t.stats.fieldSpaceQueued) +'/<B>'+ t.stats.fieldSpace +'</b>'; }, changeDefSelect : function (){ var t = Tabs.Train; var cityId = t.selectedCity.id; // unitcost: NAME, Food, Wood, Stone, Ore, Gold, Pop, ? var id = t.TDselType.value; t.lastDefSelect = id; t.stats.defOwned = parseInt(Seed.fortifications['city' + cityId]['fort'+id]); var uc = unsafeWindow.fortcost['frt'+id]; var max = 9999999999; if ( (t.stats.food / uc[1]) < max) max = t.stats.food / uc[1]; limiter = 'Food'; if ( (t.stats.wood / uc[2]) < max) max = t.stats.wood / uc[2]; limiter = 'Wood'; if ( (t.stats.stone / uc[3]) < max) max = t.stats.stone / uc[3]; limiter = 'Stone'; if ( (t.stats.ore / uc[4]) < max) max = t.stats.ore / uc[4]; limiter = 'Ore'; if ( (t.stats.idlePop / uc[6]) < max) max = t.stats.idlePop / uc[6]; limiter = 'Idle Population'; t.stats.MaxDefTrain = parseInt (max); if (t.stats.MaxDefTrain < 0) t.stats.MaxDefTrain = 0; if (matTypeof(uc[8]) == 'object'){ for (k in uc[8]){ // check building requirement var b = getCityBuilding (cityId, k.substr(1)); if (b.maxLevel < uc[8][k][1]){ t.stats.MaxDefTrain = 0; t.stats.DefLimiter = 'Building'; break; } } } if (matTypeof(uc[9]) == 'object'){ for (k in uc[9]){ // check tech requirement if (parseInt(Seed.tech['tch'+k.substr(1)]) < uc[9][k][1]){ t.stats.MaxDefTrain = 0; t.stats.DefLimiter = 'Research'; break; } } } var spaceEach = parseInt(unsafeWindow.fortstats["unt"+ id][5]); if (id<60) var spaceAvail = t.stats.wallSpace - t.stats.wallSpaceUsed - t.stats.wallSpaceQueued; else var spaceAvail = t.stats.fieldSpace - t.stats.fieldSpaceUsed - t.stats.fieldSpaceQueued; if ( t.stats.MaxDefTrain * spaceEach > spaceAvail) t.stats.MaxDefTrain = parseInt(spaceAvail / spaceEach); if (id<60) t.stats.DefLimiter = 'Wall Space'; else t.stats.DefLimiter = 'Field Space'; t.updateTopDef(); }, clickDefMaxPS : function (){ var t = Tabs.Train; var slots = parseInt(t.TDinpSlots.value, 10); if (slots<1) t.TDinpPerSlot.value = 0; else t.TDinpPerSlot.value = parseInt(t.stats.MaxDefTrain / slots); }, clickDefMaxSlots : function (){ var t = Tabs.Train; t.TDinpSlots.value = t.stats.wallLevel-t.stats.Dqueued; }, clickDefDo : function (){ var t = Tabs.Train; var cityId = t.selectedCity.id; var unitId = t.TDselType.value; var perSlot = parseInt(t.TDinpPerSlot.value, 10); var numSlots = parseInt(t.TDinpSlots.value, 10); t.displayCityStats (); if (t.running){ t.stopTraining('<SPAN class=boldRed>Training cancelled by user</span>'); return; } if (perSlot<1){ t.divTrainStatus.innerHTML = '<FONT COLOR=#550000>Number of units per slot must be greater than 0.</font>'; return; } if (perSlot*numSlots > t.stats.MaxDefTrain){ t.divTrainStatus.innerHTML = '<FONT COLOR=#550000>Can\'t train that many unit (max is '+ t.stats.MaxDefTrain +' total)</font>'; return; } if (numSlots<1 || numSlots > t.stats.wallLevel-t.stats.Dqueued){ t.divTrainStatus.innerHTML = '<FONT COLOR=#550000>Invalid number of slots.</font>'; return; } var siege = document.getElementById ('siege').value; t.TTbutDo.disabled = true; t.TDbutDo.className = 'ptButCancel'; t.TDbutDo.value = 'CANCEL'; var que = []; for (var i=0; i<numSlots; i++) que.push (['T', unitId, parseInt (perSlot)]); t.divTrainStatus.innerHTML = ''; t.running = true; t.doDefQueue (cityId, que); }, doDefQueue : function (cityId, que, errMsg){ var t = Tabs.Train; clearTimeout (t.trainTimer); try { t.displayCityStats(); if (errMsg){ t.stopTraining ('<SPAN class=boldRed>ERROR: '+ errMsg +'</span>'); return; } var cmd = que.shift(); if (!cmd){ t.stopTraining ('<B>Done queueing defenses.</b>'); return; } if (cmd[0] == 'T'){ t.dispTrainStatus ('Training '+ cmd[2] +' '+ fortNamesShort[cmd[1]] +' at '+ Cities.byID[cityId].name +' ('+ que.length +' slots remaining)<BR>'); doDefTrain ( cityId, cmd[1], cmd[2], function(errMsg){ t.trainTimer = setTimeout(function (){Tabs.Train.doDefQueue(cityId, que, errMsg);}, (Math.random()*3500)+1500); } ); } } catch (err) { logit (inspect (err, 8, 1)); t.stopTraining ('<SPAN class=boldRed>PROGRAM ERROR: '+ err.message +'</span>'); } }, // fix KofC bugs .... // if first start time > now, make it now // if any end time != next start time, fix it fixQueTimes : function (q){ var now = unixTime(); if (q[0][2] > now) q[0][2] = now; for (var i=0; i<q.length; i++){ if (q[i+1]!=null && q[i+1][2]!=q[i][3]) q[i][3] = q[i+1][2]; } }, expireTheQueue : function (q){ if (q==null) return; var now = unixTime(); while (q.length>0 && (q[0][3] - now) < 1) q.shift(); }, displayCityStats : function (){ var t = Tabs.Train; var cityId = t.selectedCity.id; t.stats.food = parseInt (Seed.resources['city'+cityId].rec1[0]/3600); t.stats.wood = parseInt (Seed.resources['city'+cityId].rec2[0]/3600); t.stats.stone = parseInt (Seed.resources['city'+cityId].rec3[0]/3600); t.stats.ore = parseInt (Seed.resources['city'+cityId].rec4[0]/3600); t.stats.gold = Seed.citystats['city'+cityId].gold[0]; if (Options.maxIdlePop) t.stats.idlePop = parseInt(Seed.citystats['city'+cityId].pop[0]); else t.stats.idlePop = parseInt(Seed.citystats['city'+cityId].pop[0]) - parseInt(Seed.citystats['city'+cityId].pop[3]); t.stats.barracks = getCityBuilding (cityId, 13).count; var m = '<CENTER><B>'+ Cities.byID[cityId].name +' ('+ Cities.byID[cityId].x +','+ Cities.byID[cityId].y +')</b></center><HR>'; m += '<TABLE class=ptTab width=100%><TR align=center>\ <TD width=8%><B>Supply:</b></td><TD width=8%><B>Militia:</b></td><TD width=8%><B>Scout:</b></td>\ <TD width=8%><B>Pike:</b></td><TD width=8%><B>Sword:</b></td><TD width=8%><B>Archer:</b></td>\ <TD width=8%><B>Cav:</b></td><TD width=8%><B>Heavy Cav:</b></td><TD width=8%><B>Wagon:</b></td>\ <TD width=8%><B>Ballista:</b></td><TD width=8%><B>Ram:</b></td><TD width=8%><B>Catapult:</b></td><tr>'; m += '<TR align=center><TD width=8%>'+addCommas(Seed.units['city'+cityId]['unt1'])+'</td><TD width=8%>'+addCommas(Seed.units['city'+cityId]['unt2'])+ '<TD width=8%>'+addCommas(Seed.units['city'+cityId]['unt3'])+'</td><TD width=8%>'+addCommas(Seed.units['city'+cityId]['unt4'])+ '<TD width=8%>'+addCommas(Seed.units['city'+cityId]['unt5'])+'</td><TD width=8%>'+addCommas(Seed.units['city'+cityId]['unt6'])+ '<TD width=8%>'+addCommas(Seed.units['city'+cityId]['unt7'])+'</td><TD width=8%>'+addCommas(Seed.units['city'+cityId]['unt8'])+ '<TD width=8%>'+addCommas(Seed.units['city'+cityId]['unt9'])+'</td><TD width=8%>'+addCommas(Seed.units['city'+cityId]['unt10'])+ '<TD width=8%>'+addCommas(Seed.units['city'+cityId]['unt11'])+'</td><TD width=8%>'+addCommas(Seed.units['city'+cityId]['unt12'])+'</td><tr></table>'; m += '<TABLE class=ptTab width=100%><TR align=center>\ <TD width=18%><SPAN id=ptttr_food><B>Food:</b><BR>'+ addCommasInt(t.stats.food) +'</span></td>\ <TD width=16%><SPAN id=ptttr_wood><B>Wood:</b><BR>'+ addCommasInt(t.stats.wood) +'</span></td>\ <TD width=16%><SPAN id=ptttr_ore><B>Ore:</b><BR>'+ addCommasInt(t.stats.ore) +'</span></td>\ <TD width=16%><SPAN id=ptttr_gold><B>Stone:</b><BR>'+ addCommasInt(t.stats.stone) +'</span></td>\ <TD width=16%><SPAN id=ptttr_gold><B>Gold:</b><BR>'+ addCommasInt(t.stats.gold) +'</span></td>\ <TD width=16%><SPAN id=ptttr_pop><B>Idle Pop:</b><BR>'+ addCommasInt(t.stats.idlePop) +'</span></td></tr></table><BR>'; document.getElementById ('divSTtop').innerHTML = m; // troop queue .... var totTime = 0; var q = Seed.queue_unt['city'+cityId]; t.expireTheQueue(q); var qs = q.toString(); var now = unixTime(); if (q!=null && q.length>0) totTime = q[q.length-1][3] - now; if ( qs == t.lastQueString){ if (q!=null && q.length>0){ var cur = q[0][3] - now; document.getElementById ('ptttfq').innerHTML = timestr(cur, true); } } else { t.lastQueString = qs; t.stats.queued = 0; m = '<TABLE align=center class=ptTab>'; if (q!=null && q.length>0 ){ t.fixQueTimes (q); t.stats.queued = q.length; first = true; for (var i=0; i<q.length; i++){ start = q[i][2]; end = q[i][3]; if (first) actual = end - now; else actual = end - lastEnd; if (actual < 0) actual = 0; q[i][6] = cityId; m += '<TR align=right><TD width="5px"><A><DIV onclick="cancelTrain('+ q[i][0]+','+q[i][1]+','+q[i][2]+','+q[i][3]+','+q[i][5]+','+q[i][6]+','+i +')">X</div></a></td>'; m += '<TD>'+ q[i][1] +' </td><TD align=left> '+ unsafeWindow.unitcost['unt'+q[i][0]][0]; if (first) m += '</td><TD> '+ timestr(end-start, true) +'</td><TD> (<SPAN id=ptttfq>'+ timestr(actual, true) +'</span>)'; else m += '</td><TD> '+ timestr(actual, true) +'</td></tr>'; lastEnd = end; first = false; } } m += '</table>'; document.getElementById ('divSTleft').innerHTML = m; } m = t.stats.barracks +' barracks'; if (t.stats.queued > 0) m += ', '+ t.stats.queued +' slots'; if (totTime > 0) m += ', '+ unsafeWindow.timestr(totTime); document.getElementById ('statTTtot').innerHTML = m; // defense queue .... getWallInfo (cityId, t.stats); var totTime = 0; var q = Seed.queue_fort['city'+cityId]; t.expireTheQueue(q); var qs = q.toString(); if (q!=null && q.length>0) totTime = q[q.length-1][3] - now; if ( qs == t.lastDQueString){ if (q!=null && q.length>0){ var cur = q[0][3] - now; document.getElementById ('pttdfq').innerHTML = timestr(cur, true); } } else { t.lastDQueString = qs; t.stats.Dqueued = 0; t.stats.wallSpaceQueued = 0; t.stats.fieldSpaceQueued = 0; m = '<TABLE align=center class=ptTab>'; if (q!=null && q.length > 0 ){ t.fixQueTimes (q); t.stats.Dqueued = q.length; first = true; for (i=0; i<q.length; i++){ if (q[i][0] < 60) t.stats.wallSpaceQueued += parseInt(unsafeWindow.fortstats["unt"+ q[i][0]][5]) * parseInt(q[i][1]); else t.stats.fieldSpaceQueued += parseInt(unsafeWindow.fortstats["unt"+ q[i][0]][5]) * parseInt(q[i][1]); start = q[i][2]; end = q[i][3]; if (first) actual = end - now; else actual = end - lastEnd; if (actual < 0) actual = 0; q[i][7]=cityId; m += '<TR align=right><TD width="5px"><A><DIV onclick="cancelFort('+ q[i][0]+','+q[i][1]+','+q[i][2]+','+q[i][3]+','+q[i][5]+','+q[i][6]+','+q[i][7] +','+ i +')">X</div></a></td>' m += '<TD>'+ q[i][1] +' </td><TD align=left> '+ fortNamesShort[q[i][0]]; if (first) m += '</td><TD> '+ timestr(end-start, true) +'</td><TD> (<SPAN id=pttdfq>'+ timestr(actual, true) +'</span>)'; else m += '</td><TD> '+ timestr(actual, true) +'</td></tr>'; lastEnd = end; first = false; } } m += '</table>'; document.getElementById ('divSTright').innerHTML = m; } m = t.stats.Dqueued +' slots'; if (totTime > 0) m += ', '+ unsafeWindow.timestr(totTime); document.getElementById ('statDTtot').innerHTML = m; }, dispTrainStatus : function (msg){ var t = Tabs.Train; t.divTrainStatus.innerHTML = msg + t.divTrainStatus.innerHTML; }, butcancelTrain : function (typetrn, numtrptrn, trnTmp, trnETA, trnNeeded, cityId, trainingId){ var t = Tabs.Train; var params = unsafeWindow.Object.clone(unsafeWindow.g_ajaxparams); params.pf =0; params.requestType = "CANCEL_TRAINING"; params.cityId = cityId; params.typetrn = typetrn; params.numtrptrn = numtrptrn; params.trnETA = trnETA; params.trnTmp = trnTmp; params.trnNeeded = trnNeeded; new AjaxRequest(unsafeWindow.g_ajaxpath + "ajax/cancelTraining.php" + unsafeWindow.g_ajaxsuffix, { method: "post", parameters: params, onSuccess: function (message) { var rslt=eval("("+message.responseText+")"); if (rslt.ok) { var k=0; for(var j=0;j<Seed.queue_unt["city"+cityId].length;j++){ if(j>trainingId){ Seed.queue_unt["city"+cityId][j][2]=parseInt(rslt.dateTraining[k]["start"]); Seed.queue_unt["city"+cityId][j][3]=parseInt(rslt.dateTraining[k]["end"]); k++; } } Seed.queue_unt["city"+cityId].splice(trainingId,1); for(var i=1;i<5;i++){ var totalReturn=parseInt(unsafeWindow.unitcost["unt"+typetrn][i])*parseInt(numtrptrn)*3600/2; Seed.resources["city"+cityId]["rec"+i][0]=parseInt(Seed.resources["city"+cityId]["rec"+i][0])+totalReturn; } } }, onFailure: function () { }, }); }, butcancelFort : function (typefrt, numtrpfrt, frtTmp, frtETA, frtNeeded, frtid, cityId, queueId){ var t = Tabs.Train; var params = unsafeWindow.Object.clone(unsafeWindow.g_ajaxparams); params.pf =0; params.requestType = "CANCEL_FORTIFICATIONS"; params.cityId = cityId; params.typefrt = typefrt; params.numtrpfrt = numtrpfrt; params.frtETA = frtETA; params.frtTmp = frtTmp; params.frtNeeded = frtNeeded; params.frtid = frtid; new AjaxRequest(unsafeWindow.g_ajaxpath + "ajax/cancelFortifications.php" + unsafeWindow.g_ajaxsuffix, { method: "post", parameters: params, onSuccess: function (message) { var rslt=eval("("+message.responseText+")"); if (rslt.ok) { var k=0; for(var j=0;j<Seed.queue_fort["city"+cityId].length;j++){ if(j>queueId){ Seed.queue_fort["city"+cityId][j][2]=parseInt(rslt.dateFortifications[k]["start"]); Seed.queue_fort["city"+cityId][j][3]=parseInt(rslt.dateFortifications[k]["end"]); k++; } } unsafeWindow.update_seed(rslt.updateSeed); Seed.queue_fort["city"+cityId].splice(queueId,1); for(var i=1;i<5;i++){ Seed.resources["city"+cityId]["rec"+i][0]=parseInt(Seed.resources["city"+cityId]["rec"+i][0])+totalReturn; } } }, onFailure: function () { }, }); }, stopTraining : function (msg){ var t = Tabs.Train; clearTimeout (t.trainTimer); t.trainTimer = null; t.dispTrainStatus (msg +'<BR>'); t.TDbutDo.disabled = false; t.TTbutDo.disabled = false; t.TTbutDo.value = 'Train Troops'; t.TDbutDo.value = 'Build Defenses'; t.TTbutDo.className = ''; t.TDbutDo.className = ''; t.running = false; }, doQueue : function (cityId, tut, que, errMsg){ var t = Tabs.Train; clearTimeout (t.trainTimer); try { t.displayCityStats(); if (errMsg){ t.stopTraining ('<SPAN class=boldRed>'+ errMsg +'</span>'); return; } var cmd = que.shift(); if (!cmd){ t.stopTraining ('<B>Done queueing troops.</b>'); return; } if (cmd[0] == 'T'){ t.dispTrainStatus ('Training '+ cmd[2] +' '+ unsafeWindow.unitcost['unt'+cmd[1]][0] +' at '+ Cities.byID[cityId].name +' ('+ que.length +' slots remaining)<BR>'); doTrain (cityId, tut, cmd[1], cmd[2], function(errMsg){ if (t.running) t.trainTimer = setTimeout(function (){Tabs.Train.doQueue(cityId, tut, que, errMsg);}, (Math.random()*2500)+1000 ); } ); } } catch (err) { logit (inspect (err, 8, 1)); t.stopTraining ('<SPAN class=boldRed>PROGRAM ERROR: '+ err.message +'</span>'); } }, } /********************************* Search Tab *************************************/ function distance (d, f, c, e) { var a = 750; var g = a / 2; var b = Math.abs(c - d); if (b > g) b = a - b; var h = Math.abs(e - f); if (h > g) h = a - h; return Math.round(100 * Math.sqrt(b * b + h * h)) / 100; }; Tabs.Search = { tabOrder : 10, tabDisabled : !ENABLE_SEARCH_TAB, cont:null, init : function (div){ var t = Tabs.Search; unsafeWindow.PTgotoMap2 = t.gotoMap; unsafeWindow.PTpd = t.clickedPlayerDetail; unsafeWindow.PTpd2 = t.clickedPlayerLeaderboard; unsafeWindow.PCpo2 = t.clickedPlayerCheckOnline; unsafeWindow.PCplo2 = t.clickedPlayerGetLastLogin; this.cont = div; this.cont.innerHTML = '\ <DIV element_class=ptentry><table><tr><td><TABLE><TR valign=bottom><TD element_class=xtab width=100 align=right>Search for: </td><TD>\ <SELECT id="srcType">\ <OPTION value=0>Barb Camp</option>\ <OPTION value=1>Wilderness</option>\ <OPTION value=2>Cities</option>\ </select></td></td> \ <td> In Province:\ <select id="idProvCoordSelect">\ <option value="675,675"> Albion </option>\ <option value="375,75"> Astolat </option>\ <option value="675,225"> Avalon </option>\ <option value="225,675"> Bodmin Moor </option>\ <option value="675,525"> Caerleon </option>\ <option value="525,375"> Cadbury </option>\ <option value="225,225"> Cameliard </option>\ <option value="75,525"> Camlann </option>\ <option value="525,225"> Canoel </option>\ <option value="75,225"> Carmathen </option>\ <option value="375,675"> Cellwig </option>\ <option value="675,75"> Corbenic </option>\ <option value="225,75"> Cornwall </option>\ <option value="375,525"> Dore </option>\ <option value="675,375"> Glastonbury </option>\ <option value="525,675"> Listeneise </option>\ <option value="525,525"> Logres </option>\ <option value="525,75"> Lyonesse </option>\ <option value="225,525"> Orkney </option>\ <option value="75,225"> Paimpont </option>\ <option value="75,675"> Parmenie </option>\ <option value="375,225"> Sarras </option>\ <option value="225,375"> Shallot </option>\ <option value="75,75"> Tintagel </option>\ </select></td></tr>\ <tr><td width=100 align=right >In Quadrant: </td><td><select id="idQuadSelect">\ <option value="188,188"> NorthWest </option>\ <option value="563,188"> NorthEast </option>\ <option value="188,563"> SouthWest </option>\ <option value="563,563"> SouthEast </option>\ </select></td><td><SPAN id=spInXY></span></td></tr>\ </table>\ <DIV id="srcOpts" style="height:100px"></div></td><td><DIV id=divOutOpts style="background:#e0e0f0; padding:10px"></div></td></tr></table></div>\ <DIV id="srcResults" style="height:470px; max-height:470px;"></div>'; var psearch = document.getElementById ("srcType"); m = '<TABLE><TR valign=middle><TD element_class=xtab width=100 align=right>Center: X: </td><TD element_class=xtab>\ <INPUT id=srchX type=text > Y: <INPUT id=srchY type=text > <SPAN id=spInXYold></span>\ </td></tr><TR><TD element_class=xtab align=right>Max. Distance: </td><TD style="width: 200px;" element_class=xtab><INPUT id=srcDist size=3 value=10 /></td>\ <td></td>\ </tr>'; m += '<TR><TD element_class=xtab></td><TD element_class=xtab><INPUT id=srcStart type=submit value="Start Search" /></td></tr>'; m += '</table>'; document.getElementById ('srcOpts').innerHTML = m; new CdispCityPicker ('srchdcp', document.getElementById ('spInXY'), true).bindToXYboxes(document.getElementById ('srchX'), document.getElementById ('srchY')); document.getElementById ('srcStart').addEventListener ('click', t.clickedSearch, false); document.getElementById ('srcType').addEventListener ('click', t.srchTypeHandler, false); document.getElementById ('idProvCoordSelect').addEventListener ('click', t.provCoordsHandler, false); document.getElementById ('idQuadSelect').addEventListener ('click', t.quadCoordHandler, false); Options.citySrchFilter = 0; t.state = 1; document.getElementById ('srchX').value = Cities.cities[0].x document.getElementById ('srchY').value = Cities.cities[0].y t.srchTypeHandler(); }, //Edit add city search clickedPlayerDetail : function (span, uid){ var t = Tabs.AllianceList; span.onclick = ''; span.innerHTML = "fetching details ..."; t.fetchPlayerInfo (uid, function (r) {t.gotPlayerDetail(r, span)}); }, clickedPlayerLeaderboard : function (span, uid){ var t = Tabs.AllianceList; span.onclick = ''; span.innerHTML = "fetching leaderboard info ..."; t.fetchLeaderboard (uid, function (r) {t.gotPlayerLeaderboard(r, span)}); }, clickedPlayerCheckOnline : function (span, uid){ var t = Tabs.AllianceList; var s = Tabs.Search; span.onclick = ''; span.innerHTML = "fetching online status ..."; t.fetchPlayerStatus (uid, function (r) {s.gotPlayerStatus(r, span, uid)}); }, clickedPlayerGetLastLogin : function (span, uid){ var t = Tabs.AllianceList; var s = Tabs.Search; span.onclick = ''; span.innerHTML = "fetching login date ..."; t.fetchPlayerLastLogin (uid, function (r) {s.gotPlayerLastLogin(r, span)}); }, gotPlayerLeaderboard : function (rslt, span){ var t = Tabs.AllianceList; if (!rslt.ok){ span.innerHTML = rslt.errorMsg; return; } if (rslt.totalResults == 0){ span.innerHTML = '<B>Leaderboard:</b> Not found! (misted?)'; return; } var p = rslt.results[0]; var an = p.allianceName; if (!an || an=='' || p.officerType==4) an = 'none'; else an += ' ('+ officerId2String(p.officerType) +')'; m = '<TABLE cellspacing=0 element_class=ptTab><TR><TD><B>Leaderboard: </b></td><TD colspan=2> Might: '+ p.might +' Alliance: '+ an +'</td></tr>'; for (var i=0; i<p.cities.length; i++){ var c = p.cities[i]; m += '<TR><TD align=right><B>City #'+ (i+1) +':</b></td><TD> '+ c.cityName +' '+coordLink (c.xCoord, c.yCoord)+'</td><TD width=75%> level: ' + c.tileLevel +' status: '+ cityStatusString (c.cityStatus) +' created: ' + c.dateCreated.substr(0,10) +'</td></tr>'; } span.innerHTML = m + '</table>'; }, gotPlayerDetail : function (rslt, span){ var t = Tabs.AllianceList; if (!rslt.ok){ span.innerHTML = rslt.errorMsg; return; } var u = rslt.userInfo[0]; var a = 'None'; if (u.allianceName) a = u.allianceName +' ('+ getDiplomacy(u.allianceId) + ')'; var m = '<TABLE cellspacing=0 element_class=ptTab><TR><TD><B>Details:</b> </td><TD>Alliance: '+ a +' Cities: ' + u.cities +' Population: '+ u.population +'</td></tr><TR><TD></td><TD>Provinces: '; var pids = u.provinceIds.split (','); var p = []; for (var i=0; i<pids.length; i++) p.push(unsafeWindow.provincenames['p'+pids[i]]); span.innerHTML = m + p.join (', ') +'</td></tr></table>'; }, gotPlayerStatus : function (rslt, span,uid){ var t = Tabs.AllianceList; if (!rslt.ok){ span.innerHTML = rslt.errorMsg; return; } var p = rslt.data; if (p[uid] == true) { m = '<span style="color:green"><b>online!</b></span>'; } else { m = '<span style="color:red"><b>may not be online</b></span>'; } span.innerHTML = m + ''; }, gotPlayerLastLogin : function (rslt, span){ var t = Tabs.AllianceList; if (!rslt.ok){ span.innerHTML = rslt.errorMsg; return; } var p = rslt.playerInfo; var lastLogin = rslt.playerInfo.lastLogin; if (lastLogin) { m = '<span style="color:black">Last login: '+lastLogin+'</span>'; } else { m = '<span style="color:red">No login date found: '+lastLogin+'</span>'; } span.innerHTML = m + ''; }, aName : '', eventSubmit : function (){ var t = Tabs.AllianceList; document.getElementById('ptallErr').innerHTML=''; t.aName = document.getElementById('allAllName').value; if (t.aName.length < 3){ document.getElementById('ptallErr').innerHTML = 'Enter at least 3 characters'; return; } var myA = getMyAlliance (); document.getElementById('altInput').innerHTML = ''; document.getElementById('allListOut').innerHTML = '<BR><BR><CENTER>Searching ...</center>'; if (myA[0]!=0 && myA[1].toLowerCase().indexOf(t.aName.toLowerCase())>=0 ) t.fetchAllianceList (t.aName, myA[0], t.eventGotAllianceList); else t.fetchAllianceList (t.aName, null, t.eventGotAllianceList); }, aName : '', eventSubmit : function (){ var t = my.AllianceList; document.getElementById('ptallErr').innerHTML=''; t.aName = document.getElementById('allAllName').value; if (t.aName.length < 3){ document.getElementById('ptallErr').innerHTML = 'Enter at least 3 characters'; return; } var myA = getMyAlliance (); document.getElementById('altInput').innerHTML = ''; document.getElementById('allListOut').innerHTML = '<BR><BR><CENTER>Searching ...</center>'; if (myA[0]!=0 && myA[1].toLowerCase().indexOf(t.aName.toLowerCase())>=0 ) t.fetchAllianceList (t.aName, myA[0], t.eventGotAllianceList); else t.fetchAllianceList (t.aName, null, t.eventGotAllianceList); }, //End edit city search hide : function (){ }, show : function (cont){ }, opt : {}, searchRunning : false, tilesSearched : 0, tilesFound : 0, curX : 0, curY : 0, lastX : 0, firstX : 0, firstY : 0, lastY : 0, normalizeCoord : function (x){ if ( x >= 750) x -= 750; else if (x < 0) x += 750; return parseInt (x/5) * 5; }, srchTypeHandler : function (){ var t = Tabs.Search; logit("Search Type Handler ()"); t.opt.searchType = document.getElementById ('srcType').value; t.opt.startX = parseInt(document.getElementById ('srchX').value); t.opt.startY = parseInt(document.getElementById ('srchY').value); t.opt.maxDistance = parseInt(document.getElementById ('srcDist').value); if (t.opt.searchType == 0) typeName = 'Barbarians'; else if (t.opt.searchType == 1) typeName = 'Wildernesses'; else typeName = 'Cities'; var m = '<CENTER><B>Search for '+ typeName +'<BR>\ Center: '+ t.opt.startX +','+ t.opt.startY +' Distance: '+ t.opt.maxDistance +'<BR></center>\ <DIV element_class=ptentry><TABLE cellspacing=0 width=100%><TR align=center><TD element_class=xtab colspan=10><B>LIST OPTIONS:</b><BR></td></tr>'; if (t.opt.searchType == 1 || t.opt.searchType == 0) { m += '<TR><TD element_class=xtab align=right>Min. level to show:</td><TD element_class=xtab> <INPUT id=filMinLvl size=2 value='+ Options.srcMinLevel +' /></td></tr>\ <TR><TD element_class=xtab align=right>Max. level to show:</td><TD element_class=xtab> <INPUT id=filMaxLvl size=2 value='+ Options.srcMaxLevel +' /></td></tr>'; } if (t.opt.searchType == 1){ m += '<TR><TD element_class=xtab align=right>Wilderness Type:</td><TD element_class=xtab align=right>\ Woodlands<INPUT id=woodWild type=CHECKBOX'+ (Options.woodWild?' CHECKED':'') +'></td></tr>'; m += '<TR><TD element_class=xtab align=right>Grassland/Lake<INPUT id=foodWild type=CHECKBOX '+ (Options.foodWild?' CHECKED':'') +'></td>\ <TD element_class=xtab align=right>Mountain<INPUT id=mtnWild type=CHECKBOX '+ (Options.mtnWild?' CHECKED':'') +'></td></tr>'; m += '<TR><TD element_class=xtab align=right>Plain<INPUT id=plnWild type=CHECKBOX '+ (Options.plnWild?' CHECKED':'') +'></td>\ <TD element_class=xtab align=right>Hills<INPUT id=hillWild type=CHECKBOX'+ (Options.hillWild?' CHECKED':'') +'></td></tr>'; m += '<TR><TD element_class=xtab align=right>Unowned Only:</td><TD element_class=xtab><INPUT id=filUnowned type=CHECKBOX '+ (Options.unownedOnly?' CHECKED':'') +'\><td></tr>'; } if (t.opt.searchType == 1 || t.opt.searchType == 0) { m+= '<TR><TD element_class=xtab align=right>Sort By:</td><TD element_class=xtab><SELECT id=filSortBy>\ <OPTION value="level" '+ (Options.srcSortBy=='level'?'SELECTED':'') +'>Level</option>\ <OPTION value="dist" '+ (Options.srcSortBy=='dist'?'SELECTED':'') +'>Distance</option>\ </select></td></tr>\ <TR><TD element_class=xtab align=right>Show coordinates only:</td><TD element_class=xtab><INPUT type=checkbox id=coordsOnly \></td></tr>\ </table></div><BR><SPAN id=srchSizeWarn></span>'; } else { m+= '<TR><TD element_class=xtab align=right >Show:</td><TD element_class=xtab align=left ><SELECT style="width: 135px" id=idSrchFilter>\ <OPTION value=0>All Cities</option>\ <OPTION value=1>Hostile Only</option>\ <OPTION value=2>In Mist Only</option>\ <OPTION value=3>Allied Only</option>\ <OPTION value=4>Friendly Only</option>\ <OPTION value=5>Neutral Only</option>\ <OPTION value=6>Unaligned Only </option>\ </select></td></tr>'; m+= '<TR><TD element_class=xtab align=right >Sort By:</td><TD element_class=xtab><SELECT style="width: 135px" id=filSortBy>\ <OPTION value="might" '+ (Options.srcSortBy=='might'?'SELECTED':'') +'>Might</option>\ <OPTION value="dist" '+ (Options.srcSortBy=='dist'?'SELECTED':'') +'>Distance</option>\ </select></td></tr>\ <TR><TD element_class=xtab align=right >Show coords only:</td><TD element_class=xtab align=left ><INPUT type=checkbox id=coordsOnly ></td></tr>\ </table></div><BR><SPAN id=srchSizeWarn></span>'; } document.getElementById('divOutOpts').innerHTML = m; if (t.opt.searchType == 1 || t.opt.searchType == 0) { document.getElementById('filMinLvl').addEventListener ('change', function (){ Options.srcMinLevel = document.getElementById('filMinLvl').value; saveOptions(); t.dispMapTable (); }, false); document.getElementById('filMaxLvl').addEventListener ('change', function (){ Options.srcMaxLevel = document.getElementById('filMaxLvl').value; saveOptions(); t.dispMapTable (); }, false); } document.getElementById('filSortBy').addEventListener ('change', function (){ Options.srcSortBy = document.getElementById('filSortBy').value; saveOptions(); t.dispMapTable (); }, false); document.getElementById('coordsOnly').addEventListener ('change', function (){ t.dispMapTable (); }, false); if (t.opt.searchType == 1){ document.getElementById('foodWild').addEventListener ('change', function(){ Options.foodWild = document.getElementById('foodWild').checked; saveOptions(); t.dispMapTable (); }, false); document.getElementById('hillWild').addEventListener ('change', function(){ Options.hillWild = document.getElementById('hillWild').checked; saveOptions(); t.dispMapTable(); }, false); document.getElementById('mtnWild').addEventListener ('change', function(){ Options.mtnWild = document.getElementById('mtnWild').checked; saveOptions(); t.dispMapTable(); }, false); document.getElementById('plnWild').addEventListener ('change', function(){ Options.plnWild = document.getElementById('plnWild').checked; saveOptions(); t.dispMapTable(); }, false); document.getElementById('woodWild').addEventListener ('change', function(){ Options.woodWild = document.getElementById('woodWild').checked; saveOptions(); t.dispMapTable (); }, false); document.getElementById('filUnowned').addEventListener ('change', function (){ Options.unownedOnly = (document.getElementById('filUnowned').checked); saveOptions(); t.dispMapTable (); }, false); } if (t.opt.searchType == 2){ document.getElementById('idSrchFilter').addEventListener ('change', function (){ Options.citySrchFilter = (document.getElementById('idSrchFilter').value); saveOptions(); t.dispMapTable (); }, false); document.getElementById('idSrchFilter').value = Options.citySrchFilter; } }, quadCoordHandler : function (){ coordStr = document.getElementById ('idQuadSelect').value; var m=/^\s*([0-9]+)\s*,\s*([0-9]+)/.exec(coordStr); document.getElementById ('srchX').value = m[1]; document.getElementById ('srchY').value = m[2]; document.getElementById ('srcDist').value = "187"; var t = Tabs.Search; t.srchTypeHandler(); }, provCoordsHandler : function (){ coordStr = document.getElementById ('idProvCoordSelect').value; var m=/^\s*([0-9]+)\s*,\s*([0-9]+)/.exec(coordStr); document.getElementById ('srchX').value = m[1]; document.getElementById ('srchY').value = m[2]; document.getElementById ('srcDist').value = "75"; var t = Tabs.Search; t.srchTypeHandler(); }, clickedSearch : function (){ var t = Tabs.Search; if (t.searchRunning){ t.stopSearch ('SEARCH CANCELLED!'); return; } t.opt.searchType = document.getElementById ('srcType').value; t.opt.startX = parseInt(document.getElementById ('srchX').value); t.opt.startY = parseInt(document.getElementById ('srchY').value); t.opt.maxDistance = parseInt(document.getElementById ('srcDist').value); errMsg = ''; if (isNaN (t.opt.startX) ||t.opt.startX<0 || t.opt.startX>749) errMsg = "X must be between 0 and 749<BR>"; if (isNaN (t.opt.startY) ||t.opt.startY<0 || t.opt.startY>749) errMsg += "Y must be between 0 and 749<BR>"; if (isNaN (t.opt.maxDistance) ||t.opt.maxDistance<1 || t.opt.maxDistance>750) errMsg += "Max Distance must be between 1 and 750<BR>"; if (errMsg != ''){ document.getElementById('srcResults').innerHTML = '<FONT COLOR=#660000>ERROR:</font><BR><BR>'+ errMsg; return; } t.searchRunning = true; document.getElementById ('srcStart').value = 'Stop Search'; m = '<DIV element_class=ptstat><TABLE width=100% cellspacing=0><TR><TD element_class=xtab width=125><DIV id=statSearched></div></td>\ <TD element_class=xtab align=center><SPAN id=statStatus></span></td>\ <TD element_class=xtab align=right width=125><DIV id=statFound></div></td></tr></table></div>\ <TABLE width=100%><TR><TD><DIV id=divOutTab style="width:100%; height:470px; max-height:470px; overflow-y:auto;"></div></td></tr></table>'; document.getElementById('srcResults').innerHTML = m; if (t.opt.searchType == 0) typeName = 'Barbarians'; else if (t.opt.searchType == 1) typeName = 'Wildernesses'; else typeName = 'Cities'; m = '<CENTER><B>Search for '+ typeName +'<BR>\ Center: '+ t.opt.startX +','+ t.opt.startY +' Distance: '+ t.opt.maxDistance +'<BR></center>\ <DIV element_class=ptentry><TABLE cellspacing=0 width=100%><TR align=center><TD element_class=xtab colspan=10><B>LIST OPTIONS:</b><BR></td></tr>'; if (t.opt.searchType == 1 || t.opt.searchType == 0) { m += '<TR><TD element_class=xtab align=right>Min. level to show:</td><TD element_class=xtab> <INPUT id=filMinLvl size=2 value='+ Options.srcMinLevel +' /></td></tr>\ <TR><TD element_class=xtab align=right>Max. level to show:</td><TD element_class=xtab> <INPUT id=filMaxLvl size=2 value='+ Options.srcMaxLevel +' /></td></tr>'; } if (t.opt.searchType == 1){ m += '<TR><TD element_class=xtab align=right>Wilderness Type:</td><TD element_class=xtab><SELECT id=filWildType>'; m += htmlOptions ( {1:'Glassland/Lake', 3:'Woodlands', 4:'Hills', 5:'Mountain', 6:'Plain', 0:'ALL'}, Options.wildType ); m += '</select></td></tr><TR><TD element_class=xtab align=right>Unowned Only:</td>\ <TD element_class=xtab><INPUT id=filUnowned type=CHECKBOX '+ (Options.unownedOnly?' CHECKED':'') +'\><td></tr>'; } if (t.opt.searchType == 1 || t.opt.searchType == 0) { m += '<TR><TD element_class=xtab align=right>Sort By:</td><TD element_class=xtab><SELECT id=filSortBy>\ <OPTION value="level" '+ (Options.srcSortBy=='level'?'SELECTED':'') +'>Level</option>\ <OPTION value="dist" '+ (Options.srcSortBy=='dist'?'SELECTED':'') +'>Distance</option>\ </select></td></tr>\ <TR><TD element_class=xtab align=right>Show coordinates only:</td><TD element_class=xtab><INPUT type=checkbox id=coordsOnly \></td></tr>\ </table></div><BR><SPAN id=srchSizeWarn></span>'; } else { m += '<TR><TD element_class=xtab align=right>City Type:</td><TD element_class=xtab><SELECT id=filCities>'; m += htmlOptions ( {1:'All', 2:'Allies', 3:'Friendly', 4:'Hostile', 5:'Neutral', 6:'Unallianced', 7:'Misted'}, Options.cityType ); m += '</select></td></tr>'; m += '<TR><TD element_class=xtab align=right>Sort By:</td><TD element_class=xtab><SELECT id=filSortBy>\ <OPTION value="might" '+ (Options.srcSortBy=='might'?'SELECTED':'') +'>Might</option>\ <OPTION value="dist" '+ (Options.srcSortBy=='dist'?'SELECTED':'') +'>Distance</option>\ </select></td></tr>\ <TR><TD element_class=xtab align=right>Min might to show:</td><TD element_class=xtab><INPUT type=text id=minMight value='+Options.MightSrc+' size=3 \></td></tr>\ <TR><TD element_class=xtab align=right>Show coordinates only:</td><TD element_class=xtab><INPUT type=checkbox id=coordsOnly \></td></tr>\ </table></div><BR><SPAN id=srchSizeWarn></span>'; } document.getElementById ('divOutOpts').style.visibility = 'visible'; document.getElementById('divOutOpts').innerHTML = m; if (t.opt.searchType == 1 || t.opt.searchType == 0) { document.getElementById('filMinLvl').addEventListener ('change', function (){ Options.srcMinLevel = document.getElementById('filMinLvl').value; saveOptions(); t.dispMapTable (); }, false); document.getElementById('filMaxLvl').addEventListener ('change', function (){ Options.srcMaxLevel = document.getElementById('filMaxLvl').value; saveOptions(); t.dispMapTable (); }, false); } document.getElementById('filSortBy').addEventListener ('change', function (){ Options.srcSortBy = document.getElementById('filSortBy').value; saveOptions(); t.dispMapTable (); }, false); document.getElementById('coordsOnly').addEventListener ('change', function (){ t.dispMapTable (); }, false); if (t.opt.searchType == 1){ document.getElementById('filWildType').addEventListener ('change', function (){ Options.wildType = document.getElementById('filWildType').value; saveOptions(); t.dispMapTable (); }, false); document.getElementById('filUnowned').addEventListener ('change', function (){ Options.unownedOnly = (document.getElementById('filUnowned').checked); saveOptions(); t.dispMapTable (); }, false); } if (t.opt.searchType == 2){ document.getElementById('filCities').addEventListener ('change', function (){ Options.cityType = document.getElementById('filCities').value saveOptions(); t.dispMapTable (); },false); document.getElementById('minMight').addEventListener ('change', function (){ Options.MightSrc = document.getElementById('minMight').value saveOptions(); t.dispMapTable (); },false); } t.mapDat = []; t.firstX = t.opt.startX - t.opt.maxDistance; t.lastX = t.opt.startX + t.opt.maxDistance; t.firstY = t.opt.startY - t.opt.maxDistance; t.lastY = t.opt.startY + t.opt.maxDistance; t.tilesSearched = 0; t.tilesFound = 0; t.curX = t.firstX; t.curY = t.firstY; var xxx = t.normalizeCoord(t.curX); var yyy = t.normalizeCoord(t.curY); document.getElementById ('statStatus').innerHTML = 'Searching at '+ xxx +','+ yyy; if (DEBUG_TRACE) logit (" 0 clickedSearch()... setTimeout ..:" + xxx +' , '+ yyy +' , '+ t.mapCallback.name); setTimeout (function(){Map.request (xxx, yyy, 15, t.mapCallback)}, MAP_DELAY); }, dispMapTable : function (){ var tileNames = ['Barb Camp', 'Grassland', 'Lake', 'Woodlands', 'Hills', 'Mountain', 'Plain', 'City' ]; var t = Tabs.Search; var coordsOnly = document.getElementById('coordsOnly').checked; if (DEBUG_TRACE) DebugTimer.start(); function mySort(a, b){ if (Options.srcSortBy == 'level'){ if ((x = a[4] - b[4]) != 0) return x; } if (Options.srcSortBy == 'might'){ if ((x = b[10] - a[10]) != 0) return x; } return a[2] - b[2]; } dat = []; for (i=0; i<t.mapDat.length; i++){ lvl = parseInt (t.mapDat[i][4]); type = t.mapDat[i][3]; if (t.opt.searchType == 2 && type == 7 ) { if (!(Options.cityType == 2) || t.mapDat[i][12] == 'ally') if (!(Options.cityType == 3) || t.mapDat[i][12] == 'friendly') if (!(Options.cityType == 4) || t.mapDat[i][12] == 'hostile') if (!(Options.cityType == 5) || t.mapDat[i][12] == 'neutral') if (!(Options.cityType == 6) || t.mapDat[i][12] == 'unaligned') if (!(Options.cityType == 7) || t.mapDat[i][5]===true) if ((t.mapDat[i][10] > parseInt(Options.MightSrc)) || t.mapDat[i][5]===true) dat.push(t.mapDat[i]); } else { if (lvl>=Options.srcMinLevel && lvl<=Options.srcMaxLevel){ if (t.opt.searchType==0 || Options.wildType==0 || (Options.wildType==1 && (type==1 || type==2)) || (Options.wildType == type)) if (!Options.unownedOnly || t.mapDat[i][5]===false) dat.push (t.mapDat[i]); } } } if (DEBUG_TRACE) DebugTimer.display('SEACHdraw: FILTER'); document.getElementById('statFound').innerHTML = 'Found: '+ dat.length; if (dat.length == 0){ m = '<BR><CENTER>None found</center>'; } else { dat.sort(mySort); if (DEBUG_TRACE) DebugTimer.display('SEACHdraw: SORT'); if (coordsOnly) m = '<TABLE align=center id=srcOutTab cellpadding=2 cellspacing=2><TR style="font-weight: bold"><TD>Location</td></tr>'; else { if (t.opt.searchType == 0) // Barbs m = '<TABLE id=srcOutTab cellpadding=2 cellspacing=2><TR style="font-weight: bold"><TD>Location</td><TD style="padding-left: 10px">Distance</td><TD style="padding-left: 10px;">Lvl</td><TD width=80%> Type</td><TD style=""></td></tr>'; else if (t.opt.searchType == 1) // Wilds //m = '<TABLE id=srcOutTab cellpadding=2 cellspacing=2><TR style="font-weight: bold"><TD>Location</td><TD style="padding-left: 10px">Distance</td><TD style="padding-left: 10px;">Lvl</td><TD style="padding-left: 10px;> Type</td><TD width=80%>Owner</td><TD style=""></td></tr>'; m = '<TABLE id=srcOutTab cellpadding=2 cellspacing=2><TR style="font-weight: bold"><TD>Location</td><TD style="padding-left: 10px">Distance</td><TD style="padding-left: 10px;">Lvl</td><TD width=10%> Type</td><TD width=70%> Owner</td><TD style=""></td></tr>'; else // Cities m = '<TABLE id=srcOutTab cellpadding=2 cellspacing=2><TR style="font-weight: bold"><TD>Location</td><TD >Dist</td><TD>City</td><TD>Owner</td><TD>Might</td><td>Alliance </td><TD width=80% style="font-size:9px;">More info</td><TD style="padding-left: 10px;"></td></tr>'; } var numRows = dat.length; if (numRows > 500 && t.searchRunning){ numRows = 500; document.getElementById('srchSizeWarn').innerHTML = '<FONT COLOR=#600000>NOTE: Table only shows 500 of '+ dat.length +' results until search is complete.</font>'; } for (i=0; i<numRows; i++){ m += '<TR valign="top"'; if (dat[i][12]) m += 'element_class="'+dat[i][12]+'"'; m += ' ><TD><DIV onclick="ptGotoMapHide('+ dat[i][0] +','+ dat[i][1] +')"><A>'+ dat[i][0] +','+ dat[i][1] +'</a></div></td>'; if (coordsOnly) m += '</tr>'; else if (t.opt.searchType == 2) { m += '<TD align="left" valign="top">'+ dat[i][2].toFixed(2) +' </td><TD align=left>'+ dat[i][8] +'</td><TD valign="top">'+dat[i][9]+'</td><TD valign="top">'+dat[i][10]+'</td><td>'+dat[i][11]+'</td><td>'; if (dat[i][5]) { m += '<DIV onclick="PTscout('+ dat[i][0] +','+ dat[i][1] +');return false;"><A style="font-size:9px;" >Scout</a></div>'; } else m += '<DIV onclick="PTpd(this, '+ dat[i][7] +')"><A style="font-size:9px;" >Details</a></div>\ <DIV style="" onclick="PTpd2(this, '+ dat[i][7] +')"><A style="font-size:9px;">Leaderboard</a></div>\ <DIV style="" onclick="PCpo2(this, '+ dat[i][7] +')"><A style="font-size:9px;">Onlinestatus</a></div>\ <DIV style="" onclick="PCplo2(this, '+ dat[i][7] +')"><A style="font-size:9px;">Last Login</a></div>'; m+= '</td><TD valign="top">'+ (dat[i][5]?' Misted':'') +'</td></tr>'; } else { var sty = ''; if (dat[i][8] == 'hostile') var sty = ' style="color:#800; font-weight:bold"'; m += '<TD'+ sty + ' align=right>'+ dat[i][2].toFixed(2) +' </td><TD'+ sty + ' align=right>'+ dat[i][4] +'</td><TD'+ sty + '> '+ tileNames[dat[i][3]]; //+'</td><TD>'+ (dat[i][5]?' OWNED':'') +'</td></tr>'; if (dat[i][9]) { // Is Misted? m += '</td><TD align=left> </td></tr>'; } else { // neutral, friendly, ally, hostile if (dat[i][7] != '') // Has Alliance? m += '</td><TD'+ sty + ' align=left> '+ dat[i][6] +' ('+ dat[i][7] + ') ['+ dat[i][8] + ']</td></tr>'; else m += '</td><TD align=left> '+ dat[i][6] +'</td></tr>'; } } } m += '</table>'; } document.getElementById('divOutTab').innerHTML = m; dat = null; if (DEBUG_TRACE) DebugTimer.display('SEACHdraw: DRAW'); }, mapDat : [], gotoMap : function (e){ coords = e.children[0].innerHTML.split(','); hideMe (); document.getElementById('mapXCoor').value = coords[0]; document.getElementById('mapYCoor').value = coords[1]; unsafeWindow.reCenterMapWithCoor(); unsafeWindow.changeview_map(document.getElementById('mod_views_map')); }, stopSearch : function (msg){ var t = Tabs.Search; document.getElementById ('statStatus').innerHTML = '<FONT color=#ffaaaa>'+ msg +'</font>'; document.getElementById ('srcStart').value = 'Start Search'; document.getElementById('srchSizeWarn').innerHTML = ''; t.searchRunning = false; }, /** mapdata.userInfo: (object) u4127810 = [object Object] (string) n = George2gh02 (name) (string) t = 1 (title code) (string) m = 55 (might) (string) s = M (sex) (string) w = 2 (mode: 1=normal, 2=begprotect, 3=truce, 4=vacation ) (string) a = 0 (alliance) (string) i = 1 (avatar code) *****/ mapCallback : function (left, top, width, rslt){ function insertRow (x, y, msg){ row = document.getElementById('srcOutTab').insertRow(-1); row.insertCell(0).innerHTML = x +','+ y; row.insertCell(1).innerHTML = distance (t.opt.startX, t.opt.startY, x, y); row.insertCell(2).innerHTML = msg; } if (DEBUG_TRACE) logit (" 3 mapCallback()"); var t = Tabs.Search; if (!t.searchRunning) return; if (!rslt.ok){ t.stopSearch ('ERROR: '+ rslt.errorMsg); return; } map = rslt.data; var userInfo = rslt.userInfo; var alliance = rslt.allianceNames; for (k in map){ if (t.opt.searchType==0 && map[k].tileType==51 && !map[k].tileCityId ) { // if barb type = 0; } else if (t.opt.searchType==1 && map[k].tileType>=10 && map[k].tileType<=50) { if (map[k].tileType == 10) type = 1; else if (map[k].tileType == 11) type = 2; else type = (map[k].tileType/10) + 1; } else if (t.opt.searchType==2 && map[k].tileCityId >= 0 && map[k].tileType > 50 && map[k].cityName) type = 7; else continue; dist = distance (t.opt.startX, t.opt.startY, map[k].xCoord, map[k].yCoord); if (dist <= t.opt.maxDistance){ var nameU = 'unknown'; var uu = 'u'+map[k].tileUserId; var isMisted = map[k].tileUserId == 0 || false; var aU = 'unknown'; var aD = 'unknown'; if (t.opt.searchType==2) { //var uu = 'u'+map[k].tileUserId; //var isMisted = map[k].tileUserId == 0 || false; //var aU = 'unknown'; //var aD = 'unknown'; var mightU = 0; //var nameU = 'unknown'; if (isMisted) { nameU = 'In mist'; mightU = ''; } else { if (userInfo[uu] ) { // Corrects a problem with hung search. nameU = userInfo[uu].n; mightU = userInfo[uu].m; aD = getDiplomacy(userInfo[uu].a); if ( alliance && alliance['a'+userInfo[uu].a] ) { aU = alliance['a'+userInfo[uu].a]; } else { nameU = 'No userInfo'; aU = '----'; aD = 'unaligned'; } } } if (mightU > 0 || isMisted) { t.mapDat.push ([map[k].xCoord, map[k].yCoord, dist, type, map[k].tileLevel, isMisted, map[k].tileCityId, map[k].tileUserId, map[k].cityName,nameU,mightU,aU,aD ]); } } else { if (userInfo[uu] ) { // Corrects a problem with hung search. nameU = userInfo[uu].n; aD = getDiplomacy(userInfo[uu].a); if ( alliance && alliance['a'+userInfo[uu].a] ) aU = alliance['a'+userInfo[uu].a]; else aU = ''; } else { nameU = ''; aU = ''; aD = ''; } isOwned = map[k].tileUserId>0 || map[k].misted; t.mapDat.push ([map[k].xCoord, map[k].yCoord, dist, type, map[k].tileLevel, isOwned, nameU, aU, aD, isMisted]); } ++t.tilesFound; } } t.tilesSearched += (15*15); document.getElementById('statSearched').innerHTML = 'Searched: '+ t.tilesSearched; t.dispMapTable(); t.curX += 15; if (t.curX > t.lastX){ t.curX = t.firstX; t.curY += 15; if (t.curY > t.lastY){ t.stopSearch ('Done!'); return; } } var x = t.normalizeCoord(t.curX); var y = t.normalizeCoord(t.curY); document.getElementById ('statStatus').innerHTML = 'Searching at '+ x +','+ y; if (DEBUG_TRACE) logit (" 0 mapCallback()... setTimeout ..:" + x +' , '+ y +' , '+ t.mapCallback.toString().substr (0,50)); setTimeout (function(){Map.request (x, y, 15, t.mapCallback)}, MAP_DELAY); }, }; /*************************************** OVERVIEW TAB ************************************************/ var GMTclock = { span: null, timer: null, init: function (){ this.span = document.createElement ('span'); this.span.style.fontWeight = 'bold'; document.getElementById('kochead_time').parentNode.appendChild (this.span); GMTclock.timer = setInterval (GMTclock.everySecond, 900); }, everySecond: function (){ var now = new Date(); now.setTime(now.getTime() + (now.getTimezoneOffset()*60000)); if (Options.gmtClock) GMTclock.span.innerHTML = ' ('+ now.toLocaleFormat('%H:%M')+')'; else GMTclock.span.innerHTML = ''; document.getElementById('topnav_might').innerHTML = addCommas(Seed.player.might); }, } function getResourceProduction (cityId){ var ret = [0,0,0,0,0]; var now = unixTime (); var wilds = [0, 0, 0, 0, 0]; var w = Seed.wilderness["city" + cityId]; for (var k in w){ var type = parseInt(w[k].tileType); if (type==10 || type==11) wilds[1] += parseInt(w[k].tileLevel); else wilds[type/10] += parseInt(w[k].tileLevel); } knight = 0; var s = Seed.knights["city" + cityId]; if (s) { s = s["knt" + Seed.leaders["city" + cityId].resourcefulnessKnightId]; if (s){ var knight = parseInt(s.resourcefulness); if (s.resourcefulnessBoostExpireUnixtime > now) knight *= 1.25; } } var workerFactor = 1; var c = parseInt(Seed.citystats["city" + cityId]["pop"][0]); // Current population var w = parseInt(Seed.citystats["city" + cityId]["pop"][3]); // Labor force if (w > c) workerFactor = c / w; for (var i=1; i<5; i++){ var usage = Seed.resources["city" + cityId]["rec" + i]; var items = 0; if (parseInt(Seed.playerEffects["r" + i + "BstExp"]) > now) { items = 0.25; } var tech = Seed.tech["tch" + i]; ret[i] = parseInt((usage[2] * (1 + tech/10 + knight/100 + items + 0.05 * wilds[i]) * workerFactor + 100)); } return ret; } Tabs.Overview = { tabOrder : 1, cont : null, displayTimer : null, checkBox:null, Overview : function (){ }, init : function (div){ this.cont = div; }, hide : function (){ clearTimeout (Tabs.Overview.displayTimer); }, show : function (){ var rownum = 0; var t = Tabs.Overview; clearTimeout (t.displayTimer); function clickEnableMarch (){ var t = Tabs.Overview; if (checkBox.checked) Options.includeMarching = true; else Options.includeMarching = false; t.show (); } function clickEnableTrain (){ var t = Tabs.Overview; if (checkBox2.checked) Options.includeTraining = true; else Options.includeTraining = false; t.show (); } function _row (name, row, noTotal){ if (rownum++ % 2) style = ''; else style = ' style = "background: #99CCFF "'; var tot = 0; var m = []; m.push ('<TR style="background: #fff" align=right'); m.push (style); m.push ('><TD'); m.push (style); m.push ('><B>'); m.push (name); m.push (' </td>'); if (noTotal){ m.push ('<TD'); m.push (style); m.push ('> </td>'); } else { for (i=0; i<row.length; i++) tot += parseInt(row[i]); m.push ('<TD style="background: #ffc">'); m.push (addCommas(tot)); m.push ('</td>'); } for (i=0; i<row.length; i++){ m.push ('<TD'); m.push (style); m.push ('>'); m.push (addCommas(row[i])); m.push ('</td>'); } m.push ('</tr>'); return m.join(''); } //DebugTimer.start(); try { if (Options.includeMarching) march = getMarchInfo (); dt = new Date (); dt.setTime (Seed.player.datejoinUnixTime * 1000); str = '<DIV class=ptstat style="margin-top:5px; margin-bottom:5px;"><TABLE cellspacing=0 cellpadding=0 class=ptTab width=97% align=center>\ <TR align=left><TD><SPAN class=ptStatLight>Joined on:</span> '+ dt.toLocaleDateString() +'</td>\ <TD><SPAN class=ptStatLight>Might:</span> ' + addCommas(Seed.player.might) +'</td>\ <TD><SPAN class=ptStatLight>Alliance:</span> ' + getMyAlliance()[1] +'</td>\ <TD align=right><SPAN class=ptStatLight>Domain:</span> ' + unsafeWindow.domainName +'</td></tr></table></div>'; tabClass = 'ptTabOverview'; if (Cities.numCities > 6) tabClass = 'ptTabOverview7'; str += "<DIV id=overMainDiv style='font-size:"+ Options.overviewFontSize +"px'><TABLE class=ptTabOverview cellpadding=0 cellspacing=0><TR align=center><TD width=65 align=center></td><TD width=88 style='background: #ffc; font-size:150%' align=center><SPAN class=oohfancy>Totals</SPAN></td>"; for(i=0; i<Cities.numCities; i++) { str += "<TD width=81><SPAN class=oohfancy>"+ Cities.cities[i].name.substring(0,11) +'</SPAN><BR>'+ coordLink (Cities.cities[i].x, Cities.cities[i].y) +"<BR>"+ unsafeWindow.provincenames['p'+ Cities.cities[i].provId] +"</td>"; } if (Options.includeMarching) str += '<TD width=81 align=center><SPAN class=oohfancy>Marching</SPAN></td>'; str += "</tr>"; str += '<TR valign=top align=center><TD align=center><SPAN class=oohfancy>Status</SPAN></td><TD style=\'background:none\'></td>'; for(i=0; i<Cities.numCities; i++){ cityID = 'city'+Cities.cities[i].id; Gate = parseInt(Seed.citystats[cityID].gate); if(Gate == 0) str += '<TD align=center><div style=color:green;font-style:italic;font-variant:small-caps;text-shadow: 1px 1px 1px #000;>Sanctuary</div></td>'; else str += '<TD align=center><div style=color:red;font-weight:bold;font-variant:small-caps;text-shadow: 1px 1px 1px #000;>Defending</div></td>';} rows = []; rows[0] = []; for(i=0; i<Cities.numCities; i++) { cityID = 'city'+ Cities.cities[i].id; rows[0][i] = parseInt(Seed.citystats[cityID].gold[0]); } for (r=1; r<5; r++){ rows[r] = []; for(i=0; i<Cities.numCities; i++) { cityID = 'city'+ Cities.cities[i].id; rows[r][i] = parseInt(Seed.resources[cityID]['rec'+r][0] / 3600); } } if (Options.includeMarching){ for (var i=0; i<5; i++) rows[i][Cities.numCities] = march.resources[i]; } str += _row ('<SPAN class=oohfancy>Gold</SPAN>', rows[0]); str += _row ('<SPAN class=oohfancy>Food</SPAN>', rows[1]); str += _row ('<SPAN class=oohfancy>Wood</SPAN>', rows[2]); str += _row ('<SPAN class=oohfancy>Stone</SPAN>', rows[3]); str += _row ('<SPAN class=oohfancy>Ore</SPAN>', rows[4]); for (r=1; r<13; r++){ rows[r] = []; for(i=0; i<Cities.numCities; i++) { cityID = 'city'+ Cities.cities[i].id; rows[r][i] = parseInt(Seed.units[cityID]['unt'+r]); } } if (Options.includeMarching){ for (var i=0; i<13; i++) rows[i][Cities.numCities] = march.marchUnits[i]; } row = []; for(i=0; i<Cities.numCities; i++) { var rp = getResourceProduction (Cities.cities[i].id); var usage = parseInt(Seed.resources["city" + Cities.cities[i].id]['rec1'][3]); row[i] = rp[1] - usage; } str += _row ('<SPAN class=oohfancy>Food +/-</SPAN>', row, true); for(i=0; i<Cities.numCities; i++) { if (row[i] >= 0) row[i] = '----'; else { var timeLeft = parseInt(Seed.resources["city" + Cities.cities[i].id]['rec1'][0]) / 3600 / (0-row[i]) * 3600; if (timeLeft > 86313600) row[i] = '----'; else { if (Options.enableFoodWarn && timeLeft<(Options.foodWarnHours*3600)) row[i] = '<SPAN class=boldRed><blink>'+ timestrShort(timeLeft) +'</blink></span>'; else row[i] = timestrShort(timeLeft); } } } str += _row ('<SPAN class=oohfancy>Food left</SPAN>', row, true); str += '<TR><TD><BR></td></tr>'; for (r=1; r<13; r++){ rows[r] = []; for(i=0; i<Cities.numCities; i++) { cityID = 'city'+ Cities.cities[i].id; rows[r][i] = parseInt(Seed.units[cityID]['unt'+r]); } } if (Options.includeMarching){ for (var i=0; i<13; i++) rows[i][Cities.numCities] = march.marchUnits[i]; } //********************************** t_rows = []; for (r=2; r<26; r+=2){ t_rows[r] = []; for(j=0; j<Cities.numCities; j++) { t_rows[r][j] = [0]; cityID = 'city'+ Cities.cities[j].id; var q = Seed.queue_unt[cityID]; var supply_t=militia_t=scout_t=pike_t=sword_t=archer_t=cavalry_t=heavy_t=wagon_t=ballista_t=ram_t=catapult_t=0 ; for (var i=0; i<q.length; i++){ switch(q[i][0]) { case '1': supply_t += parseInt(q[i][1]); break; case '2': militia_t += parseInt(q[i][1]); break; case '3': scout_t += parseInt(q[i][1]); break; case '4': pike_t += parseInt(q[i][1]); break; case '5': sword_t += parseInt(q[i][1]); break; case '6': archer_t += parseInt(q[i][1]); break; case '7': cavalry_t += parseInt(q[i][1]); break; case '8': heavy_t += parseInt(q[i][1]); break; case '9': wagon_t += parseInt(q[i][1]); break; case '10': ballista_t += parseInt(q[i][1]); break; case '11': ram_t += parseInt(q[i][1]); break; case '12': catapult_t += parseInt(q[i][1]); break; } switch(r) { case 2: t_rows[r][j] = supply_t; break; case 4: t_rows[r][j] = militia_t; break; case 6: t_rows[r][j] = scout_t; break; case 8: t_rows[r][j] = pike_t; break; case 10: t_rows[r][j] = sword_t; break; case 12: t_rows[r][j] = archer_t; break; case 14: t_rows[r][j] = cavalry_t; break; case 16: t_rows[r][j] = heavy_t; break; case 18: t_rows[r][j] = wagon_t; break; case 20: t_rows[r][j] = ballista_t; break; case 22: t_rows[r][j] = ram_t; break; case 24: t_rows[r][j] = catapult_t; break; } } } } rownum = 0; str += _row ('<SPAN class=oohfancy>SupTrp</SPAN>', rows[1]); str += _row ('<SPAN class=oohfancy>Militia</SPAN>', rows[2]); str += _row ('<SPAN class=oohfancy>Scout</SPAN>', rows[3]); str += _row ('<SPAN class=oohfancy>Pike</SPAN>', rows[4]); str += _row ('<SPAN class=oohfancy>Sword</SPAN>', rows[5]); str += _row ('<SPAN class=oohfancy>Archer</SPAN>', rows[6]); str += _row ('<SPAN class=oohfancy>Cavalry</SPAN>', rows[7]); str += _row ('<SPAN class=oohfancy>H-Cav</SPAN>', rows[8]); str += _row ('<SPAN class=oohfancy>Wagon</SPAN>', rows[9]); str += _row ('<SPAN class=oohfancy>Ballista</SPAN>', rows[10]); str += _row ('<SPAN class=oohfancy>Ram</SPAN>', rows[11]); str += _row ('<SPAN class=oohfancy>Catapult</SPAN>', rows[12]); if (Options.includeTraining) { var intmax = 0; for (intt=0; intt<t_rows[2].length; intt++) { if (t_rows[2][intt] > intmax) {intmax = t_rows[2][intt]}; } if (intmax > 0) {str += _row ('<SPAN class=oohfancyi>Sup Trp Tr</SPAN>', t_rows[2])}; var intmax = 0; for (intt=0; intt<t_rows[4].length; intt++) { if (t_rows[4][intt] > intmax) {intmax = t_rows[4][intt]}; } if (intmax > 0) {str += _row ('<SPAN class=oohfancyi>MM Tr</SPAN>', t_rows[4])}; var intmax = 0; for (intt=0; intt<t_rows[6].length; intt++) { if (t_rows[6][intt] > intmax) {intmax = t_rows[6][intt]}; } if (intmax > 0) {str += _row ('<SPAN class=oohfancyi>Scout Tr</SPAN>', t_rows[6])}; var intmax = 0; for (intt=0; intt<t_rows[8].length; intt++) { if (t_rows[8][intt] > intmax) {intmax = t_rows[8][intt]}; } if (intmax > 0) {str += _row ('<SPAN class=oohfancyi>Pike Tr</SPAN>', t_rows[8])}; var intmax = 0; for (intt=0; intt<t_rows[10].length; intt++) { if (t_rows[10][intt] > intmax) {intmax = t_rows[10][intt]}; } if (intmax > 0) {str += _row ('<SPAN class=oohfancyi>Sword Tr</SPAN>', t_rows[10])}; var intmax = 0; for (intt=0; intt<t_rows[12].length; intt++) { if (t_rows[12][intt] > intmax) {intmax = t_rows[12][intt]}; } if (intmax > 0) {str += _row ('<SPAN class=oohfancyi>Archer Tr</SPAN>', t_rows[12])}; var intmax = 0; for (intt=0; intt<t_rows[14].length; intt++) { if (t_rows[14][intt] > intmax) {intmax = t_rows[14][intt]}; } if (intmax > 0) {str += _row ('<SPAN class=oohfancyi>Cav Tr</SPAN>', t_rows[14])}; var intmax = 0; for (intt=0; intt<t_rows[16].length; intt++) { if (t_rows[16][intt] > intmax) {intmax = t_rows[16][intt]}; } if (intmax > 0) {str += _row ('<SPAN class=oohfancyi>H.Cav Tr</SPAN>', t_rows[16])}; var intmax = 0; for (intt=0; intt<t_rows[18].length; intt++) { if (t_rows[18][intt] > intmax) {intmax = t_rows[18][intt]}; } if (intmax > 0) {str += _row ('<SPAN class=oohfancyi>Wagon Tr</SPAN>', t_rows[18])}; var intmax = 0; for (intt=0; intt<t_rows[20].length; intt++) { if (t_rows[20][intt] > intmax) {intmax = t_rows[20][intt]}; } if (intmax > 0) {str += _row ('<SPAN class=oohfancyi>Ball Tr</SPAN>', t_rows[20])}; var intmax = 0; for (intt=0; intt<t_rows[22].length; intt++) { if (t_rows[22][intt] > intmax) {intmax = t_rows[22][intt]}; } if (intmax > 0) {str += _row ('<SPAN class=oohfancyi>Ram Tr</SPAN>', t_rows[22])}; var intmax = 0; for (intt=0; intt<t_rows[24].length; intt++) { if (t_rows[24][intt] > intmax) {intmax = t_rows[24][intt]}; } if (intmax > 0) {str += _row ('<SPAN class=oohfancyi>Cat Tr</SPAN>', t_rows[24])}; } str += '<TR><TD><BR></td></tr>'; row = []; for(i=0; i<Cities.numCities; i++) { var totWilds = 0; dat = Seed.wilderness['city'+ Cities.cities[i].id]; if (dat!=null && matTypeof(dat)=='object') for (k in dat) ++totWilds; var castle = parseInt(Seed.buildings['city'+ Cities.cities[i].id].pos0[1]); if (castle == 11) castle += 1; if (totWilds < castle) row[i] = '<SPAN class=boldRed><B>'+ totWilds +'/'+ castle +'</b></span>'; else row[i] = totWilds +'/'+ castle; } str += _row ('<SPAN class=oohfancy>#Wilds</SPAN', row, true); row = []; for(i=0; i<Cities.numCities; i++) { totKnights = 0; dat = Seed.knights['city'+ Cities.cities[i].id]; for (k in dat) ++totKnights; row[i] = totKnights; } str += _row ('<SPAN class=oohfancy>#Knights</SPAN>', row, true); var now = unixTime(); var row = []; for(i=0; i<Cities.numCities; i++) { var totTime = 0; var q = Seed.queue_unt['city'+Cities.cities[i].id]; if (q!=null && q.length>0) totTime = q[q.length-1][3] - now; if (totTime < 0) totTime = 0; if (totTime < 3600) row[i] = '<SPAN class=boldRed><B>'+ timestr(totTime) +'</b></span>'; else row[i] = timestr(totTime); } str += _row ('<SPAN class=oohfancy>TroopQ</SPAN>', row, true); var row = []; for(i=0; i<Cities.numCities; i++) { var wall = {}; getWallInfo (Cities.cities[i].id, wall); var totTime = 0; var q = Seed.queue_fort['city'+Cities.cities[i].id]; if (q!=null && q.length>0) totTime = q[q.length-1][3] - now; if (totTime < 0) totTime = 0; if (totTime<1 && (wall.wallSpaceUsed < wall.wallSpace-4 || wall.fieldSpaceUsed < wall.fieldSpace-4)) row[i] = '<SPAN class=boldRed><B>'+ timestr(totTime) +'</b></span>'; else row[i] = timestr(totTime); } str += _row ('<SPAN class=oohfancy>WallQue</SPAN>', row, true); str += '<TR><TD class=xtab></td><TD class=xtab colspan=4><BR><INPUT type=CHECKBOX id=idCheck'+ (Options.includeMarching?' CHECKED':'') +'>Include Marching Troops/Resources</td></tr>'; str += '<TR><TD class=xtab></td><TD class=xtab colspan=4><BR><INPUT type=CHECKBOX id=idCheck2'+ (Options.includeTraining?' CHECKED':'') + '>Include Troops in Training</td></tr>'; str += "</table>"; if (DEBUG_BUTTON) str += '<BR><BR><INPUT id=subSeed type=submit name="SEED" value="DEBUG">'; Tabs.Overview.cont.innerHTML = str; checkBox = document.getElementById('idCheck'); checkBox.addEventListener('click', clickEnableMarch, false); checkBox2 = document.getElementById('idCheck2'); checkBox2.addEventListener('click', clickEnableTrain, false); if (DEBUG_BUTTON){ subSeed = document.getElementById('subSeed'); subSeed.addEventListener('click', function (){debugWin.doit()}, false); } //DebugTimer.display ('Draw Overview'); } catch (e){ Tabs.Overview.cont.innerHTML = '<PRE>'+ e.name +' : '+ e.message +'</pre>'; } t.displayTimer = setTimeout (t.show, 5000); function e_clickEnableMarch (){ var t = Tabs.Overview; Options.includeMarching = document.getElementById('idCheck').checked; t.show (); } function e_clickEnableTraining (){ var t = Tabs.Overview; Options.includeTraining = document.getElementById('ptoverIncTraining').checked; t.show (); } function e_fontSize(evt){ document.getElementById('overMainDiv').style.fontSize = evt.target.value +'px'; Options.overviewFontSize = evt.target.value; } function e_allowWidthOverflow (evt){ var tf = document.getElementById('ptOverOver').checked; Options.overviewAllowOverflow = tf; if (tf) t.cont.style.overflowX = 'visible'; else t.cont.style.overflowX = 'auto'; } }, }; function getWallInfo (cityId, objOut){ objOut.wallSpaceUsed = 0; objOut.fieldSpaceUsed = 0; objOut.wallLevel = 0; objOut.wallSpace = 0; objOut.fieldSpace = 0; var b = Seed.buildings["city" + cityId]; if (b.pos1==null) return; objOut.wallLevel = parseInt(b.pos1[1]); var spots = 0; for (var i=1; i<(objOut.wallLevel+1); i++) spots += (i * 500); objOut.wallSpace = spots; objOut.fieldSpace = spots; var fort = Seed.fortifications["city" + cityId]; for (k in fort){ var id = parseInt(k.substr(4)); if (id<60) objOut.wallSpaceUsed += parseInt(unsafeWindow.fortstats["unt"+ id][5]) * parseInt(fort[k]); else objOut.fieldSpaceUsed += parseInt(unsafeWindow.fortstats["unt"+ id][5]) * parseInt(fort[k]); } } /********************************* BUILDS TAB *************************************/ Tabs.Builds = { tabOrder : 2, tabLabel : 'Builds', showReq : false, init : function (div){ var t = Tabs.Builds; t.cont=div; }, paint : function () { var t = Tabs.Builds; var wall=0; var blacksmith=0; var fletching=0; var geometry = 0; var metalalloys = 0; var logging = 0; var poisonededge = 0; var buildings = {0:'Castle', 1:'Farm', 2:'Sawmill', 3:'Quarry', 4:'Mine', 5:'Cottage', 6:'Tavern', 7:'Knights Hall', 8:'Embassy', 9:'Storehouse', 10:'Market', 11:'Alchemy Lab', 12:'Rally Point', 13:'Barracks', 14:'Watch Tower', 15:'Blacksmith', 16:'Workshop', 17:'Stable', 18:'Relief Station', 19:'Wall'}; var Research = {1:'Fertilizer', 2:'Logging', 3:'Stoneworking', 4:'Mining', 5:'Geometry', 6:'Eagle Eyes', 8:'Poisoned Edge', 9:'Metal Alloys', 10:'Featherweight Powder', 11:'Magical Mapping', 12:'Alloy Horseshoes', 13:'Fletching', 14:'Shrinking Powder', 15:'Healing Potions', 16:"Giant's Strength"}; var WallSpace = {1:1000, 2:3000, 3:6000, 4:10000, 5:15000, 6:21000, 7:28000, 8:36000, 9:45000, 10:55000, 11:66000}; var FieldSpace = {1:13, 2:16, 3:19, 4:22, 5:25, 6:28, 7:31, 8:34, 9:37, 10:40, 11:40}; fertilizer = Seed.tech['tch1']; logging = Seed.tech['tch2']; stoneworking = Seed.tech['tch3']; mining = Seed.tech['tch4']; geometry = Seed.tech['tch5']; eagleeyes = Seed.tech['tch6']; poisonededge = Seed.tech['tch8']; metalalloys = Seed.tech['tch9']; featherweightpowder = Seed.tech['tch10']; magicalmapping = Seed.tech['tch11']; alloyhorseshoes = Seed.tech['tch12']; fletching = Seed.tech['tch13']; shrinkingpowder = Seed.tech['tch14']; healingpotions = Seed.tech['tch15']; giantsstrength = Seed.tech['tch16']; var m = '<DIV class=ptstat>Building and Research overview</div>'; m += "<DIV id=BuildsDiv style='font-size:12px'><TABLE class=ptBuilds border=1px cellpadding=5 cellspacing=0><TR valign=top align=right>"; m += "<TD align=left width=85><INPUT id=showReq type=checkbox " + (t.showReq?'CHECKED ':'') +">Show missing req.</td>"; for(i=0; i<Cities.numCities; i++) { m += "<TD width=79><B>"+ Cities.cities[i].name.substring(0,11) +"</b><BR>"+ coordLink(Cities.cities[i].x, Cities.cities[i].y) +"<BR></td>"; } m+='<TR valign=top align=right><TD width=85>Building</td>'; for(i=0; i<Seed.cities.length; i++) { city = 'city'+Seed.cities[i][0]; m+='<TD width=79>'; if (Seed.queue_con[city][0] != undefined) { m+=buildings[Seed.queue_con[city][0][0]]; m+=' ('+Seed.queue_con[city][0][1]+')'; m+='<br>'+ timestr((Seed.queue_con[city][0][4] - unixTime()),true); } m+='</td>'; } m+='</tr>'; m+='<TR valign=top align=right><TD width=85>Researching</td>'; for(i=0; i<Seed.cities.length; i++) { city = 'city'+Seed.cities[i][0]; m+='<TD width=79>'; if (Seed.queue_tch[city][0] != undefined) { m+=Research[Seed.queue_tch[city][0][0]]; m+=' ('+Seed.queue_tch[city][0][1]+')'; m+='<br>'+ timestr((Seed.queue_tch[city][0][3] - unixTime()),true); } m+='</td>'; } m+='</tr></table><BR><TABLE class=ptBuilds border=1px cellpadding=5 cellspacing=0>'; m+='<TR valign=top align=right><TD width=85>CrossBows</td>'; for (i=0;i<Seed.cities.length;i++){ city = 'city'+Seed.cities[i][0]; for (y in Seed.buildings[city]) { if (Seed.buildings[city][y][0] == 19) wall = Seed.buildings[city][y][1]; if (Seed.buildings[city][y][0] == 15) blacksmith = Seed.buildings[city][y][1]; } max = WallSpace[wall]/2/2 - parseInt(Seed.fortifications[city]["fort53"]) - parseInt(Seed.fortifications[city]["fort55"]); m+= '<TD width=79>' + Seed.fortifications[city]["fort53"]; if (wall >=6 && blacksmith >=6 && fletching >=5 && max > 0) m+= '<br>Left: ' + max +'</td>'; else if (t.showReq){ if (wall < 6) m+= '<br><FONT COLOR= "CC0000">Wall: ' + wall + '(6)</font>'; if (blacksmith < 6) m+= '<br><FONT COLOR= "CC0000">BlackS.: ' + blacksmith + '(6)</font>'; if (fletching < 5) m+= '<br><FONT COLOR= "CC0000">Fletch.: ' + fletching + '(5)</font>'; m+='</td>'; } } m+='</tr><TR valign=top align=right><TD width=85>Trebuchet</td>'; for (i=0;i<Seed.cities.length;i++){ city = 'city'+Seed.cities[i][0]; for (y in Seed.buildings[city]) { if (Seed.buildings[city][y][0] == 19) wall = Seed.buildings[city][y][1]; if (Seed.buildings[city][y][0] == 15) blacksmith = Seed.buildings[city][y][1]; } max = WallSpace[wall]/2/4 - parseInt(Seed.fortifications[city]["fort53"]) - parseInt(Seed.fortifications[city]["fort55"]); m+= '<TD width=79>' +Seed.fortifications[city]["fort55"]; if (wall >=8 && blacksmith >=8 && fletching >=7 && geometry>=7 && max > 0) m+= '<br>Left: ' + max+'</td>'; else if (t.showReq){ if (wall < 8) m+= '<br><FONT COLOR= "CC0000">Wall: ' + wall + '(8)</font>'; if (blacksmith < 8) m+= '<br><FONT COLOR= "CC0000">BlackS.: ' + blacksmith + '(8)</font>'; if (fletching < 7) m+= '<br><FONT COLOR= "CC0000">Fletch.: ' + fletching + '(7)</font>'; if (geometry < 7) m+= '<br><FONT COLOR= "CC0000">Geomet.: ' + geometry + '(7)</font>'; m+='</td>'; } } m+='<TR valign=top align=right><TD width=85>Wall defences</td>'; for (i=0;i<Seed.cities.length;i++){ city = 'city'+Seed.cities[i][0]; for (y in Seed.buildings[city]) { if (Seed.buildings[city][y][0] == 19) wall = Seed.buildings[city][y][1]; } build = (parseInt(Seed.fortifications[city]["fort53"])*2)+ (parseInt(Seed.fortifications[city]["fort55"])*4); max = WallSpace[wall]/2; if (build < max) m+='<TD width=79><FONT COLOR= "CC0000">'; else m+='<TD width=79><FONT COLOR= "669900">'; m+= build+'</font>'; m+= '/' + max +'</td>'; } m+='</tr><TR valign=top align=right><TD width=85>Traps</td>'; for (i=0;i<Seed.cities.length;i++){ city = 'city'+Seed.cities[i][0]; for (y in Seed.buildings[city]) { if (Seed.buildings[city][y][0] == 19) wall = Seed.buildings[city][y][1]; if (Seed.buildings[city][y][0] == 15) blacksmith = Seed.buildings[city][y][1]; } max = WallSpace[wall]/2/4 - (parseInt(Seed.fortifications[city]["fort60"])*4) - (parseInt(Seed.fortifications[city]["fort61"])*1) - (parseInt(Seed.fortifications[city]["fort62"])*3); m+= '<TD width=79>'+Seed.fortifications[city]["fort60"]; if (wall >=4 && blacksmith >=4 && poisonededge>=4 && max>0) m+= '<br>Left: ' + max+'</td>'; else if (t.showReq){ if (wall < 4) m+= '<br><FONT COLOR= "CC0000">Wall: ' + wall + '(4)</font>'; if (blacksmith < 4) m+= '<br><FONT COLOR= "CC0000">BlackS.: ' + blacksmith + '(4)</font>'; if (poisonededge < 4) m+= '<br><FONT COLOR= "CC0000">Poison.: ' + poisonededge + '(4)</font>'; m+='</td>'; } } m+='</tr><TR valign=top align=right><TD width=85>Caltrops</td>'; for (i=0;i<Seed.cities.length;i++){ city = 'city'+Seed.cities[i][0]; for (y in Seed.buildings[city]) { if (Seed.buildings[city][y][0] == 19) wall = Seed.buildings[city][y][1]; if (Seed.buildings[city][y][0] == 15) blacksmith = Seed.buildings[city][y][1]; } max = WallSpace[wall]/2/1 - (parseInt(Seed.fortifications[city]["fort60"])*4) - (parseInt(Seed.fortifications[city]["fort61"])*1) - (parseInt(Seed.fortifications[city]["fort62"])*3); m+= '<TD width=79>'+Seed.fortifications[city]["fort61"]; if (wall >=1 && metalalloys >=1 && max>0) m+= '<br>Left: ' + max+'</td>'; else if (t.showReq){ if (wall < 1) m+= '<br><FONT COLOR= "CC0000">Wall: ' + wall + '(1)</font>'; if (metalalloys < 1) m+= '<br><FONT COLOR= "CC0000">Metal.: ' + metalalloys + '(1)</font>'; m+='</td>'; } } m+='</tr><TR valign=top align=right><TD>Spiked Barrier</td>'; for (i=0;i<Seed.cities.length;i++){ city = 'city'+Seed.cities[i][0]; for (y in Seed.buildings[city]) { if (Seed.buildings[city][y][0] == 19) wall = Seed.buildings[city][y][1]; if (Seed.buildings[city][y][0] == 15) blacksmith = Seed.buildings[city][y][1]; } max = (WallSpace[wall]/2/3).toFixed(0) - (parseInt(Seed.fortifications[city]["fort60"])*4) - (parseInt(Seed.fortifications[city]["fort61"])*1) - (parseInt(Seed.fortifications[city]["fort62"])*3); m+= '<TD width=79>'+Seed.fortifications[city]["fort62"]; if (wall >=2 && blacksmith>=2 && logging>=2 && max>0) m+= '<br>Left: ' + max+'</td>'; else if (t.showReq){ if (wall < 2) m+= '<br><FONT COLOR= "CC0000">Wall: ' + wall + '(2)</font>'; if (blacksmith < 2) m+= '<br><FONT COLOR= "CC0000">BlackS.: ' + blacksmith + '(2)</font>'; if (logging < 2) m+= '<br><FONT COLOR= "CC0000">Logg.: ' + logging + '(2)</font>'; m+='</td>'; } } m+='<TR valign=top align=right><TD width=85>Field defences</td>'; for (i=0;i<Seed.cities.length;i++){ city = 'city'+Seed.cities[i][0]; for (y in Seed.buildings[city]) { if (Seed.buildings[city][y][0] == 19) wall = Seed.buildings[city][y][1]; } build = (parseInt(Seed.fortifications[city]["fort60"])*4)+ (parseInt(Seed.fortifications[city]["fort61"])*1) + (parseInt(Seed.fortifications[city]["fort62"])*3); max = WallSpace[wall]/2; if (build < max) m+='<TD width=79><FONT COLOR= "CC0000">'; else m+='<TD width=79><FONT COLOR= "669900">'; m+= build+'</font>'; m+= '/' + max +'</td>'; } m+='</tr></table><BR><TABLE class=ptBuilds border=1px cellpadding=5 cellspacing=0>'; m+='<TR valign=top align=right><TD width=85>City space</td>'; for(i=0; i<Seed.cities.length; i++) { var count=0; city = 'city'+Seed.cities[i][0]; for (y in Seed.buildings[city]) { if (Seed.buildings[city][y][0] >=5 && Seed.buildings[city][y][0] <19) count++; } if (count == 31) m+='<TD width=79><FONT COLOR= "669900">'; else m+='<TD width=79><FONT COLOR= "CC0000">'; m+= count + '</font> (31)</td>'; } m+='</tr>'; m+='<TR valign=top align=right><TD width=85>Field space</td>'; for(i=0; i<Seed.cities.length; i++) { var count=0; var castle=0; city = 'city'+Seed.cities[i][0]; for (y in Seed.buildings[city]) { if (Seed.buildings[city][y][0] == 0) castle = Seed.buildings[city][y][1]; if (Seed.buildings[city][y][0] >=1 && Seed.buildings[city][y][0] <=4) count++; } if (count == FieldSpace[castle]) m+='<TD width=79><FONT COLOR= "669900">'; else m+='<TD width=79><FONT COLOR= "CC0000">'; m+= count + '</font> ('+FieldSpace[castle]+')</td>'; } m+='</tr>'; for (b=0;b<20;b++){ m+='<TR valign=top align=right><TD width=85>'+buildings[b]+'</td>'; for (c=0;c<Seed.cities.length;c++){ m+='<TD style="width:79px; max-width:79px; word-wrap: break-word;">'; city= 'city'+Seed.cities[c][0]; var count =0; for (y in Seed.buildings[city]) { if (Seed.buildings[city][y][0] == b) { count++; if (count > 1) m+=","; if (Seed.buildings[city][y][1] >= 9) m+='<FONT COLOR= "669900">'; m+=Seed.buildings[city][y][1]; if (Seed.buildings[city][y][1] >= 9) m+='</font>'; } } if (count == 0) { m+='<FONT COLOR= "CC0000">0</font>'; } m+='</td>'; } m+='</tr>'; } m+='</tr></table><BR><TABLE class=ptBuilds border=1px cellpadding=5 cellspacing=0>'; for(i=0; i<Cities.numCities; i++) { } m+='<TR valign=top align=right><TD width=85>Guardians</td>'; for(i=0; i<Seed.cities.length; i++) { for(g=0;g<Seed.guardian.length;g++) { if (Seed.guardian[g]['cityId'] == Seed.cities[i][0] && Seed.guardian[g]['level']!=0) { m += '<TD width=79>'; if (Seed.guardian[g]['level'] >=9) m+='<FONT COLOR= "669900">'; m+=Seed.guardian[g]['level']+"("+Seed.guardian[g]['type']+")</td>"; if (Seed.guardian[g]['level'] >=9) m+='</font>'; } else {if (Seed.guardian[g]['cityId'] == Seed.cities[i][0] && Seed.guardian[g]['level']==0) m += '<TD width=79><FONT COLOR= "CC0000">0</font></td>'}; } } m+='</tr></table><BR></table><BR><TABLE class=ptBuilds border=1px cellpadding=2 cellspacing=0><TR valign=top align=left>'; for (i in Research) { select = 'tch'+i; m+='<TD border=1px style="width:150px;">'+Research[i]+'</td><TD align=center style="width:50px max-width:150px;">'; if (Seed.tech[select] >=9) m+='<FONT COLOR= "669900">'; if (Seed.tech[select] ==0) m+='<FONT COLOR= "CC0000">'; m+=Seed.tech[select]; if (Seed.tech[select] >=9 || Seed.tech[select] ==0) m+='</font>'; if (t.showReq) { for(z=0; z<Seed.cities.length; z++) { city = 'city'+Seed.cities[z][0]; for (y in Seed.buildings[city]) { var farm,sawmill,quarry,mine,alchemylab,workshop,blacksmith,stable,storehouse,barracks = 0; if (Seed.buildings[city][y][0] == 1 && Seed.buildings[city][y][0] > farm) farm = Seed.buildings[city][y][1]; if (Seed.buildings[city][y][0] == 2 && Seed.buildings[city][y][0] > sawmill) sawmill = Seed.buildings[city][y][1]; if (Seed.buildings[city][y][0] == 3 && Seed.buildings[city][y][0] > quarry) quarry = Seed.buildings[city][y][1]; if (Seed.buildings[city][y][0] == 4 && Seed.buildings[city][y][0] > mine) mine = Seed.buildings[city][y][1]; if (Seed.buildings[city][y][0] == 9) storehouse = Seed.buildings[city][y][1]; if (Seed.buildings[city][y][0] == 11) alchemylab = Seed.buildings[city][y][1]; if (Seed.buildings[city][y][0] == 13 && Seed.buildings[city][y][0] > barracks) barracks = Seed.buildings[city][y][1]; if (Seed.buildings[city][y][0] == 15) blacksmith = Seed.buildings[city][y][1]; if (Seed.buildings[city][y][0] == 16) workshop = Seed.buildings[city][y][1]; if (Seed.buildings[city][y][0] == 17) stable = Seed.buildings[city][y][1]; } } m+='<FONT COLOR= "CC0000">'; switch (i) { case '1': if (alchemylab < Seed.tech[select]) m+='<BR>Alchemy Lab '+ alchemylab+ '('+ (Seed.tech[select]) +')'; if (farm < Seed.tech[select]) m+='<BR>Farm '+ farm +'('+ (Seed.tech[select]+1) +')</td>'; break; case '2': if (alchemylab < Seed.tech[select]) m+='<BR>Alchemy Lab '+ alchemylab+ '('+ (Seed.tech[select]) +')'; if (sawmill < Seed.tech[select]) m+='<BR>Sawmill '+ sawmill +'('+ (Seed.tech[select]) +')'; break; case '3': if (alchemylab < Seed.tech[select]) m+='<BR>Alchemy Lab '+ alchemylab+ '('+ (Seed.tech[select]) +')'; if (quarry < Seed.tech[select]) m+='<BR>Quarry '+ quarry +'('+ (Seed.tech[select]) +')</td>'; break; case '4': if (alchemylab < Seed.tech[select]) m+='<BR>Alchemy Lab '+ alchemylab+ '('+ (Seed.tech[select]) +')'; if (mine < Seed.tech[select]) m+='<BR>Mine '+ mine +'('+ (Seed.tech[select]) +')'; break; case '5': if (alchemylab < 3) m+='<BR>Alchemy Lab '+ alchemylab +'(3)'; if (alchemylab >= 3 && alchemylab < Seed.tech[select]) m+='<BR>Alchemy Lab '+ alchemylab +'('+ (Seed.tech[select]) +')'; if (workshop < Seed.tech[select]) m+='<BR>Workshop ' + workshop +'('+ (Seed.tech[select]) +')'; if (stoneworking < 2) m+='<BR>Stoneworking '+ stoneworking +'(2)'; break; case '6': if (alchemylab < 3) m+='<BR>Alchemy Lab '+ alchemylab +'(3)'; if (alchemylab >= 3 && alchemylab < Seed.tech[select]) m+='<BR>Alchemy Lab '+ alchemylab +'('+ (Seed.tech[select]) +')'; break; case '8': if (alchemylab < 2) m+='<BR>Alchemy Lab '+ alchemylab +'(2)'; if (alchemylab >= 2 && alchemylab < Seed.tech[select]) m+='<BR>Alchemy Lab '+ alchemylab +'('+ (Seed.tech[select]) +')'; if (barracks < 2) m+='<BR>Barracks '+ barracks +'(2)'; break; case '9': if (alchemylab < 3) m+='<BR>Alchemy Lab '+ alchemylab +'(3)'; if (alchemylab >= 3 && alchemylab < Seed.tech[select]) m+='<BR>Alchemy Lab '+ alchemylab +'('+ (Seed.tech[select]) +')'; if (blacksmith < Seed.tech[select]) m+='<BR>Blacksmith '+ blacksmith+'('+ (Seed.tech[select]) +')'; if (mining < Seed.tech[select]) m+='<BR>Mining '+ mining +'('+ (Seed.tech[select]) +')'; break; case '10': if (alchemylab < 4) m+='<BR>Alchemy Lab '+ alchemylab +'(4)'; if (alchemylab >= 4 && alchemylab < Seed.tech[select]) m+='<BR>Alchemy Lab '+ alchemylab +'('+ (Seed.tech[select]) +')'; break; case '11': if (alchemylab < 4) m+='<BR>Alchemy Lab '+ alchemylab +'(4)'; if (alchemylab >= 4 && alchemylab < Seed.tech[select]) m+='<BR>Alchemy Lab '+ alchemylab +'('+ (Seed.tech[select]) +')'; break; case '12': if (alchemylab < 5) m+='<BR>Alchemy Lab '+ alchemylab +'(5)'; if (alchemylab >= 5 && alchemylab < Seed.tech[select]) m+='<BR>Alchemy Lab '+ alchemylab +'('+ (Seed.tech[select]) +')'; if (stable < Seed.tech[select]) m+='<BR>Stable '+ stable +'('+ (Seed.tech[select]+1) +')'; if (metalalloys < Seed.tech[select]) m+='<BR>Metal Alloys '+ metalalloys +'('+ (Seed.tech[select]+1) +')'; break; case '13': if (alchemylab < 4) m+='<BR>Alchemy Lab '+ alchemylab +'(4)'; if (alchemylab >= 4 && alchemylab < Seed.tech[select]) m+='<BR>Alchemy Lab '+ alchemylab +'('+ (Seed.tech[select]) +')'; if (logging < 4) m+='<BR>Logging '+ logging +'(4)'; break; case '14': if (alchemylab < 6) m+='<BR>Alchemy Lab '+ alchemylab +'(6)'; if (alchemylab >= 6 && alchemylab < Seed.tech[select]) m+='<BR>Alchemy Lab '+ alchemylab +'('+ (Seed.tech[select]) +')'; if (storehouse < Seed.tech[select]) m+='<BR>Storehouse '+ storehouse +'('+ (Seed.tech[select]) +')'; if (logging < 3) m+='<BR>Logging '+ logging+'(3)'; break; case '15': if (alchemylab < 6) m+='<BR>Alchemy Lab '+ alchemylab +'(6)'; if (alchemylab >= 6 && alchemylab < Seed.tech[select]) m+='<BR>Alchemy Lab '+ alchemylab +'('+ (Seed.tech[select]) +')'; if (featherweightpowder < 3) m+='<BR>Featherweight Powder '+ featherweightpowder +'(3)'; break; case '16': if (alchemylab < 5) m+='<BR>Alchemy Lab '+ alchemylab +'(5)'; if (alchemylab >= 5 && alchemylab < Seed.tech[select]) m+='<BR>Alchemy Lab '+ alchemylab +'('+ (Seed.tech[select]) +')'; if (logging < 5) m+='<BR>Logging '+ logging +'(5)'; if (geometry < 2) m+='<BR>Geometry '+ geometry +'(2)'; break; } m+='</font>'; } m+='</td></tr>'; } m+='</table></div>'; t.cont.style.maxHeight = '750px'; t.cont.style.overflowY = 'scroll'; t.cont.innerHTML = m; document.getElementById('showReq').addEventListener ('change', function (){ t.showReq = document.getElementById('showReq').checked; t.paint(); },false); t.displayTimer = setTimeout (t.paint, 1000); }, show : function (){ var t = Tabs.Builds; t.paint(); }, hide : function (){ }, }; /********************************* Reports Tab *************************************/ Tabs.Rpt = { tabOrder: 40, tabLabel: 'Reports', cont: null, state: null, minPages: parseInt(Options.arPageFrom), maxPages: parseInt(Options.arPageTo), data: [], report: [], totalPages: parseInt(Options.arPageTo), what: '', whatNot: '', content: '', init: function (div){ var t = Tabs.Rpt; t.cont=div; unsafeWindow.getmsg = t.getMailBody; unsafeWindow.getReport = t.getReportBody; var tc = '<DIV class=ptstat>SEARCH INBOX, OUTBOX, PLAYER AND ALLIANCE REPORTS</DIV><DIV class=ptentry><TABLE><TR align=center valign=center>'; tc += '<TD class=xtab align=right>Type: <SELECT id="idRptType">'; tc += '<OPTION value="alliance" ' + (Options.rptType=='alliance'?'SELECTED':'') + '>Alliance Reports</OPTION>'; tc += '<OPTION value="player" ' + (Options.rptType=='player'?'SELECTED':'') + '>Player Reports</OPTION>'; tc += '<OPTION value="inbox" ' + (Options.rptType=='inbox'?'SELECTED':'') + '>Inbox</OPTION>'; tc += '<OPTION value="outbox" ' + (Options.rptType=='outbox'?'SELECTED':'') + '>Outbox</OPTION></SELECT>'; tc += '<BR />Pages: <INPUT id="idRptPageFrom" size=1 value="' + Options.arPageFrom + '">–<INPUT id="idRptPageTo" size=1 value="' + Options.arPageTo + '"></TD>'; tc += '<TD class=xtab align=right>Attacker: <SELECT id="idRptAttacker">'; // Options.arPageFrom - Options.arPageTo tc += '<OPTION value="Them" ' + (Options.arAttacker=='Them'?'SELECTED':'') + '>Them</OPTION>'; tc += '<OPTION value="Us" ' + (Options.arAttacker=='Us'?'SELECTED':'') + '>Us</OPTION>'; tc += '<OPTION value="Both" ' + (Options.arAttacker=='Both'?'SELECTED':'') + '>Both</OPTION></SELECT>'; tc += '<BR />Target: <SELECT id="idRptTarget">'; tc += '<OPTION value="Them" ' + (Options.arTarget=='Them'?'SELECTED':'') + '>Them</OPTION>'; tc += '<OPTION value="Us" ' + (Options.arTarget=='Us'?'SELECTED':'') + '>Us</OPTION>'; tc += '<OPTION value="Both" ' + (Options.arTarget=='Both'?'SELECTED':'') + '>Both</OPTION></SELECT></TD>'; tc += '<TD class=xtab align=right>Contains: <INPUT id=idRptWhat type=text size=11 maxlength=50 value=""><BR />'; tc += 'But not: <INPUT id=idRptWhatNot type=text size=11 maxlength=50 value=""></TD>'; tc += '<TD class=xtab align=left><INPUT id=idRptAttack type=checkbox '+(Options.arAttack?'CHECKED':'')+' /> Attack<BR />'; tc += '<INPUT id=idRptScout type=checkbox '+(Options.arScout?'CHECKED':'')+' /> Scout</TD>'; tc += '<TD class=xtab align=left><INPUT id=idRptReinforce type=checkbox '+(Options.arReinforce?'CHECKED':'')+' /> Reinforce<BR />'; tc += '<INPUT id=idRptTransport type=checkbox '+(Options.arTransport?'CHECKED':'')+' /> Transport</TD>'; tc += '<TD class=xtab align=left><INPUT id=idRptSearch type=submit value="Start Search" /></TD></TR></TABLE></DIV>'; tc += '<DIV class=ptstat><TABLE width=100% cellspacing=0><TR><TD class=xtab align=left width=125><DIV id=idRptSearched></DIV></TD></TD>'; tc += '<TD class=xtab><TD class=xtab align=center><SPAN style="white-space:normal" id=idRptStatus> </span></TD></TD>'; tc += '<TD class=xtab><TD class=xtab align=right width=125><DIV id=idRptFound></DIV></TD></TR></TABLE></DIV>'; tc += '<DIV id="idRptResultsDiv" style="height:556px; max-height:556px; overflow-x:auto; overflow-y:auto; white-space:nowrap;"></DIV>'; t.cont.innerHTML = tc; document.getElementById('idRptType').addEventListener ('change', t.handleRptType, false); document.getElementById('idRptPageFrom').addEventListener ('change', t.handleRptPages, false); document.getElementById('idRptPageTo').addEventListener ('change', t.handleRptPages, false); document.getElementById('idRptAttacker').addEventListener ('change', t.handleRptAttacker, false); document.getElementById('idRptTarget').addEventListener ('change', t.handleRptTarget, false); document.getElementById('idRptWhat').addEventListener ('keyup', t.handleRptWhat, false); document.getElementById('idRptWhatNot').addEventListener ('keyup', t.handleRptWhatNot, false); document.getElementById('idRptSearch').addEventListener ('click', t.handleRptSearch, false); t.togOpt ('idRptAttack', 'arAttack'); t.togOpt ('idRptScout', 'arScout'); t.togOpt ('idRptReinforce', 'arReinforce'); t.togOpt ('idRptTransport', 'arTransport'); return this.cont; }, togOpt: function (checkboxId, optionName){ var t = Tabs.Rpt; var checkbox = document.getElementById(checkboxId); checkbox.addEventListener ('change', eventHandler, false); function eventHandler (){ Options[optionName] = this.checked; saveOptions(); if (t.data.length > 0) if (Options.rptType == 'alliance' || Options.rptType == 'player') t.DisplayRpt(); else t.DisplayMail(); } }, handleRptType: function(){ var t = Tabs.Rpt; Options.rptType = document.getElementById("idRptType").value; saveOptions(); document.getElementById("idRptSearched").innerHTML = ''; document.getElementById("idRptStatus").innerHTML = ' '; document.getElementById("idRptFound").innerHTML = ''; document.getElementById("idRptResultsDiv").innerHTML = ''; }, handleRptPages: function(){ var t = Tabs.Rpt; t.minPages=parseInt(document.getElementById("idRptPageFrom").value); t.maxPages=parseInt(document.getElementById("idRptPageTo").value); if (t.maxPages < t.minPages) { t.maxPages = t.minPages; document.getElementById("idRptPageTo").value = t.maxPages; } Options.arPageFrom = t.minPages; Options.arPageTo = t.maxPages; saveOptions(); t.totalPages=t.maxPages; }, handleRptAttacker: function(){ var t = Tabs.Rpt; Options.arAttacker = document.getElementById("idRptAttacker").value; saveOptions(); if ((Options.rptType == 'alliance' || Options.rptType == 'player') && t.data.length > 0) t.DisplayRpt(); }, handleRptTarget: function(){ var t = Tabs.Rpt; Options.arTarget = document.getElementById("idRptTarget").value; saveOptions(); if ((Options.rptType == 'alliance' || Options.rptType == 'player') && t.data.length > 0) t.DisplayRpt(); }, handleRptWhat: function(){ var t = Tabs.Rpt; t.what = document.getElementById("idRptWhat").value; if (t.data.length > 0) if (Options.rptType == 'alliance' || Options.rptType == 'player') t.DisplayRpt(); else t.DisplayMail(); }, handleRptWhatNot: function(){ var t = Tabs.Rpt; t.whatNot = document.getElementById("idRptWhatNot").value; if (t.data.length > 0) if (Options.rptType == 'alliance' || Options.rptType == 'player') t.DisplayRpt(); else t.DisplayMail(); }, handleRptSearch: function(){ var t = Tabs.Rpt; if (t.searchRunning){ t.searchRunning = false; t.stopSearch ('SEARCH CANCELLED!'); return; } t.handleRptPages(); document.getElementById ('idRptSearch').value = 'Stop Search'; document.getElementById('idRptStatus').innerHTML = 'Searching page ' + t.minPages + ' of ' + t.maxPages; t.searchRunning = true; t.data=[]; t.report = []; if (Options.rptType == 'alliance' || Options.rptType == 'player') t.getRpt(t.minPages); else t.getMail(t.minPages); }, stopSearch: function (msg){ var t = Tabs.Rpt; if (t.searchRunning || msg == 'SEARCH CANCELLED!') document.getElementById ('idRptStatus').innerHTML = '<FONT color=#ffaaaa>' + msg + '</FONT>'; document.getElementById ('idRptSearch').value = 'Start Search'; t.searchRunning = false; if (Options.rptType == 'alliance' || Options.rptType == 'player') t.DisplayRpt(); else t.DisplayMail(); }, getMail: function (pageNum){ var t = Tabs.Rpt; var params = unsafeWindow.Object.clone(unsafeWindow.g_ajaxparams); params.pf=0; params.requestType="GET_MESSAGE_HEADERS_FOR_USER_INBOX"; params.boxType = document.getElementById('idRptType').value; params.pageNo = pageNum; new MyAjaxRequest(unsafeWindow.g_ajaxpath + "ajax/getEmail.php" + unsafeWindow.g_ajaxsuffix, { method: "post", parameters: params, onSuccess: function (rslt) { t.getMailCallback(rslt, pageNum); }, onFailure: function () { }, }, false); }, getMailCallback: function(rslt, page) { var t = Tabs.Rpt; if (rslt) { if (!rslt.ok) { document.getElementById("idRptStatus").innerHTML = '<FONT color=#ffaaaa>' + rslt.errorMsg + '</FONT>'; return; } t.totalPages=parseInt(rslt.noOfPages); if (t.totalPages < t.maxPages) t.maxPages = t.totalPages; if (rslt.message && page) { var ml = rslt.message; if (rslt.messageCount > 0) { var rptkeys = unsafeWindow.Object.keys(ml); for (var i = 0; i < rptkeys.length; i++) { var rpt = ml[rptkeys[i]]; rpt.page = page; t.data.push(rpt); } } } if (parseInt(page)+1 <= t.maxPages && t.searchRunning) { document.getElementById("idRptStatus").innerHTML = 'Searching page ' + (parseInt(page)+1) + ' of ' + t.maxPages; t.getMail(parseInt(page)+1); if (t.data.length > 0) t.DisplayMail(); } else if (page) t.stopSearch ('Done!'); } }, getRpt: function (pageNum){ var t = Tabs.Rpt; var params = unsafeWindow.Object.clone(unsafeWindow.g_ajaxparams); params.pageNo = pageNum; if (Options.rptType == 'alliance') params.group = "a"; new MyAjaxRequest(unsafeWindow.g_ajaxpath + "ajax/listReports.php" + unsafeWindow.g_ajaxsuffix, { method: "post", parameters: params, onSuccess: function (rslt){ t.getRptCallback (rslt, pageNum); }, onFailure: function (rslt){ t.getRptCallback (rslt, pageNum); }, }, false); }, getRptCallback: function(rslt, page){ var t = Tabs.Rpt; if (rslt) { if (!rslt.ok) { document.getElementById("idRptStatus").innerHTML = '<FONT color=#ffaaaa>' + rslt.errorMsg + '</FONT>'; return; } t.totalPages=parseInt(rslt.totalPages); if (t.totalPages < t.maxPages) t.maxPages = t.totalPages; if (rslt.arReports && page) { var ar = rslt.arReports; if (ar.length == 0) t.stopSearch('Empty pages found from page ' + page + ' onwards - Kabam glitch'); var rptkeys = unsafeWindow.Object.keys(ar); for (var i = 0; i < rptkeys.length; i++) { var rpt = ar[rptkeys[i]]; var reportId = parseInt(rpt.reportId); t.report[reportId] = []; // Attacker t.report[reportId].side1Name = rslt.arPlayerNames['p'+rpt.side1PlayerId]; t.report[reportId].side1AllianceId = parseInt(rpt.side1AllianceId); if (rpt.side1AllianceId > 0) t.report[reportId].side1AllianceName = rslt.arAllianceNames['a'+rpt.side1AllianceId]; else t.report[reportId].side1AllianceName = 'unaligned'; if (rpt.side1CityId > 0) t.report[reportId].side1CityName = rslt.arCityNames['c'+rpt.side1CityId]; else t.report[reportId].side1CityName = 'none'; t.report[reportId].side1XCoord = rpt.side1XCoord; t.report[reportId].side1YCoord = rpt.side1YCoord; // Target if (parseInt(rpt.side0PlayerId) == 0) { // Kabam t.report[reportId].side0Name = 'Enemy'; t.report[reportId].side0AllianceName = ''; t.report[reportId].side0CityName = ''; } else { // Player t.report[reportId].side0Name = rslt.arPlayerNames['p'+rpt.side0PlayerId]; if (rpt.side0AllianceId > 0) t.report[reportId].side0AllianceName = rslt.arAllianceNames['a'+rpt.side0AllianceId]; else t.report[reportId].side0AllianceName = 'unaligned'; if (rpt.side0CityId > 0) t.report[reportId].side0CityName = rslt.arCityNames['c'+rpt.side0CityId]; else t.report[reportId].side0CityName = 'none'; } t.report[reportId].side0AllianceId = parseInt(rpt.side0AllianceId); t.report[reportId].side0XCoord = rpt.side0XCoord; t.report[reportId].side0YCoord = rpt.side0YCoord; if (parseInt(rpt.side0TileType) == 10) t.report[reportId].side0TileTypeText='Grass'; else if (parseInt(rpt.side0TileType) == 11) t.report[reportId].side0TileTypeText='Lake'; else if (parseInt(rpt.side0TileType) == 20) t.report[reportId].side0TileTypeText='Woods'; else if (parseInt(rpt.side0TileType) == 30) t.report[reportId].side0TileTypeText='Hills'; else if (parseInt(rpt.side0TileType) == 40) t.report[reportId].side0TileTypeText='Mount'; else if (parseInt(rpt.side0TileType) == 50) t.report[reportId].side0TileTypeText='Plain'; else if (parseInt(rpt.side0CityId) ==0) t.report[reportId].side0TileTypeText='Barb'; else t.report[reportId].side0TileTypeText='City'; t.report[reportId].side0TileTypeLevel = t.report[reportId].side0TileTypeText + ' ' + rpt.side0TileLevel; t.report[reportId].side0TileType = rpt.side0TileType; t.report[reportId].side0TileLevel = rpt.side0TileLevel; // Miscellaneous t.report[reportId].page = page; t.report[reportId].reportUnixTime = rpt.reportUnixTime; if (rpt.side0AllianceId == parseInt(getMyAlliance()[0])) t.report[reportId].sideId = 0; else if (rpt.side1AllianceId == parseInt(getMyAlliance()[0])) { t.report[reportId].sideId = 1; } else { // if we're here then this is a player report from when they were in another alliance if (rpt.side0PlayerId == getMyUserId()) t.report[reportId].sideId = 0; else if (rpt.side1PlayerId == getMyUserId()) t.report[reportId].sideId = 1; else // shouldn't get here but we'll catch it if the report body is requested t.report[reportId].sideId = -1; } if (rpt.marchType == 0) t.report[reportId].marchName = 'Desertion'; else if (rpt.marchType == 1) t.report[reportId].marchName = 'Transport'; else if (rpt.marchType == 2) t.report[reportId].marchName = 'Reinforce'; else if (rpt.marchType == 3) { if (t.report[reportId].sideId == 0) t.report[reportId].marchName = 'Anti-Scout'; else t.report[reportId].marchName = 'Scout'; } else if (rpt.marchType == 4) { if (t.report[reportId].sideId == 0) t.report[reportId].marchName = 'Defend'; else t.report[reportId].marchName = 'Attack'; } else t.report[reportId].marchName = '?'; t.data.push ({ reportId: reportId, }); } } if (parseInt(page)+1 <= t.maxPages && t.searchRunning) { document.getElementById("idRptStatus").innerHTML = 'Searching page ' + (parseInt(page)+1) + ' of ' + t.maxPages; t.getRpt(parseInt(page)+1); if (t.data.length > 0) t.DisplayRpt(); } else if (page) t.stopSearch ('Done!'); } }, DisplayMail: function (){ var t = Tabs.Rpt; var results = document.getElementById("idRptResultsDiv"); if(!t.data.length) { results.innerHTML = '<center>None found</center>'; return; } reportsSearched = t.data.length; reportsFound = 0; t.content = ''; for (var i=0; i<reportsSearched;i++) { var rpt = t.data[i]; if ((t.what == '' || (rpt.subject.search(t.what, "i") != -1) || (rpt.displayName.search(t.what, "i") != -1)) && (t.whatNot == '' || ((rpt.subject.search(t.whatNot, "i") == -1) && (rpt.displayName.search(t.whatNot, "i") == -1)))) { reportsFound++; if (reportsFound == 1) t.content += '<center><table><thead><th>P</th><th>Date</th><th>From</th><th>Subject</th></thead><tbody>'; t.content += '<tr><td align=right>'+rpt.page+'</td><td>'+rpt.dateSent+'</td><td>'+rpt.displayName+'</td>'; t.content += '<td><A><SPAN onclick="getmsg('+ rpt.messageId +')">' + rpt.subject + '</SPAN></a></td></tr>'; } } if (reportsFound > 1) t.content += '</tbody></table></center>'; if (reportsFound == 0 && reportsSearched > 0) t.content = '<center>None found</center>'; results.innerHTML = t.content; document.getElementById("idRptSearched").innerHTML = ' Searched: ' + reportsSearched; document.getElementById("idRptFound").innerHTML = 'Found: ' + reportsFound; }, getMailBody: function(ID,dataI){ var t = Tabs.Rpt; var params = unsafeWindow.Object.clone(unsafeWindow.g_ajaxparams); params.messageId=ID; params.requestType="GET_MESSAGE_FOR_ID"; new MyAjaxRequest(unsafeWindow.g_ajaxpath + "ajax/getEmail.php" + unsafeWindow.g_ajaxsuffix, { method: "post", parameters: params, onSuccess: function (rslt) { if (rslt.ok) t.displayMailBody(rslt.messageBody); }, onFailure: function () {}, }, false); }, displayMailBody: function (messageBody) { var t = Tabs.Rpt; var popMsg = null; t.popMsg = new CPopup('pbMailBody', 0, 0, 670, 600, true, function() {clearTimeout (1000);}); t.popMsg.centerMe (mainPop.getMainDiv()); var m = '<DIV style="max-height:565px; height:565px; overflow-y:scroll">'; m+= messageBody + '</div>'; t.popMsg.getMainDiv().innerHTML = m; t.popMsg.getTopDiv().innerHTML = '<DIV align=center><B>Message</B></DIV>'; t.popMsg.show(true); }, DisplayRpt: function (){ var t = Tabs.Rpt; var results = document.getElementById("idRptResultsDiv"); if(!t.data.length) { results.innerHTML = '<center>None found</center>'; return; } var myAllianceId = parseInt(getMyAlliance()[0]); reportsSearched = t.data.length; reportsFound = 0; t.content = ''; for (var i=0; i<reportsSearched;i++) { var reportId = t.data[i].reportId; var rpt = t.report[reportId]; if ((rpt.side0Name=='undefined') && (rpt.marchName != 'Desertion')) continue; if ((((myAllianceId == parseInt(rpt.side1AllianceId) && Options.arAttacker != 'Them') || (myAllianceId != parseInt(rpt.side1AllianceId) && Options.arAttacker != 'Us') || Options.arAttacker == 'Both') && ((myAllianceId == parseInt(rpt.side0AllianceId) && Options.arTarget != 'Them') || (myAllianceId != parseInt(rpt.side0AllianceId) && Options.arTarget != 'Us') || Options.arTarget == 'Both') && ((Options.arAttack && (rpt.marchName == 'Attack' || rpt.marchName == 'Defend')) || (Options.arScout && (rpt.marchName == 'Scout' || rpt.marchName == 'Anti-Scout')) || (Options.arReinforce && rpt.marchName == 'Reinforce') || (Options.arTransport && rpt.marchName == 'Transport'))) || (rpt.marchName == 'Desertion')) { if (((t.what == '' || (rpt.side1Name.search(t.what, "i") != -1) || (rpt.side1AllianceName.search(t.what, "i") != -1) || (rpt.side0Name.search(t.what, "i") != -1) || (rpt.side0AllianceName.search(t.what, "i") != -1) || (rpt.side0TileTypeText.search(t.what, "i") != -1)) && (t.whatNot == '' || ((rpt.side1Name.search(t.whatNot, "i") == -1) && (rpt.side1AllianceName.search(t.whatNot, "i") == -1) && (rpt.side0Name.search(t.whatNot, "i") == -1) && (rpt.side0AllianceName.search(t.whatNot, "i") == -1) && (rpt.side0TileTypeText.search(t.whatNot, "i") == -1)))) || (rpt.marchName == 'Desertion')) { reportsFound++; if (reportsFound == 1) { if (Options.enableReportNumber) t.content += '<center><table><thead><th>P</th><th>Date</th><th>Report</th><th>Attacker</th><th>From</th>'; else t.content += '<center><table><thead><th>P</th><th>Date</th><th>Attacker</th><th>From</th>'; if (Options.arAttacker != 'Us') t.content += '<th>Alliance</th>'; t.content += '<th>Action</th><th>Target</th><th>Type</th><th>At</th>'; if (Options.arTarget != 'Us') t.content += '<th>Alliance</th>'; t.content += '<th>Dist</th><th>Nearest</th></thead><tbody>'; } var closestDist=999999; var closestLoc=null; var closestNum=1; for (var c=0; c<Cities.numCities; c++){ var city = Cities.cities[c]; city.x +','+ city.y var dist=distance(city.x,city.y,rpt.side0XCoord,rpt.side0YCoord); if(dist<closestDist) { closestDist=dist; closestLoc=city.x +','+ city.y; closestNum=c+1; } } t.content += '<tr><td align=right>'+rpt.page+'</td><td>'+formatUnixTime(rpt.reportUnixTime,'24hour')+'</td>'; if (Options.enableReportNumber) t.content += '<td>' + reportId + '</td>'; if (rpt.marchName == 'Desertion') { t.content += '<td></td><td></td>'; if (Options.arAttacker != 'Us') t.content += '<td></td>'; t.content += '<td>'+rpt.marchName+'</td><td></td><td></td><td></td>'; if (Options.arAttacker != 'Us') t.content += '<td></td>'; t.content += '<td></td><td></td>'; } else { t.content += '<td>'+rpt.side1Name+'</td><td align=center><A onclick="ptGotoMap('+ rpt.side1XCoord +','+ rpt.side1YCoord +')">'+ rpt.side1XCoord +','+ rpt.side1YCoord +'</a></td>'; if (Options.arAttacker != 'Us') t.content += '<td>'+rpt.side1AllianceName+'</td>'; t.content += '<td><A><SPAN onclick="getReport('+ reportId+')">'+rpt.marchName+'</span></a></td>'; t.content += '<td>'+rpt.side0Name+'</td><td>'+rpt.side0TileTypeLevel+'</td>'; t.content += '<td align=center><A onclick="ptGotoMap('+ rpt.side0XCoord +','+ rpt.side0YCoord +')">'+ rpt.side0XCoord +','+ rpt.side0YCoord +'</a></td>'; if (Options.arTarget != 'Us') t.content += '<td>'+rpt.side0AllianceName+'</td>'; t.content += '<td align=right>'+Math.floor(closestDist)+'</td><td align=center><A onclick=\"ptGotoCity(' + closestNum + ')\">' + closestLoc + '</a></td></tr>'; } } } } if (reportsFound > 1) t.content += '</tbody></table></center>'; if (reportsFound == 0 && reportsSearched > 0) t.content = '<center>None found</center>'; results.innerHTML = t.content; document.getElementById("idRptSearched").innerHTML = ' Searched: ' + reportsSearched; document.getElementById("idRptFound").innerHTML = 'Found: ' + reportsFound; }, getReportBody: function(reportId){ var t = Tabs.Rpt; var params = unsafeWindow.Object.clone(unsafeWindow.g_ajaxparams); //params.pf=0; params.rid=reportId; params.side=t.report[reportId].sideId; if (params.side > -1) { new MyAjaxRequest(unsafeWindow.g_ajaxpath + "ajax/fetchReport.php" + unsafeWindow.g_ajaxsuffix, { method: "post", parameters: params, onSuccess: function (rslt) { t.displayReportBody(rslt,reportId); }, onFailure: function (rslt) {}, }, false); } else { unsafeWindow.alert ('Could not determine which side of the report to view - please send details to the developer'); } }, displayReportBody: function (rslt, reportId) { var t = Tabs.Rpt; var popReport = null; var rpt = t.report[reportId]; var m = ''; var unitImg = []; for (var i=1;i<13;i++) unitImg[i] = '<img src=http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/units/unit_'+i+'_30.png></TD><TD>' + unsafeWindow.unitcost['unt'+i][0]; unitImg[53] = '<img src=http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/units/unit_53_30.png></TD><TD>Crossbows'; unitImg[55] = '<img src=http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/units/unit_55_30.png></TD><TD>Trebuchet'; unitImg[60] = '<img src=http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/units/unit_60_30.png></TD><TD>Trap'; unitImg[61] = '<img src=http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/units/unit_61_30.png></TD><TD>Caltrops'; unitImg[62] = '<img src=http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/units/unit_62_30.png></TD><TD>Spiked Barrier'; goldImg = '<img src=http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/gold_30.png></TD><TD>Gold'; foodImg = '<img src=http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/food_30.png></TD><TD>Food'; woodImg = '<img src=http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/wood_30.png></TD><TD>Wood'; stoneImg = '<img src=http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/stone_30.png></TD><TD>Stone'; oreImg = '<img src=http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/iron_30.png></TD><TD>Ore'; function buildHeader () { var h='<TABLE class=ptTab width=100%>'; h+='<TR valign=top><TD align=left width=10%><B>'; if (rpt.marchName == 'Anti-Scout' || rpt.marchName == 'Scout') h+=rpt.marchName+'ing at'; else if (rpt.marchName == 'Attack' || rpt.marchName == 'Defend') h+='Battle at '; else if (rpt.marchName == 'Reinforce' || rpt.marchName == 'Transport') h+=rpt.marchName+' from<BR />'+rpt.marchName+' to</B>'; if (rpt.side0TileTypeText == 'Barb') h+=' Barbarian Camp Level ' + rpt.side0TileLevel; else if (rpt.side0TileTypeText != 'City') h+=' '+rpt.side0TileTypeText+' Level '+ rpt.side0TileLevel+' '; h+='</B></TD>'; if (rpt.marchName == 'Reinforce' || rpt.marchName == 'Transport') { h+='<TD align=left width=1%>'; if (Seed.player.name != rpt.side1Name) h+=rpt.side1Name; if (Seed.player.name != rpt.side0Name) h+='<BR />'+rpt.side0Name; h+='</TD>'; } h+='<TD align=left width=5%>'; if (rpt.marchName == 'Reinforce' || rpt.marchName == 'Transport') h+='(<A onclick="ptGotoMap('+ rpt.side1XCoord +','+ rpt.side1YCoord +')">'+ rpt.side1XCoord +','+ rpt.side1YCoord +'</a>)<BR />'; h+='(<A onclick="ptGotoMap('+ rpt.side0XCoord +','+ rpt.side0YCoord +')">'+ rpt.side0XCoord +','+ rpt.side0YCoord +'</a>)</TD>'; if (rpt.side0TileTypeText != 'City' && rpt.side0TileTypeText != 'Barb' && rpt.marchName == 'Attack') { if (rslt['conquered']==1) h+='<TD><FONT color="#CC0000"><B>Conquered</B></font></td>'; else if (rslt['conquered']==0) h+='<TD><FONT color="#66CC33"><B>Secured</B></font></td>'; } else if (rpt.marchName == 'Reinforce' || rpt.marchName == 'Transport') { h+='<TD align=left width=5%>'+rpt.side1CityName+'<BR />'; if (rpt.side0CityName != '') h+=rpt.side0CityName+'</TD>'; else h+=rpt.side0TileTypeText+' Level '+ rpt.side0TileLevel+'</TD>'; } h+='<TD align=right>' + formatUnixTime(rpt.reportUnixTime,'24hour') + '<BR />Report No: ' + reportId + '</TD></TR></TABLE>'; return h; } function handleunts () { // Troops sent to Reinforce or troops found on a Scout var hunts = '', th = '', tc = '', tf = ''; if (rslt['unts'] != undefined) { if (rpt.marchName == 'Reinforce') th='<TABLE class=ptTab><TR><TH colspan=3 align=left>Troops Reinforced</TH></TR>'; else if (rslt['unts']['u1'] != undefined || rslt['unts']['u2'] != undefined || rslt['unts']['u3'] != undefined || rslt['unts']['u4'] != undefined || rslt['unts']['u5'] != undefined || rslt['unts']['u6'] != undefined || rslt['unts']['u7'] != undefined || rslt['unts']['u8'] != undefined || rslt['unts']['u9'] != undefined || rslt['unts']['u10'] != undefined || rslt['unts']['u11'] != undefined || rslt['unts']['u12'] != undefined) th='<TABLE class=ptTab><TR><TH colspan=3 align=left>Troops Found</TH></TR>'; for (var i=1;i<13;i++) if (rslt['unts']['u'+i] != undefined) tc+='<TR><TD>' + unitImg[i] + '</TD><TD align=right>'+addCommas(rslt['unts']['u'+i])+'</TD></TR>'; tf='</TABLE>'; } if (tc != '') hunts = th + tc + tf; return hunts; } function handlersc () { // Resources brought with reinforcements or found on a Scout var hrsc = '', th = '', tc = '', tf = ''; if (rslt['rsc'] != undefined) { if (rslt['rsc']['r1'] > 0 || rslt['rsc']['r2'] > 0 || rslt['rsc']['r3'] > 0 || rslt['rsc']['r4'] > 0) { if (rpt.marchName == 'Reinforce') th='<TABLE class=ptTab><TR><TH colspan=3 align=left>Goodies Brought</TH></TR>'; else { th='<TABLE class=ptTab><TR><TH colspan=3 align=left>Goodies Found</TH></TR>'; if (rslt['gld'] > 0) tc+='<TR><TD>'+goldImg+'</TD><TD align=right>'+addCommasInt(rslt['gld'])+'</TD></TR>'; } if (rslt['rsc']['r1'] > 0) tc+='<TR><TD>'+foodImg+'</TD><TD align=right>'+addCommasInt(rslt['rsc']['r1'])+'</TD></TR>'; if (rslt['rsc']['r2'] > 0) tc+='<TR><TD>'+woodImg+'</TD><TD align=right>'+addCommasInt(rslt['rsc']['r2'])+'</TD></TR>'; if (rslt['rsc']['r3'] > 0) tc+='<TR><TD>'+stoneImg+'</TD><TD align=right>'+addCommasInt(rslt['rsc']['r3'])+'</TD></TR>'; if (rslt['rsc']['r4'] > 0) tc+='<TR><TD>'+oreImg+'</TD><TD align=right>'+addCommasInt(rslt['rsc']['r4'])+'</TD></TR>'; tf='</TABLE>'; } } if (tc != '') hrsc = th + tc + tf; return hrsc; } function handlefrt () { // Fortifications found on a Scout var hfrt = '', th = '', tc = '', tf = ''; if (rslt['frt'] != 'undefined') { if (rslt['frt']['f53'] != undefined || rslt['frt']['f55'] != undefined || rslt['frt']['f60'] != undefined || rslt['frt']['f61'] != undefined || rslt['frt']['f62'] != undefined) { th='<TABLE class=ptTab><TR><TH colspan=3 align=left>Defenses Found</TH></TR>'; if (rslt['frt']['f53'] != undefined) tc+='<TR><TD>' + unitImg[53] + '</TD><TD align=right>'+addCommas(rslt['frt']['f53'])+'</TD></TR>'; if (rslt['frt']['f55'] != undefined) tc+='<TR><TD>' + unitImg[55] + '</TD><TD align=right>'+addCommas(rslt['frt']['f55'])+'</TD></TR>'; if (rslt['frt']['f60'] != undefined) tc+='<TR><TD>' + unitImg[60] + '</TD><TD align=right>'+addCommas(rslt['frt']['f60'])+'</TD></TR>'; if (rslt['frt']['f61'] != undefined) tc+='<TR><TD>' + unitImg[61] + '</TD><TD align=right>'+addCommas(rslt['frt']['f61'])+'</TD></TR>'; if (rslt['frt']['f62'] != undefined) tc+='<TR><TD>' + unitImg[62] + '</TD><TD align=right>'+addCommas(rslt['frt']['f62'])+'</TD></TR>'; tf='</TABLE>'; } } if (tc != '') hfrt = th + tc + tf; return hfrt; } function handleblds (bType) { var blds = rslt['blds']['b'+bType]; b = '<TR><TD>'; arField = [], firstbld = true; if (bType == 1) b+='Farm'; else if (bType == 2) b+='Sawmill'; else if (bType == 3) b+='Quarry'; else if (bType == 4) b+='Mine'; b+='</TD><TD>'; for (var i=1; i<12; i++) arField[i]=0; for (var i=0; i < blds.length; i++) arField[blds[i]]++ for (var i=11; i>0; i--) { if (arField[i] > 0) { if (firstbld) firstbld = false; else b+=', '; if (arField[i] > 1) b+=arField[i] + ' x '; b+=' ' + i; } } b+='</TD></TR>'; return b; } if (rpt.marchName == 'Reinforce') { t.popReport = new CPopup('pbShowRein', 0, 0, 525, 340, true, function() {clearTimeout (1000);}); m+= '<DIV style="height:285px">'; } else if (rpt.marchName == 'Transport') { t.popReport = new CPopup('pbShowTrans', 0, 0, 525, 240, true, function() {clearTimeout (1000);}); m+= '<DIV style="height:185px">'; } else if (rpt.marchName == 'Scout' && rslt['winner']==1 && rpt.sideId==1){ t.popReport = new CPopup('pbShowOther', 0, 0, 550, 740, true, function() {clearTimeout (1000);}); m+= '<DIV style="max-height:705px; height:705px; overflow-y:scroll">'; } else { t.popReport = new CPopup('pbShowOther', 0, 0, 550, 680, true, function() {clearTimeout (1000);}); m+= '<DIV style="max-height:645px; height:645px; overflow-y:scroll">'; } t.popReport.centerMe (mainPop.getMainDiv()); m+=buildHeader(); if (rpt.marchName == 'Transport') { // Transport m+='<TABLE class=ptTab>'; // Only transports have these in rslt, so handle them here if (parseInt(rslt['gold']) > 0) m+='<TR><TD>'+goldImg+'</TD><TD align=right>'+addCommas(rslt['gold'])+'</TD></TR>'; if (parseInt(rslt['resource1']) > 0) m+='<TR><TD>'+foodImg+'</TD><TD align=right>'+addCommas(rslt['resource1'])+'</TD></TR>'; if (parseInt(rslt['resource2']) > 0) m+='<TR><TD>'+woodImg+'</TD><TD align=right>'+addCommas(rslt['resource2'])+'</TD></TR>'; if (parseInt(rslt['resource3']) > 0) m+='<TR><TD>'+stoneImg+'</TD><TD align=right>'+addCommas(rslt['resource3'])+'</TD></TR>'; if (parseInt(rslt['resource4']) > 0) m+='<TR><TD>'+oreImg+'</TD><TD align=right>'+addCommas(rslt['resource4'])+'</TD></TR>'; m+='</TABLE>'; } m+='<TABLE class=ptTab>'; if ((rslt['winner']==1 && rpt.sideId==0) || (rslt['winner']==0 && rpt.sideId==1)) { if (rpt.marchName == 'Scout') m+='<TR><TD><FONT color="#CC0000"><B>Scouting Failed</B></font></TD></TR>'; else m+='<TR><TD><FONT color="#CC0000"><B>You were defeated</B></font></TD></TR>'; } if (rslt['winner']==0 && rpt.sideId==0) m+='<TR><TD><FONT color="#66CC33"><B>You defended successfully!</B></font></TD></TR>'; if (rslt['winner']==1 && rpt.sideId==1) { if (rpt.marchName == 'Scout') m+='<TR><TD><FONT color="#66CC33"><B>Scouting Report</B></font></TD></TR>'; else m+='<TR><TD><FONT color="#66CC33"><B>You were victorious!</B></font></TD></TR>'; } if (rslt['wall'] != undefined) { if (rslt['wall'] == 100) m+='<TR><TD>Attackers breached the walls.</TD></TR>'; else m+='<TR><TD>Attackers did not breach the walls. The walls are '+rslt['wall']+'% damaged</TD></TR>'; } m+= '</TABLE><BR />'; if (rslt['loot'] != undefined) { m+='<TABLE class=ptTab>'; if (rslt['loot'][0] > 0) m+='<TR><TD>'+goldImg+'</TD><TD align=right>'+addCommas(rslt['loot'][0])+'</TD></TR>'; if (rslt['loot'][1] > 0) m+='<TR><TD>'+foodImg+'</TD><TD align=right>'+addCommas(rslt['loot'][1])+'</TD></TR>'; if (rslt['loot'][2] > 0) m+='<TR><TD>'+woodImg+'</TD><TD align=right>'+addCommas(rslt['loot'][2])+'</TD></TR>'; if (rslt['loot'][3] > 0) m+='<TR><TD>'+stoneImg+'</TD><TD align=right>'+addCommas(rslt['loot'][3])+'</TD></TR>'; if (rslt['loot'][4] > 0) m+='<TR><TD>'+oreImg+'</TD><TD align=right>'+addCommas(rslt['loot'][4])+'</TD></TR>'; if (rslt['loot'][5] != undefined) { for (var crest=1101; crest < 1116; crest++) { if (rslt['loot'][5][crest] == 1) m+='<TR><TD><img width=30 src=http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/items/70/' + crest + '.png></TD><TD colspan=2>' + crestname[crest] + '</TD></TR>'; } } m+='</TABLE><BR />'; } if (rpt.marchName == 'Reinforce') { m+=handleunts(); m+=handlersc(); } if (rpt.marchName == 'Scout' && rslt['winner']==1) { m+='<TABLE class=ptTab width=100%><TR><TD width=50% align=left valign=top>'; m+=handleunts(); m+=handlefrt(); m+=handlersc(); m+='</TD><TD width=50% align=left valign=top>'; m+='<TABLE class=ptTab width=100%>'; if (rslt['lstlgn'] != undefined) { if (!rslt['lstlgn']) m+='<TR><TD>Last Login: Not recorded</TD></TR>'; else m+='<TR><TD>Last Login: ' + formatUnixTime(rslt['lstlgn']) + '</TD></TR>'; } m+='<TR><TD>Marshall Combat: '; if (rslt['knt'] != undefined) m+=rslt['knt']['cbt']; else m+='None'; m+='</TD></TR>'; if (rslt['pop'] != undefined) m+='<TR><TD>Population: ' + addCommas(rslt['pop']) + '</TD></TR>'; if (rslt['hap'] != undefined) m+='<TR><TD>Happiness: ' + addCommas(rslt['hap']) + '</TD></TR></TABLE>'; if (rslt['blds']['b1'] != undefined || rslt['blds']['b2'] != undefined || rslt['blds']['b3'] != undefined || rslt['blds']['b4'] != undefined) { m+='<TABLE class=ptTab><TR><TH colspan=2 align=left>Fields</TH></TR>'; for (var i=1; i<5; i++) if (rslt['blds']['b'+i] != undefined) m+=handleblds(i); m+='</TABLE>'; } if (rslt['tch'] != undefined) { m+='<TABLE class=ptTab><TR><TH colspan=2 align=left>Research</TH></TR>'; for (var tl=1; tl < 17; tl++) if (tl != 7) m+='</TD></TR><TR><TD>'+researchLevels[tl].Name+'</TD><TD align=right>' + rslt['tch']['t'+tl] + '</TD></TR>'; m+='</TABLE>'; } m+='</TD></TR></TABLE>'; } if (rslt['fght'] != undefined){ // not Reinforce or Transport, so we have a table with 2 columns: 1 for Attackers, 1 for Defenders m+='<TABLE class=ptTab width=100%><TR><TD width=50% align=left valign=top>'; m+='<TABLE class=ptTab width=100%>'; m+='<TR><TD colspan=4><B>Attackers</B> ('+rpt.side1Name+')'; if (rslt['winner']==1) m+='<FONT color="#CC0000"><B> Winner</B></FONT>'; m+='</TD></TR>'; if (rpt.marchName == 'Attack' || rpt.marchName == 'Defend') m+='<TR><TD colspan=4>Knight Combat Skill: ' + rslt['s1KCombatLv'] + '</TD></TR>'; m+='<TR><TD colspan=4>Attack Boosted: ' + 100*rslt['s1atkBoost'] + '%</TD></TR>'; m+='<TR><TD colspan=4>Defense Boosted: ' + 100*rslt['s1defBoost'] + '%</TD></TR>'; m+='<TR><TD colspan=4>(<A onclick="ptGotoMap('+ rpt.side1XCoord +','+ rpt.side1YCoord +')">'+ rpt.side1XCoord +','+ rpt.side1YCoord +'</a>) ' + rpt.side1CityName + '</TD></TR>'; if (rslt['fght']["s1"] != undefined) { m+='<TR><TH></TH><TH align=left>Troops</TH><TH align=right>Fought</TH><TH align=right>Survived</TH></TR>'; for (var i=1;i<13;i++) { if (rslt['fght']["s1"]['u'+i] != undefined) { if (rslt['fght']["s1"]['u'+i][0] > rslt['fght']["s1"]['u'+i][1]) { m+='<TR><TD>' + unitImg[i] + '</td>'; m+='<TD align=right>'+addCommas(rslt['fght']["s1"]['u'+i][0])+'</td>'; m+='<TD align=right><FONT color="#CC0000">'+addCommas(rslt['fght']["s1"]['u'+i][1])+'</FONT></td></tr>'; } else { m+='<TR><TD>' + unitImg[i] + '</td>'; m+='<TD align=right>'+addCommas(rslt['fght']["s1"]['u'+i][0])+'</td>'; m+='<TD align=right>'+addCommas(rslt['fght']["s1"]['u'+i][1])+'</td></tr>'; } } } } m+='</TABLE></TD><TD width=50% align=right valign=top>'; m+='<TABLE class=ptTab width=100%>'; m+='<TR><TD colspan=4><B>Defenders</B> ('+rpt.side0Name+')'; if (rslt['winner']==0) m+='<FONT color="#CC0000"><B> Winner</B></FONT>'; m+='</TD></TR>'; if (rpt.marchName == 'Attack' || rpt.marchName == 'Defend') m+='<TR><TD colspan=4>Knight Combat Skill: ' + rslt['s0KCombatLv'] + '</TD></TR>'; if (rslt['s0atkBoost'] != undefined) m+='<TR><TD colspan=4>Attack Boosted: ' + 100*rslt['s0atkBoost'] + '%</TD></TR>'; else m+='<TR><TD colspan=4> </TD></TR>'; if (rslt['s0defBoost'] != undefined) m+='<TR><TD colspan=4>Defense Boosted: ' + 100*rslt['s0defBoost'] + '%</TD></TR>'; else m+='<TR><TD colspan=4> </TD></TR>'; m+='<TR><TD colspan=4>Rounds: ' + rslt['rnds'] + '</TD></TR>'; if (rslt['fght']["s0"] != undefined) { m+='<TR><TH></TH><TH align=left>Troops</TH><TH align=right>Fought</TH><TH align=right>Survived</TH></TR>'; for (var i=1;i<13;i++) { if (rslt['fght']["s0"]['u'+i] != undefined) { if (rslt['fght']["s0"]['u'+i][0] > rslt['fght']["s0"]['u'+i][1]) { m+='<TR><TD>' + unitImg[i] + '</td>'; m+='<TD align=right>'+addCommas(rslt['fght']["s0"]['u'+i][0])+'</td>'; m+='<TD align=right><FONT color="#CC0000">'+addCommas(rslt['fght']["s0"]['u'+i][1])+'</FONT></td></tr>'; } else { m+='<TR><TD>' + unitImg[i] + '</td>'; m+='<TD align=right>'+addCommas(rslt['fght']["s0"]['u'+i][0])+'</td>'; m+='<TD align=right>'+addCommas(rslt['fght']["s0"]['u'+i][1])+'</td></tr>'; } } } for (var i=53;i<=55;i++) { if (rslt['fght']["s0"]['f'+i] != undefined) { if (rslt['fght']["s0"]['f'+i][0] > rslt['fght']["s0"]['f'+i][1]) { m+='<TR><TD>' + unitImg[i] + '</td>'; m+='<TD align=right>'+addCommas(rslt['fght']["s0"]['f'+i][0])+'</td>'; m+='<TD align=right><FONT color="#CC0000">'+addCommas(rslt['fght']["s0"]['f'+i][1])+'</font></td></tr>'; } else { m+='<TR><TD>' + unitImg[i] + '</td>'; m+='<TD align=right>'+addCommas(rslt['fght']["s0"]['f'+i][0])+'</td>'; m+='<TD align=right>'+addCommas(rslt['fght']["s0"]['f'+i][1])+'</td></tr>'; } } } for (var i=60;i<=63;i++) { if (rslt['fght']["s0"]['f'+i] != undefined) { if (rslt['fght']["s0"]['f'+i][0] > rslt['fght']["s0"]['f'+i][1]) { m+='<TR><TD>' + unitImg[i] + '</td>'; m+='<TD align=right>'+addCommas(rslt['fght']["s0"]['f'+i][0])+'</td>'; m+='<TD align=right><FONT color="#CC0000">'+addCommas(rslt['fght']["s0"]['f'+i][1])+'</font></td></tr>'; } else { m+='<TR><TD>' + unitImg[i] + '</td>'; m+='<TD align=right>'+addCommas(rslt['fght']["s0"]['f'+i][0])+'</td>'; m+='<TD align=right>'+addCommas(rslt['fght']["s0"]['f'+i][1])+'</td></tr>'; } } } } else m+='<TR><TD>No Troops Defended</TD></TR>'; m+='</TABLE></TD></TR></TABLE>'; } m+='</DIV>'; t.popReport.getMainDiv().innerHTML = m; t.popReport.getTopDiv().innerHTML = '<DIV align=center><B>'+rpt.marchName+' Report</B></DIV>'; t.popReport.show(true); }, show: function (){ }, hide: function (){ }, }; /*********************************** Alliance TAB ***********************************/ Tabs.Alliance = { tabOrder : 120, myDiv : null, alliancemembers:[], number:0, totalmembers:0, error:false, init : function (div){ var t = Tabs.Alliance; t.myDiv = div; t.myDiv.style.overflowY = 'scroll'; div.style.maxHeight = '500px'; t.totalmembers=0; t.alliancemembers=[]; unsafeWindow.getdetails = t.getMemberDetails; var m = '<DIV class=ptstat>ALLIANCE FUNCTIONS</div><TABLE align=center cellpadding=1 cellspacing=0></table>'; m +='<TABLE class=ptTab><TD width=200px>List Alliance Members</td><TD>Sort by: <select id="searchAlli"><option value="name">Name</options>'; m += '<option value="might">Might</option>'; m += '<option value="login">Last Login</option>'; m += '<option value="cities">Cities</option>'; m += '<option value="position">Position</option>'; m += '<option value="dip">Days in position (dip)</option></select></td>'; m += '<TD><INPUT id=alList type=submit value="List"></td>'; m += '<TD id=progress></td>'; m += '<TR><TD width=200px>Show alliance diplomaties</td><TD><INPUT id=aldiplo type=submit value="List diplomaties"></td></tr></table>'; m+='<DIV class=ptstat>OVERVIEW</div><TABLE align=center cellpadding=1 cellspacing=0></table>'; m += '<TABLE id=alOverviewTab class=alTab><TR align="center"></tr></table>'; t.myDiv.innerHTML = m; document.getElementById('alList').addEventListener('click', function(){ if (!t.searching){ t.totalmembers=0; t.alliancemembers=[]; document.getElementById('alOverviewTab').innerHTML =""; document.getElementById('progress').innerHTML =""; document.getElementById('progress').innerHTML = "Searching..."; document.getElementById('alList').disabled = true; t.error=false; t.fetchAllianceMemberPage(); } }, false); document.getElementById('searchAlli').addEventListener('click', function(){ if (t.alliancemembers!="") { document.getElementById('alOverviewTab').innerHTML =""; t.paintMembers(); } }, false); document.getElementById('aldiplo').addEventListener('click', function(){t.paintDiplomacy();}, false); window.addEventListener('unload', t.onUnload, false); }, paintMembers: function(){ var t = Tabs.Alliance; if (document.getElementById('searchAlli').value == "name") { var sortmembers = t.alliancemembers.sort(function(a, b){ var sortA=a.Name.toLowerCase(), sortB=b.Name.toLowerCase() if (sortA < sortB) return -1 if (sortA > sortB) return 1 return 0 }); } if (document.getElementById('searchAlli').value == "might") { var sortmembers = t.alliancemembers.sort(function(a, b){ var sortA=parseInt(a.Might),sortB=parseInt(b.Might) if (sortA > sortB) return -1 if (sortA < sortB) return 1 return 0 }); } if (document.getElementById('searchAlli').value == "login") { var sortmembers = t.alliancemembers.sort(function(a, b){ var sortA=a.LastLogin,sortB=b.LastLogin if (sortA < sortB) return -1 if (sortA > sortB) return 1 return 0 }); } if (document.getElementById('searchAlli').value == "cities") { var sortmembers = t.alliancemembers.sort(function(a, b){ var sortA=a.Cities,sortB=b.Cities if (sortA < sortB) return -1 if (sortA > sortB) return 1 return 0 }); } if (document.getElementById('searchAlli').value == "dip") { var sortmembers = t.alliancemembers.sort(function(a, b){ var sortA=a.dip,sortB=b.dip if (sortA < sortB) return -1 if (sortA > sortB) return 1 return 0 }); } if (document.getElementById('searchAlli').value == "position") { var sortmembers = t.alliancemembers.sort(function(a, b){ var sortA=a.Position,sortB=b.Position if (sortA < sortB) return -1 if (sortA > sortB) return 1 return 0 }); } for (var y = (sortmembers.length-1); y >=0; y--) { t._addTab(sortmembers[y].Name,sortmembers[y].Might,sortmembers[y].LastLogin,sortmembers[y].Position,sortmembers[y].dip,sortmembers[y].uid,sortmembers[y].fbuid,sortmembers[y].Cities); t.myDiv.style.overflowY = 'scroll'; } t._addTabHeader(); }, _addTab: function(Name,Might,LastLogin,Position,dip,uid,fbuid,Cities){ var t = Tabs.Alliance; var row = document.getElementById('alOverviewTab').insertRow(0); row.vAlign = 'top'; row.insertCell(0).innerHTML ='<A target="_tab" href="http://www.facebook.com/profile.php?id='+ fbuid +'">profile</a>'; row.insertCell(1).innerHTML = Name; var cell2 = row.insertCell(2); cell2.width = "60" ; cell2.align = "right" ; cell2.vAlign = "top"; cell2.innerHTML = addCommas(Might); row.insertCell(3).innerHTML = Cities; row.insertCell(4).innerHTML = officerId2String (Position); row.insertCell(5).innerHTML = dip; row.insertCell(6).innerHTML = LastLogin; }, _addTabHeader: function() { var t = Tabs.Alliance; var row = document.getElementById('alOverviewTab').insertRow(0); row.vAlign = 'top'; row.insertCell(0).innerHTML = "Facebook"; row.insertCell(1).innerHTML = "Name"; row.insertCell(2).innerHTML = "Might"; row.insertCell(3).innerHTML = "Cities"; row.insertCell(4).innerHTML = "Position"; row.insertCell(5).innerHTML = "DIP"; row.insertCell(6).innerHTML = "LastLogin"; }, paintDiplomacy : function () { document.getElementById('alOverviewTab').innerHTML =""; document.getElementById('progress').innerHTML =""; var m= '<TR><TD colspan=4 style=\'background: #33CC66;\' align=center><B>Friendly: </b></td></tr>'; if (Seed.allianceDiplomacies['friendly'] == null) m+='<TR><TD>No Friendlies found...</td>'; else m += '<TABLE class=xtab><TR><TD>Alliance Name</td><TD>Members</td></tr>'; for (k in Seed.allianceDiplomacies['friendly']){ m+='<TR><TD>'+Seed.allianceDiplomacies['friendly'][k]['allianceName']+'</td>'; m+='<TD align=center>'+Seed.allianceDiplomacies['friendly'][k]['membersCount']+'</td>'; } m+='<TR></tr></table>'; m+= '<TR><TD colspan=4 style=\'background: #CC0033;\' align=center><B>Hostile: </b></td></tr>'; if (Seed.allianceDiplomacies['hostile'] == null) m+='<TR><TD>No Hostiles found...</td>'; else m += '<TABLE class=xtab><TR><TD>Alliance Name</td><TD>Members</td></tr>'; for (k in Seed.allianceDiplomacies["hostile"]){ m+='<TR><TD>'+Seed.allianceDiplomacies["hostile"][k]['allianceName']+'</td>'; m+='<TD align=center>'+Seed.allianceDiplomacies["hostile"][k]['membersCount']+'</td>'; } m+='<TR></tr></table>'; m+= '<TR><TD colspan=4 style=\'background: #FF6633;\' align=center><B>Friendly towards us: </b></td></tr>'; if (Seed.allianceDiplomacies['friendlyToYou'] == null) m+='<TR><TD>No Friendlies towards us found...</td>'; else m += '<TABLE class=xtab><TR><TD>Alliance Name</td><TD>Members</td></tr>'; for (k in Seed.allianceDiplomacies["friendlyToYou"]){ m+='<TR><TD>'+Seed.allianceDiplomacies["friendlyToYou"][k]['allianceName']+'</td>'; m+='<TD align=center>'+Seed.allianceDiplomacies["friendlyToYou"][k]['membersCount']+'</td>'; } m+='<TR></tr></table>'; document.getElementById('alOverviewTab').innerHTML = m; }, fetchAllianceMemberPage : function () { var t = Tabs.Alliance; document.getElementById('alList').disabled = true; var params = unsafeWindow.Object.clone(unsafeWindow.g_ajaxparams); params.pf = 0; new AjaxRequest(unsafeWindow.g_ajaxpath + "ajax/allianceGetInfo.php" + unsafeWindow.g_ajaxsuffix, { method: "post", parameters: params, onSuccess: function (transport) { var rslt = eval("(" + transport.responseText + ")"); t.totalmembers = (rslt["allianceInfo"]["members"]); for (var i=1;i<=10;i++) { params.pageNo = i; params.pf = 0; new AjaxRequest(unsafeWindow.g_ajaxpath + "ajax/allianceGetMembersInfo.php" + unsafeWindow.g_ajaxsuffix, { method: "post", parameters: params, onSuccess: function (transport) { var info = eval("(" + transport.responseText + ")"); if (info.ok) { for (var k in info["memberInfo"]){ if ( info["memberInfo"][k]["might"] != undefined && !t.error){ t.alliancemembers.push ({ Name: info["memberInfo"][k]["name"], Might: info["memberInfo"][k]["might"], Cities: info["memberInfo"][k]["cities"], Position : info["memberInfo"][k]["positionType"], dip : info["memberInfo"][k]["daysInPosition"], LastLogin : info["memberInfo"][k]["lastLogin"], uid : info["memberInfo"][k]["userId"], fbuid : info["memberInfo"][k]["fbuid"], }); } document.getElementById('alOverviewTab').innerHTML =""; t.paintMembers(); } if (!t.error) document.getElementById('progress').innerHTML = '(' + (t.alliancemembers.length) +'/'+ t.totalmembers +')'; if ( t.alliancemembers.length >= t.totalmembers) document.getElementById('alList').disabled = false; } else if (info.error) { document.getElementById('alList').disabled = false; document.getElementById('progress').innerHTML = "ERROR!"; t.error=true; } }, onFailure: function (rslt) {; notify ({errorMsg:'AJAX error'}); }, }); } }, onFailure: function (rslt) {; notify ({errorMsg:'AJAX error'}); }, }); }, hide : function (){ mainPop.div.style.width = 750 + 'px'; }, show : function (){ var t = Tabs.Alliance; mainPop.div.style.width = 750 + 'px'; }, }; /*************************************** MARCHES TAB ************************************************/ Tabs.Marches = { tabOrder : 5, cont:null, displayTimer:null, curTabBut : null, curTabName : null, widescreen:true, init : function (div){ var t = Tabs.Marches; unsafeWindow.pr56Recall = t.butRecall; unsafeWindow.r8x6Home = t.butSendHome; unsafeWindow.cancelMarch = t.butcancelmarch; t.cont = div; t.cont.innerHTML = '<TABLE class=ptTab align=center><TR><TD><INPUT class=pbSubtab ID=ptmrchSubA type=submit value=Incoming></td>\ <TD><INPUT class=pbSubtab ID=ptmrchSubM type=submit value=Marches></td>\ <TD><INPUT class=pbSubtab ID=ptmrchSubR type=submit value=Reinforcements></td></tr></table><HR class=ptThin>\ <DIV id=ptMarchOutput style="margin-top:10px; background-color:white; height:680px; overflow:scroll;"></div>'; t.marchDiv = document.getElementById('ptMarchOutput'); document.getElementById('ptmrchSubA').addEventListener('click', e_butSubtab, false); document.getElementById('ptmrchSubR').addEventListener('click', e_butSubtab, false); document.getElementById('ptmrchSubM').addEventListener('click', e_butSubtab, false); changeSubtab (document.getElementById('ptmrchSub'+Options.curMarchTab)); function e_butSubtab (evt){ changeSubtab (evt.target); } function changeSubtab (but){ if (but == t.curTabBut) return; if (t.curTabBut){ t.curTabBut.className='pbSubtab'; t.curTabBut.disabled=false; } t.curTabBut = but; but.className='pbSubtab pbSubtabSel'; but.disabled=true; t.curTabName = but.id.substr(9); Options.curMarchTab = t.curTabName; t.show (); } }, hide : function (){ var t = Tabs.Marches; clearTimeout (t.displayTimer); }, show : function (){ var t = Tabs.Marches; clearTimeout (t.displayTimer); if (t.curTabName == 'R') t.showReinforcements(); else if (t.curTabName == 'M') t.showMarches(); else t.showIncoming(); }, /*** Incoming SUBTAB ***/ showIncoming : function (){ var t = Tabs.Marches; t.marchDiv.innerHTML = null; var z = '<TABLE id=pdincoming cellSpacing=10 width=100% height=0% class=pbTab>'; for (k in Seed.queue_atkinc) { if(Seed.queue_atkinc.length !=0){ var now = unixTime(); var icon, status, FROM, cityname, FROMmight, marchdir, marchtime; var marchType = parseInt(Seed.queue_atkinc[k]["marchType"]); var marchStatus = parseInt(Seed.queue_atkinc[k]["marchStatus"]); for (var i=0; i<Seed.cities.length;i++) { if (Seed.cities[i][0] == Seed.queue_atkinc[k]["toCityId"]) cityname = Seed.cities[i][1]; } if (Seed.queue_atkinc[k]["destinationUnixTime"] < now || marchStatus == 8) marchdir = "returning"; else marchdir = "going"; var destinationUnixTime = Seed.queue_atkinc[k]["arrivalTime"] - now; if(destinationUnixTime > 0) marchtime = timestr(destinationUnixTime, true) else marchtime = 'Arrived'; if (marchType != 3 && marchType !=4){ var player = Seed.players['u'+Seed.queue_atkinc[k]["fromPlayerId"]] FROM = player.n; FROMmight = player.m; } else { for (players in Seed.players){ if (marchType == 3 || marchType == 4){ if (('u'+Seed.queue_atkinc[k]["pid"]) == players){ FROM = Seed.players[players]["n"]; FROMmight = Seed.players[players]["m"]; } } } } if (marchType == 2 && marchStatus == 2) marchType = 102; switch (marchType) { case 1: icon="http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/transporting.jpg";status="Transport";break; case 2: icon="http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/reinforce.jpg";status="Reinforce";break; case 3: icon="http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/scouting.jpg";status="Scout";break; case 4: icon="http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/attacking.jpg";status="Attack";break; case 9: icon="http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/attacking.jpg";status="Attack";break; case 5: icon="http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/transporting.jpg";status="Reassign";break; case 100: icon="http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/returning.jpg";status="Returning";break; case 102: icon="http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/reinforce.jpg";status="Encamped";break; } if(status == 'Encamped') z += '<TD width="10px"><A onclick="r8x6Home('+ Seed.queue_atkinc[k].marchId +')"><img src='+ icon +'></a></td>'; else z += '<TD width="10px"><img src='+ icon +'></td>'; z += '<TD width="40px">'+ status +'</td>'; z += '<TD>' + cityname + '</td>'; z += '<TD>'+ marchtime +'</td>'; z +='<TD>From:' + FROM + '</td>'; z +='<TD>Might:' + addCommas(FROMmight) + '</td>'; if (Seed.queue_atkinc[k]["knt"] != undefined) z +='<TD>Knight:'+ Seed.queue_atkinc[k]["knt"]["cbt"]+'</td>'; if (Seed.queue_atkinc[k]["gold"] > 0) z += '<TD>Gold:'+ addCommas(Seed.queue_atkinc[k]["gold"]) +'</td>'; if (Seed.queue_atkinc[k]["resource1"] > 0) z += '<TD>Food: '+ addCommas(Seed.queue_atkinc[k]["resource1"]) +'</td>'; if (Seed.queue_atkinc[k]["resource2"] > 0) z += '<TD>Wood: '+ addCommas(Seed.queue_atkinc[k]["resource2"]) +'</td>'; if (Seed.queue_atkinc[k]["resource3"] > 0) z += '<TD>Stone: '+ addCommas(Seed.queue_atkinc[k]["resource3"]) +'</td>'; if (Seed.queue_atkinc[k]["resource4"] > 0) z += '<TD>Ore: '+ addCommas(Seed.queue_atkinc[k]["resource4"]) +'</td>'; for(i=1; i<13; i++){ if(Seed.queue_atkinc[k]["unit"+i+"Count"] > 0 && marchdir == "going") z += '<TD>'+ unsafeWindow.unitcost['unt'+i][0] +': '+ addCommas(Seed.queue_atkinc[k]["unit"+i+"Count"]) +'</td>'; if(Seed.queue_atkinc[k]["unit"+i+"Return"] > 0 && marchdir == "returning") z += '<TD>'+ unsafeWindow.unitcost['unt'+i][0] +': '+ addCommas(Seed.queue_atkinc[k]["unit"+i+"Return"]) +'</td>'; } if (marchType == 3) if (Seed.queue_atkinc[k]["unts"]["u3"] > 0) z += '<TD>Scouts: '+ addCommas(Seed.queue_atkinc[k]["unts"]["u3"]) +'</td>'; if (marchType == 4){ for(ui=1; i<13; i++){ if (Seed.queue_atkinc[k]["unts"]["u"+ui] > 0) z += '<TD>'+ unsafeWindow.unitcost['unt'+ui][0] +': '+ addCommas(Seed.queue_atkinc[k]["unts"]["u"+ui]) +'</td>'; } } z += '</tr>'; } } z += '</table>'; t.marchDiv.innerHTML = z; t.displayTimer = setTimeout (t.showIncoming, 500); }, /*** MARCHES SUBTAB ***/ showMarches : function (){ var t = Tabs.Marches; t.marchDiv.innerHTML =null; var updatemarch = Seed.queue_atkp; var m = '<TABLE id=pdmarches cellSpacing=10 width=200px height=0% class=pbTab>'; if (t.widescreen) m += '<TR><TD><INPUT id=Wide type=checkbox checked=true>Widescreen</td>'; else m += '<TR><TD><INPUT id=Wide type=checkbox unchecked=true>Widescreen</td>'; m += '<TD colspan=4><INPUT id=TEST type=submit value="Get Seed"></td></tr>'; m+='</table><TABLE id=pdmarches cellSpacing=10 width=100% height=0% class=pbTab>'; for (var c=0; c< Seed.cities.length;c++) { cityname = Seed.cities[c][1]; cityID = 'city' + Seed.cities[c][0]; number=0; if (Seed.queue_atkp[cityID].length !=0) m+= '<TR><TD colspan=5 style=\'background: #99CCFF;\' align=center><B>' + cityname +': </b></td></tr>'; for (k in Seed.queue_atkp[cityID]){ if (Seed.queue_atkp[cityID].length !=0) { var marchID = new String(k); marchID = marchID.substr(1); var marchType = parseInt(Seed.queue_atkp[cityID][k]["marchType"]); var marchStatus = parseInt(Seed.queue_atkp[cityID][k]["marchStatus"]); var now = unixTime(); cityTo = null; number++; var icon, status, type, cityTo, knight, marchtime; for (var i=0; i<Seed.cities.length;i++) { if (Seed.cities[i][2] == Seed.queue_atkp[cityID][k]["toXCoord"] && Seed.cities[i][3] == Seed.queue_atkp[cityID][k]["toYCoord"]) cityTo = Seed.cities[i][1]; } //for (var i=0; i<Seed.cities.length;i++) { // if (Seed.cities[i][2] == Seed.queue_atkp[cityID][k]["toCityId"]) cityTo = Seed.cities[i][1]; //} var destinationUnixTime = Seed.queue_atkp[cityID][k]["destinationUnixTime"] - now; var returnUnixTime = Seed.queue_atkp[cityID][k]["returnUnixTime"] - now; var encampedUnixTime = now - Seed.queue_atkp[cityID][k]["destinationUnixTime"]; var restingUnixTime = now - Seed.queue_atkp[cityID][k]["returnUnixTime"]; if (Seed.queue_atkp[cityID][k]["destinationUnixTime"] > now) marchtime = timestr(destinationUnixTime, true); else marchtime = timestr(returnUnixTime, true); if (Seed.queue_atkp[cityID][k]["destinationUnixTime"] < now && marchType == 2) marchtime = timestr(encampedUnixTime, true); if (Seed.queue_atkp[cityID][k]["returnUnixTime"] < now && marchType == 9) marchtime = timestr(restingUnixTime, true); if (Seed.queue_atkp[cityID][k]["destinationUnixTime"] < now || marchStatus == 8) type = "returning"; else type = "going"; if(Seed.queue_atkp[cityID][k]["destinationUnixTime"] < now){ if (marchStatus == 8) marchtime = timestr(returnUnixTime, true); if (type =="returning" && marchType == 2 && marchStatus != 2) marchtime = timestr(returnUnixTime, true); if (type =="returning" && marchType == 4 && marchStatus == 2) marchtime = timestr(returnUnixTime, true); if (marchStatus == 2 && marchType !=2) marchtime = timestr(returnUnixTime, true); } if (parseInt(Seed.queue_atkp[cityID][k]["marchType"]) == 4 && marchStatus == 2) marchtime = timestr(destinationUnixTime, true);; if (type =="returning" && marchType != 2) marchType = 8; if (type =="returning" && marchType == 2 && marchStatus == 2) marchType = 102; if (type =="returning" && marchType == 2 && marchStatus != 2) marchType = 8; if (marchStatus == 3) marchType = 103; if (marchStatus == 4) marchType = 104; if (parseInt(Seed.queue_atkp[cityID][k]["marchType"]) == 4 && marchStatus == 2) { marchType = 102; marchtime = timestr(encampedUnixTime, true) } switch (marchType) { case 1: icon="http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/transporting.jpg";status="Transport";break; case 2: icon="http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/reinforce.jpg";status="Reinforce";break; case 3: icon="http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/scouting.jpg";status="Scout";break; case 4: icon="http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/attacking.jpg";status="Attack";break; case 5: icon="http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/transporting.jpg";status="Reassign";break; case 8: icon="http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/returning.jpg";status="Returning";break; case 9: icon="http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/attacking.jpg";status="Raiding";break; case 102: icon="http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/reinforce.jpg";status="Encamped";break; case 103: icon="http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/autoAttack/raid_stopped_desat.png";status="Stopped";break; case 104: icon="http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/autoAttack/raid_resting.png";status="Resting";break; } if (Seed.queue_atkp[cityID][k]["knightId"] !=0){ for (i in Seed.knights[cityID]) { if (i == ("knt" + Seed.queue_atkp[cityID][k]["knightId"]) ) knight = Seed.knights[cityID][i]["combat"]; } } else knight = null; m += '<TR><TD>'+ number +'</td>'; if (status=="Encamped" && !t.isMyself(Seed.queue_atkp[cityID][k].fromPlayerId)) m += '<TD><A onclick="r8x6Home('+ marchID +')"><img src='+ icon +'></a></td>'; else if(status=='Encamped' && t.isMyself(Seed.queue_atkp[cityID][k].fromPlayerId)) m += '<TD><A onclick="pr56Recall('+ marchID +')"><img src='+ icon +'></a></td>'; else if(status=='Returning' || status=="Stopped" || status=="Resting") m += '<TD><img src='+ icon +'></td>'; else m += '<TD><A onclick="cancelMarch('+ marchID +')"><img src='+ icon +'></a></td>'; m += '<TD width="40px">'+ status +'</td>'; m += '<TD>'+ marchtime +'</td>'; if (cityTo == null) m += '<TD style="padding-right:10px;">'+ coordLink(Seed.queue_atkp[cityID][k]["toXCoord"],Seed.queue_atkp[cityID][k]["toYCoord"]) + '</td>'; else m += '<TD style="padding-right:10px;">'+ cityTo +'</td>'; if (knight != null) m += '<TD>K:'+ knight +'</td>'; if (Seed.queue_atkp[cityID][k]["toTileType"] == 11) m+='<TD>Lake Lvl: ' + Seed.queue_atkp[cityID][k]["toTileLevel"] + '</td>'; else if (Seed.queue_atkp[cityID][k]["toTileType"] == 20) m+='<TD>Grassland Lvl: ' + Seed.queue_atkp[cityID][k]["toTileLevel"] + '</td>'; else if (Seed.queue_atkp[cityID][k]["toTileType"] == 30) m+='<TD>Hills Lvl: ' + Seed.queue_atkp[cityID][k]["toTileLevel"] + '</td>'; else if (Seed.queue_atkp[cityID][k]["toTileType"] == 40) m+='<TD>Mountain Lvl: ' + Seed.queue_atkp[cityID][k]["toTileLevel"] + '</td>'; else if (Seed.queue_atkp[cityID][k]["toTileType"] == 50) m+='<TD>Plain Lvl: ' + Seed.queue_atkp[cityID][k]["toTileLevel"] + '</td>'; else if (Seed.queue_atkp[cityID][k]["toCityId"] ==0) m +='<TD>Barb Lvl: '+Seed.queue_atkp[cityID][k]["toTileLevel"]+'</td>'; if (Seed.queue_atkp[cityID][k]["gold"] > 0) m += '<TD>Gold:'+ Seed.queue_atkp[cityID][k]["gold"] +'</td>'; if (Seed.queue_atkp[cityID][k]["resource1"] > 0) m += '<TD>Food: '+ addCommas(Seed.queue_atkp[cityID][k]["resource1"]) +'</td>'; if (Seed.queue_atkp[cityID][k]["resource2"] > 0) m += '<TD>Wood: '+ addCommas(Seed.queue_atkp[cityID][k]["resource2"]) +'</td>'; if (Seed.queue_atkp[cityID][k]["resource3"] > 0) m += '<TD>Stone: '+ addCommas(Seed.queue_atkp[cityID][k]["resource3"]) +'</td>'; if (Seed.queue_atkp[cityID][k]["resource4"] > 0) m += '<TD>Ore: '+ addCommas(Seed.queue_atkp[cityID][k]["resource4"]) +'</td>'; for(i=1; i<13; i++){ if(Seed.queue_atkp[cityID][k]["unit"+i+"Count"] > 0 && type == "going") m += '<TD>'+ unsafeWindow.unitcost['unt'+i][0] +': '+ addCommas(Seed.queue_atkp[cityID][k]["unit"+i+"Count"]) +'</td>'; if(Seed.queue_atkp[cityID][k]["unit"+i+"Return"] > 0 && type == "returning") m += '<TD>'+ unsafeWindow.unitcost['unt'+i][0] +': '+ addCommas(Seed.queue_atkp[cityID][k]["unit"+i+"Return"]) +'</td>'; } m += '</tr>'; } } } m += '</table>'; t.marchDiv.innerHTML = m; if (t.widescreen==false) document.getElementById('ptMarchOutput').style.maxWidth = '740px'; else document.getElementById('ptMarchOutput').style.maxWidth = '1100px'; document.getElementById('Wide').addEventListener('click', function(){ t.widescreen=document.getElementById('Wide').checked; }, false); document.getElementById('TEST').addEventListener('click', function(){ var params = unsafeWindow.Object.clone(unsafeWindow.g_ajaxparams); new AjaxRequest(unsafeWindow.g_ajaxpath + "/fb/e2/src/main_src.php?g=&y=0&n=nan001&l=nl_NL&messagebox=&standalone=0&res=1&iframe=1&lang=en&ts=1304248288.7067&s=250&appBar=" + unsafeWindow.g_ajaxsuffix, { method: "POST", parameters: params, onSuccess: function (rslt) { //rslt = eval("(" + message + ")"); var mainSrcHTMLCode = rslt.responseText; //var mainSrcHTMLCode; // get and set this by pulling in the main_src.php file via AJAX var myregexp = /var seed=\{.*?\};/; var match = myregexp.exec(mainSrcHTMLCode); if (match != null) { result = match[0]; result = result.substr(4); var seed = eval(result); //WinLog.write ("seed @ "+ unixTime() +" ("+ now +")\n\n"+ inspect (seed, 8, 1)); unsafeWindow.document.seed = seed; Seed = seed; unsafeWindow.seed = seed; } }, onFailure: function () { if (notify != null) notify(rslt.errorMsg); }, }); }, false); t.displayTimer = setTimeout (t.showMarches, 500); }, isMyself: function(userID){ if(!Seed.players["u"+userID]) return false; if(Seed.players["u"+userID].n == Seed.player.name) return true; else return false; return false; }, butcancelmarch: function(marchID){ var t = Tabs.Marches; var params = unsafeWindow.Object.clone(unsafeWindow.g_ajaxparams); params.mid = marchID; for (var c=0; c<Cities.numCities; c++){ var que = Seed.queue_atkp['city'+ Cities.cities[c].id]; if (matTypeof(que)=='array') continue; for (k in que){ if (k == 'm'+marchID){ params.cid = Cities.cities[c].id; break; } } } new AjaxRequest(unsafeWindow.g_ajaxpath + "ajax/cancelMarch.php" + unsafeWindow.g_ajaxsuffix, { method: "post", parameters: params, onSuccess: function (rslt) { var march = unsafeWindow.seed.queue_atkp["city" + params.cid]["m" + params.mid]; march.marchStatus = 8; var marchtime = parseInt(march.returnUnixTime) - parseInt(march.destinationUnixTime); var ut = unixTime(); if (unsafeWindow.seed.playerEffects.returnExpire > unixtime()) marchtime *= 0.5 march.returnUnixTime = ut + marchtime; march.destinationUnixTime = ut; march.marchUnixTime = ut - marchtime; if (notify != null) notify(rslt.errorMsg); }, onFailure: function () { if (notify != null) notify(rslt.errorMsg); }, }); }, /*** REINFORCEMENTS SUBTAB ***/ showReinforcements : function (){ var rownum = 0; var names = ['Supply', 'Mil', 'Scout', 'Pike', 'Sword', 'Archer', 'Cav', 'Heavy', 'Wagon', 'Balli', 'Ram', 'Cat']; var t = Tabs.Marches; clearTimeout (t.displayTimer); // TODO FIX: Troops show as encamped even if they are here yet (check destinationUnixTime) /*** var s = 'OUTGOING:<BR>'; for (var c=0; c<Cities.numCities; c++){ var que = Seed.queue_atkp['city'+ Cities.cities[c].id]; if (matTypeof(que)=='array') continue; s += 'City: '+ Cities.cities[c].name + ': <BR>'; for (k in que){ march = que[k]; var mid = k.substr(1); s += mid +' DEST: '+ march.toXCoord +','+ march.toYCoord + ' <INPUT type=submit value="Recall" onclick="pr56Recall('+ mid +')"><BR>' } } t.cont.innerHTML = s; t.displayTimer = setTimeout (t.show, 10000); return; ***/ function clickShowRemaining (){ checkBox = document.getElementById('idCheck2'); if (checkBox.checked) Options.encRemaining = false; else Options.encRemaining = true; t.show (); } enc = {}; numSlots = 0; if (matTypeof(Seed.queue_atkinc) != 'array'){ for (k in Seed.queue_atkinc){ march = Seed.queue_atkinc[k]; if (march.marchType == 2){ ++numSlots; city = march.toCityId; from = march.fromPlayerId; if (!enc[city]) enc[city] = {}; if (!enc[city][from]) enc[city][from] = []; s = {}; s.knight = parseInt (march.knightCombat); s.marchId = k.substr(1); s.troops = []; for (i=1; i<13; i++){ if (Options.encRemaining) s.troops[i] = parseInt (march['unit'+ i +'Return']); else s.troops[i] = parseInt (march['unit'+ i +'Count']); } enc[city][from].push (s); } } } //logit ("enc: "+ inspect (enc, 6, 1)); s = '<div class=ptstat>Showing troops encamped at each of your embassies.</div><BR>'; if (numSlots == 0){ s += '<BR><CENTER><B>No troops encamped.</b></center>'; } else { s += '<STYLE> .tot{background:#f0e0f8;} .city{background:#ffffaa;}</style>'; s += '<TABLE cellspacing=0 width=100%><TR align=right><TD align=left width=16%><B>Player (knight)</b></td>'; for (k=0; k<names.length; k++) s += '<TD width=7%><B>' + names[k] + '</b></td>'; s += '</tr>'; tot = []; for (i=0; i<13; i++) tot[i] = 0; for (c in Cities.cities){ dest = Cities.cities[c].id; if (enc[dest]){ s+= '<TR><TD class=xtab><BR></td></tr>'; s+= '<TR><TD class="city" colspan=13 align=center><B>'+ Cities.cities[c].name +'</b></td></tr>'; for (p in enc[dest]){ try { player = Seed.players['u'+p].n; } catch (err){ player = '???'; } for (m=0; m<enc[dest][p].length; m++){ var march = enc[dest][p][m]; knight = ''; if (march.knight > 0) knight = ' ('+ march.knight +')'; // TODO: Only allow 'send home' if troops are here now (marchStatus = ?) s += '<TR align=right><TD align=left>'+ player + knight +' <A><SPAN onclick="r8x6Home('+ march.marchId +')">X</span></a></td>' for (i=1; i<13; i++){ s += '<TD>'+ march.troops[i] +'</td>'; tot[i] += march.troops[i]; } s += '</tr>'; } } } } s += '<TR><TD colspan=13><BR><BR></td></tr><TR align=right><TD class="tot" align=left><B>TOTALS:</b></td>'; for (i=1; i<13; i++) s+= '<TD class="tot">'+ tot[i] +'</td>'; s += '</tr></table>'; } s += '<BR><BR><INPUT type=CHECKBOX id=idCheck2 '+ (Options.encRemaining?'':' CHECKED ') +'> Show Original Troops'; s += '<BR><BR><DIV style="font-size: 10px">NOTE: You will need to refresh KofC to show new encampments or remaining troops after a battle.</div>'; t.marchDiv.innerHTML = s; checkBox = document.getElementById('idCheck2'); checkBox.addEventListener('click', clickShowRemaining, false); t.displayTimer = setTimeout (t.show, 10000); }, butRecall : function (marchId){ var t = Tabs.Marches; logit ("CANCELLING: "+ marchId); t.ajaxRecall (marchId); }, butSendHome : function (marchId){ var t = Tabs.Marches; //alert("Sent Home march#"+marchId); logit ("SEND HOME: "+ marchId); t.ajaxSendHome (marchId, function(r){t.show(); logit("AJAX RESULT: "+ r)}); }, /*** // not working, returns 'invalid parameters' :( ajaxCancelMarch : function (marchId, notify){ var params = unsafeWindow.Object.clone(unsafeWindow.g_ajaxparams); logit ('ajaxCancelMarch: '+ marchId); for (var c=0; c<Cities.numCities; c++){ var que = Seed.queue_atkp['city'+ Cities.cities[c].id]; if (matTypeof(que)=='array') continue; for (k in que){ if (k == 'm'+marchId){ params.cid = Cities.cities[c].id; params.cityId = Cities.cities[c].id; break; } } } params.marchId = marchId; params.mid = 'm'+ marchId; params.requestType = "CANCEL_MARCH"; new MyAjaxRequest(unsafeWindow.g_ajaxpath + "ajax/cancelMarch.php" + unsafeWindow.g_ajaxsuffix, { method: "post", parameters: params, onSuccess: function (rslt) { if (notify != null) notify(rslt.errorMsg); }, onFailure: function () { if (notify != null) notify(rslt.errorMsg); }, }); }, ***/ ajaxSendHome : function (marchId, notify){ logit ('ajaxSendHome: '+ marchId); var march = Seed.queue_atkinc['m'+ marchId]; if (march == null){ notify ('March not found!'); return; } var params = unsafeWindow.Object.clone(unsafeWindow.g_ajaxparams); params.mid = marchId; params.cid = march.toCityId; params.fromUid = march.fromPlayerId; params.fromCid = march.fromCityId; new MyAjaxRequest(unsafeWindow.g_ajaxpath + "ajax/kickoutReinforcements.php" + unsafeWindow.g_ajaxsuffix, { method: "post", parameters: params, onSuccess: function (rslt) { if (rslt.ok){ var upkeep = 0; for (var i=1; i<13; i++) upkeep += parseInt(march["unit" + i + "Return"]) * parseInt(unsafeWindow.unitupkeeps[i]) unsafeWindow.seed.resources["city"+ march.toCityId].rec1[3] -= upkeep; if (parseInt(march.fromPlayerId) == parseInt(unsafeWindow.tvuid)) { //logit ('FROM ME!'); var mymarch = unsafeWindow.seed.queue_atkp["city" + march.fromCityId]["m" + marchId]; var marchtime = Math.abs(parseInt(mymarch.destinationUnixTime) - parseInt(mymarch.eventUnixTime)); mymarch.returnUnixTime = unixTime() + marchtime; mymarch.marchStatus = 8; } delete unsafeWindow.seed.queue_atkinc["m" + marchId]; if (notify != null) notify(null); } else { if (notify != null) notify(rslt.errorMsg); } }, onFailure: function () { if (notify != null) notify(rslt.errorMsg); }, }); }, /***** for (var b = 1; b < 13; b++) { g += parseInt(e["unit" + b + "Return"]) * parseInt(unitupkeeps[b]) } function kickout_allies(mid, cid, fromUid, fromCid, upkeep) { var params = Object.clone(g_ajaxparams); params.mid = mid; params.cid = cid; params.fromUid = fromUid; params.fromCid = fromCid; new Ajax.Request(g_ajaxpath + "ajax/kickoutReinforcements.php" + g_ajaxsuffix, { method: "post", parameters: params, onSuccess: function(transport) { var rslt = eval("(" + transport.responseText + ")"); if (rslt.ok) { Modal.showAlert(g_js_strings.kickout_allies.troopshome); seed.resources["city" + currentcityid].rec1[3] = parseInt(seed.resources["city" + currentcityid].rec1[3]) - upkeep; Modal.hideModalAll(); if (parseInt(fromUid) == parseInt(tvuid)) { var curmarch = seed.queue_atkp["city" + fromCid]["m" + mid]; var marchtime = Math.abs(parseInt(curmarch.destinationUnixTime) - parseInt(curmarch.eventUnixTime)); curmarch.returnUnixTime = unixtime() + marchtime; curmarch.marchStatus = 8 } delete seed.queue_atkinc["m" + mid] } else { Modal.showAlert(printLocalError((rslt.error_code || null), (rslt.msg || null), (rslt.feedback || null))) } }, onFailure: function() {} }) }; ***/ ajaxRecall : function (marchId, notify){ var params = unsafeWindow.Object.clone(unsafeWindow.g_ajaxparams); for (var c=0; c<Cities.numCities; c++){ var que = Seed.queue_atkp['city'+ Cities.cities[c].id]; if (matTypeof(que)=='array') continue; for (k in que){ if (k == 'm'+marchId){ params.cid = Cities.cities[c].id; break; } } } params.mid = marchId; new MyAjaxRequest(unsafeWindow.g_ajaxpath + "ajax/undefend.php" + unsafeWindow.g_ajaxsuffix, { method: "post", parameters: params, onSuccess: function (rslt) { var march = unsafeWindow.seed.queue_atkp["city" + params.cid]["m" + params.mid]; march.marchStatus = 8; var marchtime = parseInt(march.returnUnixTime) - parseInt(march.destinationUnixTime); var ut = unixTime(); if (unsafeWindow.seed.playerEffects.returnExpire > unixTime()) marchtime *= 0.5 march.returnUnixTime = ut + marchtime; march.destinationUnixTime = ut; march.marchUnixTime = ut - marchtime; if (notify != null) notify(rslt.errorMsg); }, onFailure: function () { if (notify != null) notify(rslt.errorMsg); }, }); }, }; /*******************************************/ var PageNavigator = { modalMessagesFunc : null, ctrlPaginationOld : null, loadPage_paginationOld : null, cpPager : null, init : function (){ var t = PageNavigator; t.modalMessagesFunc = new CalterUwFunc ('modal_messages', [ [/pageNavigatorModel =.*$/im, 'var pager = new ptPagerHook(0,5); pageNavigatorModel=pager'], [/pageNavigatorView =.*$/im, 'pageNavigatorView=pager'], [/pageNavigatorController =.*$/im, 'pageNavigatorController=pager'] ]); unsafeWindow.ptPagerHook = t.Cpager; t.ctrlPaginationOld = unsafeWindow.ctrlPagination; t.loadPage_paginationOld = unsafeWindow.loadPage_pagination; t.cpPager = new t.Cpager (0,0); t.cpPager.oldStyle = true; t.enable(Options.fixPageNav); }, // called on 'back' ... loadPage_pagination : function (divId, currentPage, callbackFunction, totalPages) { var t = PageNavigator; var curPage = parseInt(currentPage); //logit ('loadPage_pagination: '+ divId +','+ t.cpPager.divId +','+ currentPage +','+ callbackFunction +','+ totalPages +','+ t.cpPager.getCurrentPage()); if (divId == t.cpPager.divId) // if 'old' style ... unsafeWindow[callbackFunction] (t.cpPager.getCurrentPage()); else unsafeWindow[callbackFunction] (currentPage); }, ctrlPagination : function (navDivId, numPages, notify, curPage){ var t = PageNavigator; //logit ('ctrlPagination (divid:'+ navDivId +')'); if (document.getElementById(navDivId).firstChild == null) document.getElementById(navDivId).appendChild (t.cpPager.getHtmlElement()); t.cpPager.setPageCount(numPages); t.cpPager.divId = navDivId; if (!curPage) curPage = 1; t.cpPager.gotoPage(curPage); t.cpPager.onClick = unsafeWindow[notify]; unsafeWindow.pageNavigatorView = t.cpPager; }, enable : function (tf){ var t = PageNavigator; t.modalMessagesFunc.setEnable(tf); if (tf){ unsafeWindow.ctrlPagination = t.ctrlPagination; unsafeWindow.loadPage_pagination = t.loadPage_pagination; } else { unsafeWindow.ctrlPagination = t.ctrlPaginationOld; unsafeWindow.loadPage_pagination = t.loadPage_paginationOld; } }, isAvailable : function (){ var t = PageNavigator; return t.modalMessagesFunc.isAvailable(); }, Cpager : function (a, b){ // public function protos ... this.getHtmlElement = getHtmlElement; this.setPageCount = setPageCount; this.getPageCount = getPageCount; this.getCurrentPage = getCurrentPage; this.gotoPage = gotoPage; this.e_but = e_but; this.e_inp = e_inp; // var t = this; this.onClick = null; this.numPages = b; this.curPage = a; this.oldStyle = false; function getHtmlElement (){ function aButton (msg, evtPage){ return '<A class=ptPageNav onclick="pageNavigatorView.e_but(\''+ evtPage +'\')"><SPAN class=ptPageNav>'+ msg +'</span></a>'; } var div = document.createElement ('div'); div.id = 'ptPageNavBar'; div.innerHTML = '<STYLE>table.ptPageNav tr td {border:none; text-align:center; padding:0px 1px;}\ span.ptPageNav {font-size:12px; background:inherit; line-height:135%}\ A.ptPageNav {background-color:#44e; color:#ff4; display:block; border:1px solid #666666; height:18px; width:18px;}\ A.ptPageNav:hover {background-color:#66f;}\ A.ptPageNav:active {background-color:#186}\ </style>\ <TABLE class=ptPageNav><TR valign=middle>\ <TD style="margin-right:15px">'+ aButton('<SPAN style="padding-right:0.8em; letter-spacing:-0.99em;">▏▏◄</span>', 'F') +'</td>\ <TD>'+ aButton('◄', '-') +'</td>\ <TD>'+ aButton('►', '+') +'</td>\ <TD style="margin-right:15px">'+ aButton('<SPAN style="padding-right:1.05em; letter-spacing:-0.99em;">►▕▕</span>', 'L') +'</td>\ <TD width=20></td><TD>Page <INPUT id=ptPagerPageNum onChange="pageNavigatorView.e_inp()" type=text size=1> OF <span id=ptPagerNumPages>?</span></td>\ </tr></table>'; var mml = document.getElementById('modal_msg_list'); if (mml != null) mml.style.minHeight = '320px'; return div; } function getPageCount(){ // koc needs for 'back' return t.numPages; } function getCurrentPage(){ // koc needs for 'back' return t.curPage; } function setPageCount(c){ t.numPages = c; document.getElementById('ptPagerNumPages').innerHTML = c; var mml = document.getElementById('modal_msg_list'); if (mml != null){ if (document.getElementById('modal_msg_tabs_report').className.indexOf('selected') >= 0) mml.style.minHeight = '460px'; else mml.style.minHeight = '320px'; } } function gotoPage(p){ t.curPage = parseIntZero(p); document.getElementById('ptPagerPageNum').value = t.curPage; } function e_but (p){ if (p=='F' && t.curPage!=1) loadPage(1); else if (p=='-' && t.curPage>1) loadPage(t.curPage-1); else if (p=='+' && t.curPage<t.numPages) loadPage(t.curPage+1); else if (p=='L' && t.curPage!=t.numPages) loadPage(t.numPages); function loadPage (p){ if (t.oldStyle) t.gotoPage(p); t.onClick (p); } } function e_inp (p){ var pageNum = parseIntZero(document.getElementById('ptPagerPageNum').value); t.onClick(pageNum); } }, } function addScript (scriptText){ var scr = document.createElement('script'); scr.innerHTML = scriptText; document.body.appendChild(scr); // setTimeout ( function (){document.body.removeChild(scr);}, 500); } addScript ('uwuwuwFunc = function (text){ eval (text); }'); // TODO: Handle multiple instances altering same function!! **************************** var CalterUwFunc = function (funcName, findReplace) { var t = this; this.isEnabled = false; this.isAvailable = isAvailable; this.setEnable = setEnable; this.funcOld = null; this.funcNew = null; try { var x = funcName.split('.'); var f = unsafeWindow; for (var i=0; i<x.length; i++) f = f[x[i]]; ft = f.toString(); this.funcOld = f; var rt = ft.replace ('function '+ funcName, 'function'); for (var i=0; i<findReplace.length; i++){ x = rt.replace(findReplace[i][0], findReplace[i][1]); if (x == rt) // if not found return; rt = x; } this.funcNew = rt; } catch (err) { } function setEnable (tf){ if (t.funcNew == null) return; if (t.isEnabled != tf){ if (tf){ // var scr = document.createElement('script'); // scr.innerHTML = funcName +' = '+ t.funcNew; // document.body.appendChild(scr); // setTimeout ( function (){document.body.removeChild(scr);}, 500); unsafeWindow.uwuwuwFunc(funcName +' = '+ t.funcNew); t.isEnabled = true; } else { var x = funcName.split('.'); var f = unsafeWindow; for (var i=0; i<x.length-1; i++) f = f[x[i]]; f[x[x.length-1]] = this.funcOld; t.isEnabled = false; } } } function isAvailable (){ if (t.funcNew == null) return false; return true; } }; var MessageCounts = { messagesNotifyFunc : null, init : function (){ var t = MessageCounts; if (Options.fixMsgCount){ document.getElementById('chrome_messages_report').style.margin = '10px 0 0 65px'; document.getElementById('chrome_messages_notify').style.margin = '10px 0 0 10px'; } }, } function ShowExtraInfo(){ document.getElementById('kocmain_bottom').innerHTML = 'test'; } var WarnZeroAttack = { modalAttackFunc : null, init : function (){ var t = WarnZeroAttack; t.modalAttackFunc = new CalterUwFunc ('modal_attack', [['modal_attack_check()', 'modalAttack_hook()']]); unsafeWindow.modalAttack_hook = t.hook; t.modalAttackFunc.setEnable(Options.fixWarnZero); }, setEnable : function (tf){ var t = WarnZeroAttack; t.modalAttackFunc.setEnable (tf); }, isAvailable : function (){ var t = WarnZeroAttack; return t.modalAttackFunc.isAvailable(); }, hook : function (){ var t = WarnZeroAttack; if (parseIntZero(document.getElementById('modal_attack_target_coords_x').value) == 0 && parseIntZero(document.getElementById('modal_attack_target_coords_y').value) == 0){ new CdialogCancelContinue ('<SPAN class=boldRed>You are about to march to location 0,0!</span>', null, unsafeWindow.modal_attack_check, document.getElementById('modalInner1')); } else { unsafeWindow.modal_attack_check(); } }, } function distance (d, f, c, e) { var a = 750; var g = a / 2; var b = Math.abs(c - d); if (b > g) b = a - b; var h = Math.abs(e - f); if (h > g) h = a - h; return Math.round(100 * Math.sqrt(b * b + h * h)) / 100; }; var MapDistanceFix = { popSlotsFunc : null, init : function (){ var t = MapDistanceFix; t.popSlotsFunc = new CalterUwFunc ('MapObject.prototype.populateSlots', [['this.distance', 'fixMapDistance_hook']]); if (t.popSlotsFunc.isAvailable()){ unsafeWindow.fixMapDistance_hook = t.fixMapDistance_hook; if (Options.fixMapDistance) t.enable (true); } }, fixMapDistance_hook : function (cityX, cityY, tileX, tileY){ var city = Cities.byID[unsafeWindow.currentcityid]; return distance (city.x, city.y, tileX, tileY); }, enable : function (tf){ var t = MapDistanceFix; t.popSlotsFunc.setEnable (tf); }, isAvailable : function (){ var t = MapDistanceFix; return t.popSlotsFunc.isAvailable(); }, } var tabManager = { tabList : {}, // {name, obj, div} currentTab : null, init : function (mainDiv){ var t = tabManager; var sorter = []; for (k in Tabs){ if (!Tabs[k].tabDisabled){ t.tabList[k] = {}; t.tabList[k].name = k; t.tabList[k].obj = Tabs[k]; if (Tabs[k].tabLabel != null) t.tabList[k].label = Tabs[k].tabLabel; else t.tabList[k].label = k; if (Tabs[k].tabOrder != null) sorter.push([Tabs[k].tabOrder, t.tabList[k]]); else sorter.push([1000, t.tabList[k]]); t.tabList[k].div = document.createElement('div'); } } sorter.sort (function (a,b){return a[0]-b[0]}); var m = '<TABLE cellspacing=0 class=ptMainTab><TR>'; for (var i=0; i<sorter.length; i++) m += '<TD class=spacer></td><TD class=notSel id=pttc'+ sorter[i][1].name +' ><A><SPAN>'+ sorter[i][1].label +'</span></a></td>'; //m += '<TD class=spacer width=90% align=right>'+ Version +' </td></tr></table>'; mainPop.getTopDiv().innerHTML = m; t.currentTab = null; for (k in t.tabList) { if (t.tabList[k].name == Options.currentTab) t.currentTab = t.tabList[k] ; document.getElementById('pttc'+ k).addEventListener('click', this.e_clickedTab, false); var div = t.tabList[k].div; div.style.display = 'none'; div.style.height = '100%'; div.style.maxWidth = '1200px'; div.style.overflowX = 'auto'; mainDiv.appendChild(div); try { t.tabList[k].obj.init(div); } catch (e){ div.innerHTML = "INIT ERROR: "+ e; } } if (t.currentTab == null) t.currentTab = sorter[0][1]; t.setTabStyle (document.getElementById ('pttc'+ t.currentTab.name), true); t.currentTab.div.style.display = 'block'; }, hideTab : function (){ var t = tabManager; t.currentTab.obj.hide(); }, showTab : function (){ var t = tabManager; t.currentTab.obj.show(); }, setTabStyle : function (e, selected){ if (selected){ e.className = 'sel'; } else { e.className = 'notSel'; } }, e_clickedTab : function (e){ var t = tabManager; newTab = t.tabList[e.target.parentNode.parentNode.id.substring(4)]; if (t.currentTab.name != newTab.name){ t.setTabStyle (document.getElementById ('pttc'+ t.currentTab.name), false); t.setTabStyle (document.getElementById ('pttc'+ newTab.name), true); t.currentTab.obj.hide (); t.currentTab.div.style.display = 'none'; t.currentTab = newTab; newTab.div.style.display = 'block'; Options.currentTab = newTab.name; } newTab.obj.show(); }, } function setTabStyle (e, selected){ if (selected){ e.className = 'matTabSel'; } else { e.className = 'matTabNotSel'; } } function clickedTab (e){ who = e.target.id.substring(2); newObj = my[who]; currentObj = my[currentName]; if (currentName != who){ setTabStyle (document.getElementById ('aa'+currentName), false); setTabStyle (document.getElementById ('aa'+who), true); if (currentObj){ currentObj.hide (); currentObj.getContent().style.display = 'none'; } currentName = who; cont = newObj.getContent(); newObj.getContent().style.display = 'block'; } newObj.show(); } function mouseMainTab (me){ if (me.button == 2){ var c = getClientCoords (document.getElementById('main_engagement_tabs')); mainPop.setLocation ({x: c.x+4, y: c.y+c.height}); } } function eventHideShow (){ if (mainPop.toggleHide(mainPop)){ tabManager.showTab(); Options.ptWinIsOpen = true; } else { tabManager.hideTab(); Options.ptWinIsOpen = false; } saveOptions(); } function hideMe (){ if (!Options.ptWinIsOpen) return; mainPop.show (false); tabManager.showTab(); Options.ptWinIsOpen = false; saveOptions(); } function showMe (){ mainPop.show (true); tabManager.showTab(); Options.ptWinIsOpen = true; saveOptions(); } function addMyFunction (func){ // add function to run in our own scope unsafeWindow[func.name] = func; } function addUwFunction (func){ // add function to run in unsafeWindow's scope scr = document.createElement('script'); scr.innerHTML = func.toString(); document.body.appendChild(scr); } function alterUwFunction (funcName, frArray){ try { funcText = unsafeWindow[funcName].toString(); rt = funcText.replace ('function '+funcName, 'function'); for (i=0; i<frArray.length; i++){ x = rt.replace(frArray[i][0], frArray[i][1]); if (x == rt) return false; rt = x; } js = funcName +' = '+ rt; var scr=document.createElement('script'); scr.innerHTML=js; document.body.appendChild(scr); return true; } catch (err) { return false; } } function getResearchLevels () { for (var t=1; t < 17; t++) { if (t != 7) { researchLevels[t] = {}; researchLevels[t].Id = t; researchLevels[t].Name = unsafeWindow.techcost['tch'+t][0].replace (/'/img, '\''); researchLevels[t].Level = parseInt(Seed.tech['tch'+t]); researchLevels[t].NextLevelETA = 0; } } var q; var now = unixTime(); for(var i=0; i<Cities.numCities; i++) { // each city var cityID = 'city'+ Cities.cities[i].id; q = Seed.queue_tch[cityID]; if (q[0] != undefined) researchLevels[parseInt(q[0][0])].NextLevelETA = parseInt(q[0][3]) - now; } } function getTroopDefTrainEstimates (cityID){ var b = Seed.buildings[cityID]; city.numBarracks = 0; city.maxBarracks = 0; city.totLevelsBarracks = 0; city.blacksmithLevel = 0; city.stableLevel = 0; city.workshopLevel = 0; city.wallLevel = 0; for (var j=1; j<33; j++){ if (b['pos'+j]) { var bname = parseInt(b['pos'+j][0]); var blvl = parseInt(b['pos'+j][1]); if (bname==13) { city.numBarracks++; city.totLevelsBarracks += parseInt(blvl); if (blvl>city.maxBarracks) city.maxBarracks=blvl; } if (bname==15) city.blacksmithLevel = blvl; if (bname==16) city.workshopLevel = blvl; if (bname==17) city.stableLevel = blvl; if (bname==19) city.wallLevel = blvl; } } var now = unixTime(); city.marshallCombatScore = 0; var s = Seed.knights[cityID]; if (s) { s = s["knt" + Seed.leaders[cityID].combatKnightId]; if (s){ city.marshallCombatScore = s.combat; if (s.combatBoostExpireUnixtime > now) city.marshallCombatScore *= 1.25; } } city.foremanBasePoliticsScore = 0; var s = Seed.knights[cityID]; if (s) { s = s["knt" + Seed.leaders[cityID].politicsKnightId]; if (s) city.foremanBasePoliticsScore = s.basePolitics; } city.loggingLevel = parseInt(Seed.tech["tch2"]); city.geometryLevel = parseInt(Seed.tech["tch5"]); city.eagleEyesLevel = parseInt(Seed.tech["tch6"]); city.poisonedEdgeLevel = parseInt(Seed.tech["tch8"]); city.metalAlloysLevel = parseInt(Seed.tech["tch9"]); city.featherweightPowderLevel = parseInt(Seed.tech["tch10"]); city.alloyHorseshoesLevel = parseInt(Seed.tech["tch12"]); city.fletchingLevel = parseInt(Seed.tech["tch13"]); city.giantsStrengthLevel = parseInt(Seed.tech["tch16"]); var bm = city.numBarracks + 0.1 * (city.totLevelsBarracks - city.numBarracks); var mf = city.marshallCombatScore/200; var gf = city.geometryLevel/10; var sf = city.stableLevel/10; var wf = city.workshopLevel/10; var isf = bm * (1+mf+gf); var csf = bm * (1+mf+gf+sf); var ssf = bm * (1+mf+gf+sf+wf); var pf = city.foremanBasePoliticsScore/200; var gsf = city.giantsStrengthLevel/10; var dsf = 1+pf+gsf; city.Troop1Time = ((city.maxBarracks > 0)?(50/isf):0); city.Troop2Time = city.Troop1Time/2; city.Troop3Time = ((city.maxBarracks > 1 && city.eagleEyesLevel > 0)?(100/isf):0); city.Troop4Time = ((city.maxBarracks > 1 && city.poisonedEdgeLevel > 0)?(150/isf):0); city.Troop5Time = ((city.maxBarracks > 2 && city.blacksmithLevel > 0 && city.metalAlloysLevel > 0)?(225/isf):0); city.Troop6Time = ((city.maxBarracks > 3 && city.fletchingLevel > 0)?(350/isf):0); city.Troop7Time = ((city.maxBarracks > 4 && city.stableLevel > 0 && city.alloyHorseshoesLevel > 0)?(500/csf):0); city.Troop8Time = ((city.maxBarracks > 6 && city.blacksmithLevel > 4 && city.stableLevel > 4 && city.alloyHorseshoesLevel > 4)?(1500/csf):0); city.Troop9Time = ((city.maxBarracks > 5 && city.stableLevel > 0 && city.workshopLevel > 2 && city.featherweightPowderLevel > 0)?(1000/ssf):0); city.Troop10Time = ((city.maxBarracks > 7 && city.stableLevel > 1 && city.workshopLevel > 4 && city.geometryLevel > 4 && city.fletchingLevel > 5)?(3000/ssf):0); city.Troop11Time = ((city.maxBarracks > 8 && city.blacksmithLevel > 4 && city.stableLevel > 2 && city.workshopLevel > 6 && city.metalAlloysLevel > 7 && city.geometryLevel > 6)?(4500/ssf):0); city.Troop12Time = ((city.maxBarracks > 9 && city.stableLevel > 1 && city.workshopLevel > 8 && city.geometryLevel > 9 && city.fletchingLevel > 9)?(6000/ssf):0); city.Def53Time = ((city.wallLevel > 5 && city.blacksmithLevel > 5 && city.fletchingLevel > 4)?(180/dsf):0); city.Def55Time = ((city.wallLevel > 7 && city.blacksmithLevel > 7 && city.fletchingLevel > 6 && city.geometryLevel > 6)?(135/dsf):0); city.Def60Time = ((city.wallLevel > 3 && city.blacksmithLevel > 3 && city.poisonedEdgeLevel > 1)?(90/dsf):0); city.Def61Time = ((city.wallLevel > 0 && city.metalAlloysLevel > 0)?(30/dsf):0); city.Def62Time = ((city.wallLevel > 1 && city.blacksmithLevel > 1 && city.loggingLevel > 1)?(60/dsf):0); } function setCities(){ var il = unsafeWindow.itemlist; for (var i=1101; i < 1115; i++) crestname[i] = il['i'+i].name getResearchLevels(); Cities.numCities = Seed.cities.length; Cities.cities = []; Cities.byID = {}; for (i=0; i<Cities.numCities; i++){ city = {}; city.idx = i; city.id = parseInt(Seed.cities[i][0]); city.name = Seed.cities[i][1]; city.x = parseInt(Seed.cities[i][2]); city.y = parseInt(Seed.cities[i][3]); city.tileId = parseInt(Seed.cities[i][5]); city.provId = parseInt(Seed.cities[i][4]); getTroopDefTrainEstimates('city'+ city.id); Cities.cities[i] = city; Cities.byID[Seed.cities[i][0]] = city; } } function getCityIdFromXY(x, y) { for(var i=0; i<Cities.numCities; i++) { if (Cities.cities[i].x == x && Cities.cities[i].y == y) { return Cities.cities[i].id; } } return -1; } function officerId2String (oid){ if (oid==null) return ''; else if (oid==3) return 'Officer'; else if (oid==2) return 'Vice Chance'; else if (oid==1) return 'Chancellor'; else if (oid==4) return 'Member'; return ''; } function estimateTroopETA (dist, cityId, troopId, fhFlag) { // Need Relief Station Levels to estimate transport, reinf, or reassign times. var ret = {ETAstr: '', hsec: 0, fsec: 0}; if (dist < 0.1 || parseInt(troopId) == 0) { ret.ETAstr = 'No ETA'; } else { var baseSpeed = unsafeWindow.unitstats['unt'+troopId][3]; var mmLvl = parseInt(Seed.tech.tch11);//Magical Mapping var Speed; if (troopId > 6) { // HorsesSiegeSpeed = Base * (1 + MM/10) * (1 + AH/20) var hsLvl = parseInt(Seed.tech.tch12);//Alloy Horse Shoes Speed = baseSpeed * (1.0 + 0.1*mmLvl) * (1.0 + 0.05*hsLvl); } else { //FootSpeed = Base * (1 + MM/10) Speed = baseSpeed * (1 + 0.1*mmLvl); } var gSpeed = Speed / 6000; // Grid Speed (tiles/second) = Speed (100ths/min) / 6000 ret.hsec = (30 + dist/gSpeed).toFixed(0); if (fhFlag == 'FH' || fhFlag == 'H') { ret.ETAstr = 'Attack ETA: <B>' + timestr(ret.hsec, 1) +'</B>'; } if (cityId > -1) { var building = getCityBuilding (cityId, 18); if (building) { fSpeed = Speed * (1 + parseInt(building.maxLevel)/2); gSpeed = fSpeed/6000; ret.fsec = (30 + dist/gSpeed).toFixed(0); var friendTimestr = 'Friendly ETA: <B>' + timestr(ret.fsec, 1) +'</B>'; if (fhFlag == 'F') ret.ETAstr = friendTimestr; else if (fhFlag == 'FH') ret.ETAstr = friendTimestr + ', ' + ret.ETAstr; } } } return ret; } function formatUnixTime (unixTimeString,format){ var rtn = unsafeWindow.formatDateByUnixTime (unixTimeString); /*if (format=='24hour') { if (rtn.substr(14,2)=='AM') rtn = rtn.substr(0,13); else rtn = rtn.substr(8,2)+' '+rtn.substr(0,8)+(parseInt(rtn.substr(8,2))+12)+rtn.substr(10,3); } */ return rtn; } // onClick (city{name, id, x, y}, x, y) city may be null! function CdispCityPicker (id, span, dispName, notify, selbut){ function CcityButHandler (t){ var that = t; this.clickedCityBut = clickedCityBut; function clickedCityBut (e){ if (that.selected != null) that.selected.className = "ptcastleBut ptcastleButNon"; that.city = Cities.cities[e.target.id.substr(that.prefixLen)]; if (that.dispName) document.getElementById(that.id+'cname').innerHTML = that.city.name; e.target.className = "ptcastleBut ptcastleButSel"; that.selected = e.target; if (that.coordBoxX){ that.coordBoxX.value = that.city.x; that.coordBoxY.value = that.city.y; that.coordBoxX.style.backgroundColor = '#ffffff'; that.coordBoxY.style.backgroundColor = '#ffffff'; } if (that.notify != null) that.notify(that.city, that.city.x, that.city.y); } } function selectBut (idx){ document.getElementById(this.id+'_'+idx).click(); } function bindToXYboxes (eX, eY){ function CboxHandler (t){ var that = t; this.eventChange = eventChange; if (that.city){ eX.value = that.city.x; eY.value = that.city.y; } function eventChange (){ var xValue=that.coordBoxX.value.trim(); var xI=/^\s*([0-9]+)[\s,]+([0-9]+)/.exec(xValue); if(xI) { that.coordBoxX.value=xI[1] that.coordBoxY.value=xI[2] } var x = parseInt(that.coordBoxX.value, 10); var y = parseInt(that.coordBoxY.value, 10); if (isNaN(x) || x<0 || x>750){ that.coordBoxX.style.backgroundColor = '#ff8888'; return; } if (isNaN(y) || y<0 || y>750){ that.coordBoxY.style.backgroundColor = '#ff8888'; return; } that.coordBoxX.style.backgroundColor = '#ffffff'; that.coordBoxY.style.backgroundColor = '#ffffff'; if (that.notify != null) that.notify (null, x, y); } } this.coordBoxX = eX; this.coordBoxY = eY; var bh = new CboxHandler(this); eX.size=2; eX.maxLength=10; eY.size=2; eY.maxLength=3; eX.addEventListener('change', bh.eventChange, false); eY.addEventListener('change', bh.eventChange, false); } this.selectBut = selectBut; this.bindToXYboxes = bindToXYboxes; this.coordBoxX = null; this.coordBoxY = null; this.id = id; this.dispName = dispName; this.prefixLen = id.length+1; this.notify = notify; this.selected = null; this.city = null; var m = ''; for (var i=0; i<Cities.cities.length; i++) m += '<INPUT class="ptcastleBut ptcastleButNon" id="'+ id +'_'+ i +'" value="'+ (i+1) +'" type=submit \>'; if (dispName) m += ' <SPAN style="display:inline-block; width:85px; font-weight:bold;" id='+ id +'cname' +'></span>'; span.innerHTML = m; var handler = new CcityButHandler(this); for (var i=0; i<Cities.cities.length; i++) document.getElementById (id+'_'+i).addEventListener('click', handler.clickedCityBut, false); if (selbut != null) this.selectBut(selbut); }; function CdialogCancelContinue (msg, canNotify, contNotify, centerElement){ var pop = new CPopup ('ptcancont', 0, 0, 400,200, true, canNotify); if (centerElement) pop.centerMe(centerElement); else pop.centerMe(document.body); pop.getTopDiv().innerHTML = '<CENTER>KOC Power Tools</center>'; pop.getMainDiv().innerHTML = '<TABLE class=ptTab align=center style="height: 100%"><TR align=center height=90%><TD>'+ msg +'</td></tr>\ <TR align=center><TD><INPUT id=ptcccancel type=submit value="CANCEL" \> <INPUT id=ptcccontin type=submit value="CONTINUE" \></td></tr></table>'; document.getElementById('ptcccancel').addEventListener ('click', function (){pop.show(false); if (canNotify) canNotify();}, false); document.getElementById('ptcccontin').addEventListener ('click', function (){pop.show(false); if (contNotify) contNotify();}, false); pop.show(true); } // TODO: make class (multiple instances needed) function dialogRetry (errMsg, seconds, onRetry, onCancel){ seconds = parseInt(seconds); var pop = new CPopup ('ptretry', 0, 0, 400,200, true); pop.centerMe(mainPop.getMainDiv()); pop.getTopDiv().innerHTML = '<CENTER>KOC Power Tools</center>'; pop.getMainDiv().innerHTML = '<CENTER><BR><FONT COLOR=#550000><B>An error has ocurred:</b></font><BR><BR><DIV id=paretryErrMsg></div>\ <BR><BR><B>Automatically retrying in <SPAN id=paretrySeconds></b></span> seconds ...<BR><BR><INPUT id=paretryCancel type=submit value="CANCEL Retry" \>'; document.getElementById('paretryCancel').addEventListener ('click', doCancel, false); pop.show(true); document.getElementById('paretryErrMsg').innerHTML = errMsg; document.getElementById('paretrySeconds').innerHTML = seconds; var rTimer = setTimeout (doRetry, seconds*1000); countdown (); function countdown (){ document.getElementById('paretrySeconds').innerHTML = seconds--; if (seconds > 0) cdTimer = setTimeout (countdown, 1000); } function doCancel(){ clearTimeout (rTimer); clearTimeout (cdTimer); pop.destroy(); onCancel (); } function doRetry (){ clearTimeout (rTimer); clearTimeout (cdTimer); pop.show(false); onRetry(); } } function implodeUrlArgs (obj){ var a = []; for (var k in obj) a.push (k +'='+ encodeURI(obj[k]) ); return a.join ('&'); } // NOTE: args can be either a string which will be appended as is to url or an object of name->values function addUrlArgs (url, args){ if (!args) return url; if (url.indexOf('?') < 0) url += '?'; else if (url.substr(url.length-1) != '&') url += '&'; if (matTypeof(args == 'object')) return url + implodeUrlArgs (args); return url + args; } // emulate protoype's Ajax.Request ... function AjaxRequest (url, opts){ var headers = { 'X-Requested-With': 'XMLHttpRequest', 'X-Prototype-Version': '1.6.1', 'Accept': 'text/javascript, text/html, application/xml, text/xml, */*' }; var ajax = null; if (DEBUG_TRACE_AJAX) logit ("AJAX: "+ url +"\n" + inspect (opts, 3, 1)); if (window.XMLHttpRequest) ajax=new XMLHttpRequest(); else ajax=new ActiveXObject("Microsoft.XMLHTTP"); if (opts.method==null || opts.method=='') method = 'GET'; else method = opts.method.toUpperCase(); if (method == 'POST'){ headers['Content-type'] = 'application/x-www-form-urlencoded; charset=UTF-8'; } else if (method == 'GET'){ addUrlArgs (url, opts.parameters); } ajax.onreadystatechange = function(){ // ['Uninitialized', 'Loading', 'Loaded', 'Interactive', 'Complete']; states 0-4 if (ajax.readyState==4) { if (ajax.status >= 200 && ajax.status < 305) if (opts.onSuccess) opts.onSuccess(ajax); else if (opts.onFailure) opts.onFailure(ajax); } else { if (opts.onChange) opts.onChange (ajax); } } ajax.open(method, url, true); // always async! for (var k in headers) ajax.setRequestHeader (k, headers[k]); if (matTypeof(opts.requestHeaders)=='object') for (var k in opts.requestHeaders) ajax.setRequestHeader (k, opts.requestHeaders[k]); if (method == 'POST'){ var a = []; for (k in opts.parameters) a.push (k +'='+ opts.parameters[k] ); ajax.send (a.join ('&')); } else { ajax.send(); } } function MyAjaxRequest (url, o, noRetry){ if (DEBUG_TRACE) logit (" 0 myAjaxRequest: "+ url +"\n" + inspect (o, 2, 1)); var opts = unsafeWindow.Object.clone(o); var wasSuccess = o.onSuccess; var wasFailure = o.onFailure; var retry = 0; var delay = 5; var noRetry = noRetry===true?true:false; opts.onSuccess = mySuccess; opts.onFailure = myFailure; if (DEBUG_TRACE) logit (" 1a myAjaxRequest: "+ url +"\n" + inspect (o, 2, 1)); new AjaxRequest(url, opts); return; function myRetry(){ ++retry; new AjaxRequest(url, opts); delay = delay * 1.25; } function myFailure(){ var o = {}; if (DEBUG_TRACE) logit ("myAjaxRequest.myFailure(): "+ inspect(rslt, 1, 1)); o.ok = false; o.errorMsg = "AJAX Communication Failure"; wasFailure (o); } function mySuccess (msg){ var rslt = eval("(" + msg.responseText + ")"); var x; if (rslt.ok){ if (DEBUG_TRACE) logit (" 1b myAjaxRequest.mySuccess(): "+ inspect(rslt, 1, 1)); rslt.errorMsg = null; ///// !!!!!!!!!!!!! ************ if (rslt.updateSeed) unsafeWindow.update_seed(rslt.updateSeed); wasSuccess (rslt); return; } if (DEBUG_TRACE) logit (" 1b myAjaxRequest.mySuccess() !ok : "+ inspect(rslt, 3, 1)); rslt.errorMsg = unsafeWindow.printLocalError((rslt.error_code || null), (rslt.msg || null), (rslt.feedback || null)); /*if ( (x = rslt.errorMsg.indexOf ('<br><br>')) > 0) rslt.errorMsg = rslt.errorMsg.substr (0, x-1);*/ if (!noRetry && (rslt.error_code==0 ||rslt.error_code==8 || rslt.error_code==1 || rslt.error_code==3)){ dialogRetry (rslt.errorMsg, delay, function(){myRetry()}, function(){wasSuccess (rslt)}); } else { wasSuccess (rslt); } } } // returns: 'neutral', 'friendly', or 'hostile' function getDiplomacy (aid) { if (Seed.allianceDiplomacies == null) return 'neutral'; if (Seed.allianceDiplomacies.friendly && Seed.allianceDiplomacies.friendly['a'+aid] != null) return 'friendly'; if (Seed.allianceDiplomacies.hostile && Seed.allianceDiplomacies.hostile['a'+aid] != null) return 'hostile'; if (aid == Seed.allianceDiplomacies.allianceId) return 'ally'; return 'neutral'; }; function getMyAlliance (){ if (Seed.allianceDiplomacies==null || Seed.allianceDiplomacies.allianceName==null) return [0, 'None']; else return [Seed.allianceDiplomacies.allianceId, Seed.allianceDiplomacies.allianceName]; } // TODO: Check times for expired marches !?!?! // note: unselected city has outdated info function getMarchInfo (){ var ret = {}; ret.marchUnits = []; ret.returnUnits = []; ret.resources = []; for (i=0; i<13; i++){ ret.marchUnits[i] = 0; ret.returnUnits[i] = 0; } for (i=0; i<5; i++){ ret.resources[i] = 0; } var now = unixTime(); for(i=0; i<Cities.numCities; i++) { // each city cityID = 'city'+ Cities.cities[i].id; for (k in Seed.queue_atkp[cityID]){ // each march march = Seed.queue_atkp[cityID][k]; if (typeof (march) == 'object'){ for (ii=0; ii<13; ii++){ ret.marchUnits[ii] += parseInt (march['unit'+ ii +'Count']); ret.returnUnits[ii] += parseInt (march['unit'+ ii +'Return']); } for (ii=1; ii<5; ii++){ ret.resources[ii] += parseInt (march['resource'+ ii]); } ret.resources[0] += parseInt (march['gold']); } // TODO: fixup completed marches // TODO: Assume transport is complete ? } } return ret; } function getTrainInfo (){ var ret = {}; ret.trainUnts = []; for (i=0; i<13; i++){ ret.trainUnts[i] = 0; } var q = Seed.queue_unt; for(i=0; i<Cities.numCities; i++) { // each city cityID = 'city'+ Cities.cities[i].id; q = Seed.queue_unt[cityID]; if (q && q.length>0){ for (qi=0; qi<q.length; qi++) ret.trainUnts[q[qi][0]] += parseInt(q[qi][1]); } } return ret; } var fortNamesShort = { 53: "Crossbows", 55: "Trebuchet", 60: "Trap", 61: "Caltrops", 62: "Spiked Barrier", } // returns {count, maxlevel} function getCityBuilding (cityId, buildingId){ var b = Seed.buildings['city'+cityId]; var ret = {count:0, maxLevel:0}; for (var i=1; i<33; i++){ if (b['pos'+i] && b['pos'+i][0] == buildingId){ ++ret.count; if (parseInt(b['pos'+i][1]) > ret.maxLevel) ret.maxLevel = parseInt(b['pos'+i][1]); } } return ret; } // example: http://www150.kingdomsofcamelot.com function GetServerId() { var m=/^[a-zA-Z]+([0-9]+)\./.exec(document.location.hostname); if(m) return m[1]; return ''; } function logit (msg){ var serverID = GetServerId(); var now = new Date(); GM_log (serverID +' @ '+ now.toTimeString().substring (0,8) +'.' + now.getMilliseconds() +': '+ msg); } /************ DEBUG WIN *************/ var debugWin = { popDebug : null, dbDefaultNot : 'tech,tutorial,items,quests,wilderness,wildDef,buildings,knights,allianceDiplomacies,appFriends,players', dbSelect : {}, doit : function (){ var t = debugWin; function syncBoxes (){ var div = document.getElementById('dbpoplist'); for (var i=0; i<div.childNodes.length; i++){ if (div.childNodes[i].type && div.childNodes[i].type=='checkbox'){ var name=div.childNodes[i].name.substr(6); div.childNodes[i].checked = t.dbSelect[name]; } } } function clickedAll (){ for (var k in t.dbSelect) t.dbSelect[k] = true; syncBoxes(); } function clickedNone (){ for (var k in t.dbSelect) t.dbSelect[k] = false; syncBoxes(); } function clickedDefaults (){ for (k in t.dbSelect) t.dbSelect[k] = true; var not = t.dbDefaultNot.split(','); for (var i=0; i<not.length; i++) t.dbSelect[not[i]] = false; syncBoxes(); } function clickedShow (){ var now = new Date(); var myseed = unsafeWindow.Object.clone (Seed); var div = document.getElementById('dbpoplist'); for (var i=0; i<div.childNodes.length; i++){ if (div.childNodes[i].type && div.childNodes[i].type=='checkbox'){ var name=div.childNodes[i].name.substr(6); if (!div.childNodes[i].checked) delete myseed[name]; } } WinLog.write ("seed @ "+ unixTime() +" ("+ now +")\n\n"+ inspect (myseed, 8, 1)); myseed=null; } function clickedShowScripts (){ var scripts = document.getElementsByTagName('script'); for (var i=0; i<scripts.length; i++){ if (scripts[i].src!=null && scripts[i].src!='') WinLog.write ('<A TARGET=_tab HREF="'+ scripts[i].src +'">'+ scripts[i].src +'</a>'); } } if (t.popDebug == null){ t.popDebug = new CPopup ('db', 0, 0, 400,500, true); t.popDebug.getTopDiv().innerHTML = 'DEBUG'; t.popDebug.getMainDiv().innerHTML = '<DIV><INPUT type=submit id=dbsuball value=ALL> <INPUT type=submit id=dbsubnone value=NONE> \ <INPUT type=submit id=dbdefaults value=DEFAULTS> <INPUT type=submit id=dbsubdo value=SHOW> <INPUT type=submit id=dbsubscripts value=SCRIPTS></div>\ <DIV id=dbpoplist style="max-height:400px; height:400px; overflow-y:auto"></div>'; var div = document.getElementById('dbpoplist'); for (var k in Seed) t.dbSelect[k] = true; var not = t.dbDefaultNot.split(','); for (var i=0; i<not.length; i++) t.dbSelect[not[i]] = false; var m = []; for (k in t.dbSelect){ m.push ('<INPUT type=checkbox '); m.push ('name="dbpop_'); m.push (k); m.push ('"> '); m.push (k); m.push ('<BR>'); } div.innerHTML = m.join (''); document.getElementById('dbsuball').addEventListener('click', clickedAll, false); document.getElementById('dbsubnone').addEventListener('click', clickedNone, false); document.getElementById('dbdefaults').addEventListener('click', clickedDefaults, false); document.getElementById('dbsubdo').addEventListener('click', clickedShow, false); document.getElementById('dbsubscripts').addEventListener('click', clickedShowScripts, false); syncBoxes(); } t.popDebug.show (true); }, } function saveOptions (){ var serverID = GetServerId(); GM_setValue ('Options_'+serverID, JSON2.stringify(Options)); } function readOptions (){ var serverID = GetServerId(); s = GM_getValue ('Options_'+serverID); if (s != null){ opts = JSON2.parse (s); for (k in opts) Options[k] = opts[k]; } } /*** ***/ var myServers = { // incomplete, untested serverlist : null, get : function (notify){ if (myServers.serverlist){ notify (myServers.serverlist); return; } var params = unsafeWindow.Object.clone(unsafeWindow.g_ajaxparams); new MyAjaxRequest(unsafeWindow.g_ajaxpath + "ajax/myServers.php" + unsafeWindow.g_ajaxsuffix, { method: "post", parameters: params, onSuccess: function(rslt) { logit (inspect (rslt, 3, 1)); if (notify) notify (myServers.serverlist); }, onFailure: function(rslt) { } }); }, }; function createButton (label){ var a=document.createElement('a'); a.className='button20'; a.innerHTML='<span style="color: #ff6">'+ label +'</span>'; return a; } function AddMainTabLink(text, eventListener, mouseListener) { var a = createButton (text); a.className='tab'; var tabs=document.getElementById('main_engagement_tabs'); if(!tabs) { tabs=document.getElementById('topnav_msg'); if (tabs) tabs=tabs.parentNode; } if (tabs) { var e = tabs.parentNode; var gmTabs = null; for (var i=0; i<e.childNodes.length; i++){ var ee = e.childNodes[i]; //if (ee.tagName=='DIV') logit ("CHILD: "+ ee.tagName +' : '+ ee.className+' : '+ ee.id); if (ee.tagName && ee.tagName=='DIV' && ee.className=='tabs_engagement' && ee.id!='main_engagement_tabs'){ gmTabs = ee; break; } } if (gmTabs == null){ gmTabs = document.createElement('div'); gmTabs.className='tabs_engagement'; gmTabs.style.background='#ca5'; tabs.parentNode.insertBefore (gmTabs, tabs); gmTabs.style.whiteSpace='nowrap'; gmTabs.style.width='735px'; gmTabs.lang = 'en_PT'; } if (gmTabs.firstChild) gmTabs.insertBefore (a, gmTabs.firstChild); else gmTabs.appendChild(a); a.addEventListener('click',eventListener, false); if (mouseListener != null) a.addEventListener('mousedown',mouseListener, true); return a; } return null; } function coordLink (x, y){ var m = []; m.push ('(<a onclick="ptGotoMapHide ('); m.push (x); m.push (','); m.push (y); m.push ('); return false">'); m.push (x); m.push (','); m.push (y); m.push ('</a>)'); return m.join(''); } unsafeWindow.ptGotoMapHide = function (x, y){ try { unsafeWindow.Modal.hideModal(); } catch (e){ } try { Modal.hideModal(); } catch (e){ } unsafeWindow.ptGotoMap (x, y); } unsafeWindow.ptGotoMap = function (x, y){ if (Options.hideOnGoto) hideMe (); setTimeout (function (){ document.getElementById('mapXCoor').value = x; document.getElementById('mapYCoor').value = y; unsafeWindow.reCenterMapWithCoor(); var a = document.getElementById("mod_views").getElementsByTagName("a"); for (var b = 0; b < a.length; b++) { a[b].className = "" } document.getElementById('mod_views_map').className = "sel"; document.getElementById("maparea_city").style.display = 'none'; document.getElementById("maparea_fields").style.display = 'none'; document.getElementById("maparea_map").style.display = 'block'; unsafeWindow.tutorialClear() }, 0); }; unsafeWindow.PTscout = function (x, y){ setTimeout (function (){ if (Options.hideOnGoto) hideMe (); document.getElementById('mapXCoor').value = x; document.getElementById('mapYCoor').value = y; unsafeWindow.reCenterMapWithCoor(); unsafeWindow.changeview_map(document.getElementById('mod_views_map')); unsafeWindow.modal_attack(3,x,y); }, 0); }; /**********************************************************************************/ function makeButton20 (label){ var a = document.createElement('a'); a.className = "button20 ptButton20"; var s = document.createElement('span'); s.innerHTML = label; a.appendChild (s); return a; } function strButton20 (label, tags){ if (tags == null) tags = ''; return ('<TABLE class=ptNoPad><TR><TD><A class="button20 ptButton20" '+ tags +'><SPAN>'+ label +'</span></a></td></tr></table>' ); } function strButton14 (label, tags){ if (tags == null) tags = ''; return ('<A class="button14 ptButton20" '+ tags +'><SPAN>'+ label +'</span></a>' ); } function cityStatusString (cs){ if (cs==4) return 'V'; if (cs==3) return 'T'; if (cs==2) return 'BP'; return 'N'; } // Simple method, as if it were typed in thru DOM function sendChat (msg){ document.getElementById ("mod_comm_input").value = msg; unsafeWindow.Chat.sendChat (); } // works well, but message is not echoed back to local client Chat = { params : null, sendWhisper : function (msg, who, notify){ this.params = unsafeWindow.Object.clone(unsafeWindow.g_ajaxparams); this.params.ctype = 3; this.params.name = who; this._sendit (msg, notify); }, sendGlobal : function (msg, notify){ this.params = unsafeWindow.Object.clone(unsafeWindow.g_ajaxparams); this.params.ctype = 1; this._sendit (msg, notify); }, sendAlliance : function (msg, notify){ this.params = unsafeWindow.Object.clone(unsafeWindow.g_ajaxparams); this.params.ctype = 2; this._sendit (msg, notify); }, _sendit : function (msg, notify){ function strip(s) { return s.replace(/^\s+/, '').replace(/\s+$/, ''); } this.params.comment = strip (msg); new MyAjaxRequest(unsafeWindow.g_ajaxpath + "ajax/sendChat.php" + unsafeWindow.g_ajaxsuffix, { method: "post", parameters: this.params, onSuccess: function(transport) { if (notify) notify (); }, onFailure: function(transport) { if (notify) notify (); } }); }, } function doDefTrain (cityId, unitId, num, notify){ var time = unsafeWindow.modal_walls_traintime(unitId, num); var params = unsafeWindow.Object.clone(unsafeWindow.g_ajaxparams); params.cid = cityId; params.type = unitId; params.quant = num; params.items = 0; new MyAjaxRequest(unsafeWindow.g_ajaxpath + "ajax/fortify.php" + unsafeWindow.g_ajaxsuffix, { method: "post", parameters: params, onSuccess: function (rslt) { if (rslt.ok) { unsafeWindow.seed.queue_fort["city" + cityId].push([unitId, num, rslt.initTS, parseInt(rslt.initTS) + time, 0, time, rslt.fortifyId]); if (notify != null) setTimeout (function (){notify(null);}, 500); } else { if (notify != null) setTimeout (function (){notify(rslt.errorMsg);}, 500); } }, onFailure: function () { if (notify != null) notify(rslt.errorMsg); }, }); } function doTrain (cityId, tut, unitId, num, notify){ var time = unsafeWindow.modal_barracks_traintime(unitId, num); var params = unsafeWindow.Object.clone(unsafeWindow.g_ajaxparams); params.cid = cityId; params.type = unitId; params.quant = num; params.items = tut; new MyAjaxRequest(unsafeWindow.g_ajaxpath + "ajax/train.php" + unsafeWindow.g_ajaxsuffix, { method: "post", parameters: params, onSuccess: function(rslt) { if (rslt.ok) { for (var i = 1; i < 5; i++) { unsafeWindow.seed.resources["city" + cityId]["rec" + i][0] = parseInt(unsafeWindow.seed.resources["city" + cityId]["rec" + i][0]) - parseInt(unsafeWindow.unitcost["unt" + unitId][i]) * 3600 * parseInt(num) } unsafeWindow.seed.citystats["city" + cityId].gold[0] = parseInt(unsafeWindow.seed.citystats["city" + cityId].gold[0]) - parseInt(unsafeWindow.unitcost["unt" + unitId][5]) * parseInt(num); unsafeWindow.seed.citystats["city" + cityId].pop[0] = parseInt(unsafeWindow.seed.citystats["city" + cityId].pop[0]) - parseInt(unsafeWindow.unitcost["unt" + unitId][6]) * parseInt(num); unsafeWindow.seed.queue_unt["city" + cityId].push([unitId, num, rslt.initTS, parseInt(rslt.initTS) + time, 0, time, null]); if (notify != null) setTimeout (function (){notify(null);}, 500); } else { if (notify != null){ setTimeout (function (){notify(rslt.errorMsg);}, 500); } } }, onFailure: function(o) { if (notify != null) notify(rslt.errorMsg); } }); } /************ LIB classes/functions .... **************/ function getAbsoluteOffsets (e){ ret = {left:0, top:0}; while (e.offsetParent){ if (e.style.position == 'absolute') break; ret.left += e.offsetLeft; ret.top += e.offsetTop; e = e.offsetParent; } return ret; } DebugTimer = { startTime : 0, start : function (){ now = new Date(); DebugTimer.startTime = now.getTime(); }, display : function (label, noReset){ now = new Date(); elapsed = now.getTime() - DebugTimer.startTime; logit (label +": "+ elapsed/1000); if (noReset===null || !noReset) DebugTimer.startTime = now.getTime(); }, }; function debugPos (e){ return 'client - offset: '+ e.clientLeft +','+ e.clientTop +','+ e.clientWidth +','+ e.clientHeight +' - '+ e.offsetLeft +','+ e.offsetTop +','+ e.offsetWidth +','+ e.offsetHeight +' '+ e +' --OP--> '+ e.offsetParent; } function debugElement (e){ var x = unsafeWindow.Object.clone (e.wrappedJSObject); x.innerHTML = ''; x.innerText = ''; x.textContent = ''; return inspect (x, 1, 1); } function searchDOM (node, condition, maxLevel, doMult){ var found = []; eval ('var compFunc = function (node) { return ('+ condition +') }'); doOne(node, 1); if(!doMult){ if (found.length==0) return null; return found[0]; } return found; function doOne (node, curLevel){ try { if (compFunc(node)) found.push(node); } catch (e){ } if (!doMult && found.length>0) return; if (++curLevel<maxLevel && node.childNodes!=undefined) for (var c=0; c<node.childNodes.length; c++) doOne (node.childNodes[c], curLevel); } } function getClientCoords(e){ if (e==null) return {x:null, y:null, width:null, height:null}; var x=0, y=0; ret = {x:0, y:0, width:e.clientWidth, height:e.clientHeight}; while (e.offsetParent != null){ ret.x += e.offsetLeft; ret.y += e.offsetTop; e = e.offsetParent; } return ret; } function htmlTitleLine (msg){ return '<TABLE width=100% cellspacing=0><TR><TD style="padding:0px" width=50%><HR></td><TD style="padding:0px">[ '+ msg +' ]</td><TD style="padding:0px" width=50%><HR></td></tr></table>'; } var WinManager = { wins : {}, // prefix : CPopup obj get : function (prefix){ var t = WinManager; return t.wins[prefix]; }, add : function (prefix, pop){ var t = WinManager; t.wins[prefix] = pop; if (unsafeWindow.cpopupWins == null) unsafeWindow.cpopupWins = {}; unsafeWindow.cpopupWins[prefix] = pop; }, delete : function (prefix){ var t = WinManager; delete t.wins[prefix]; delete unsafeWindow.cpopupWins[prefix]; } } // creates a 'popup' div // prefix must be a unique (short) name for the popup window function CPopup (prefix, x, y, width, height, enableDrag, onClose) { var pop = WinManager.get(prefix); if (pop){ pop.show (false); return pop; } this.BASE_ZINDEX = 111111; // protos ... this.show = show; this.toggleHide = toggleHide; this.getTopDiv = getTopDiv; this.getMainDiv = getMainDiv; this.getLayer = getLayer; this.setLayer = setLayer; this.setEnableDrag = setEnableDrag; this.getLocation = getLocation; this.setLocation = setLocation; this.focusMe = focusMe; this.unfocusMe = unfocusMe; this.centerMe = centerMe; this.destroy = destroy; // object vars ... this.div = document.createElement('div'); this.prefix = prefix; this.onClose = onClose; var t = this; this.div.className = 'CPopup '+ prefix +'_CPopup'; this.div.id = prefix +'_outer'; this.div.style.background = "#fff"; this.div.style.zIndex = this.BASE_ZINDEX // KOC modal is 100210 ? this.div.style.display = 'none'; this.div.style.width = width + 'px'; this.div.style.height = height + 'px'; this.div.style.position = "absolute"; this.div.style.top = y +'px'; this.div.style.left = x + 'px'; if (CPopUpTopClass==null) topClass = 'CPopupTop '+ prefix +'_CPopupTop'; else topClass = CPopUpTopClass +' '+ prefix +'_'+ CPopUpTopClass; var m = '<TABLE cellspacing=0 width=100% height=100%><TR id="'+ prefix +'_bar" class="'+ topClass +'"><TD width=99% valign=bottom><SPAN id="'+ prefix +'_top"></span></td>\ <TD id='+ prefix +'_X align=right valign=middle onmouseover="this.style.cursor=\'pointer\'" style="color:#fff; background:#333; font-weight:bold; font-size:14px; padding:0px 5px">X</td></tr>\ <TR><TD height=100% valign=top class="CPopMain '+ prefix +'_CPopMain" colspan=2 id="'+ prefix +'_main"></td></tr></table>'; document.body.appendChild(this.div); this.div.innerHTML = m; document.getElementById(prefix+'_X').addEventListener ('click', e_XClose, false); this.dragger = new CWinDrag (document.getElementById(prefix+'_bar'), this.div, enableDrag); this.div.addEventListener ('mousedown', e_divClicked, false); WinManager.add(prefix, this); function e_divClicked (){ t.focusMe(); } function e_XClose (){ t.show(false); if (t.onClose != null) t.onClose(); } function focusMe (){ t.setLayer(5); for (k in unsafeWindow.cpopupWins){ if (k != t.prefix) unsafeWindow.cpopupWins[k].unfocusMe(); } } function unfocusMe (){ t.setLayer(-5); } function getLocation (){ return {x: parseInt(this.div.style.left), y: parseInt(this.div.style.top)}; } function setLocation (loc){ t.div.style.left = loc.x +'px'; t.div.style.top = loc.y +'px'; } function destroy (){ document.body.removeChild(t.div); WinManager.delete (t.prefix); } function centerMe (parent){ if (parent == null){ var coords = getClientCoords(document.body); } else var coords = getClientCoords(parent); var x = ((coords.width - parseInt(t.div.style.width)) / 2) + coords.x; var y = ((coords.height - parseInt(t.div.style.height)) / 2) + coords.y; if (x<0) x = 0; if (y<0) y = 0; t.div.style.left = x +'px'; t.div.style.top = y +'px'; } function setEnableDrag (tf){ t.dragger.setEnable(tf); } function setLayer(zi){ t.div.style.zIndex = ''+ (this.BASE_ZINDEX + zi); } function getLayer(){ return parseInt(t.div.style.zIndex) - this.BASE_ZINDEX; } function getTopDiv(){ return document.getElementById(this.prefix+'_top'); } function getMainDiv(){ return document.getElementById(this.prefix+'_main'); } function show(tf){ if (tf){ t.div.style.display = 'block'; t.focusMe (); } else { t.div.style.display = 'none'; } return tf; } function toggleHide(t){ if (t.div.style.display == 'block') { return t.show (false); } else { return t.show (true); } } } function CWinDrag (clickableElement, movingDiv, enabled) { var t=this; this.setEnable = setEnable; this.setBoundRect = setBoundRect; this.debug = debug; this.dispEvent = dispEvent; this.lastX = null; this.lastY = null; this.enabled = true; this.moving = false; this.theDiv = movingDiv; this.body = document.body; this.ce = clickableElement; this.moveHandler = new CeventMove(this).handler; this.outHandler = new CeventOut(this).handler; this.upHandler = new CeventUp(this).handler; this.downHandler = new CeventDown(this).handler; this.clickableRect = null; this.boundRect = null; this.bounds = null; this.enabled = false; if (enabled == null) enabled = true; this.setEnable (enabled); function setBoundRect (b){ // this rect (client coords) will not go outside of current body this.boundRect = boundRect; this.bounds = null; } function setEnable (enable){ if (enable == t.enabled) return; if (enable){ clickableElement.addEventListener('mousedown', t.downHandler, false); t.body.addEventListener('mouseup', t.upHandler, false); } else { clickableElement.removeEventListener('mousedown', t.downHandler, false); t.body.removeEventListener('mouseup', t.upHandler, false); } t.enabled = enable; } function CeventDown (that){ this.handler = handler; var t = that; function handler (me){ if (DEBUG_TRACE_DRAG) t.dispEvent ('eventDOWN', me); if (t.bounds == null){ t.clickableRect = getClientCoords(clickableElement); t.bodyRect = getClientCoords(document.body); if (t.boundRect == null) t.boundRect = t.clickableRect; if (DEBUG_TRACE_DRAG) logit ('Clickable rect: '+ inspect (t.clickableRect, 3, 1)); if (DEBUG_TRACE_DRAG) logit ('Body rect: '+ inspect (t.bodyRect, 3, 1)); if (DEBUG_TRACE_DRAG) logit ('Bound rect: '+ inspect (t.boundRect, 3, 1)); t.bounds = {top:10-t.clickableRect.height, bot:t.bodyRect.height-25, left:40-t.clickableRect.width, right:t.bodyRect.width-25}; if (DEBUG_TRACE_DRAG) logit ("BOUNDS: "+ inspect (t.bounds, 8, 10)); } if (me.button==0 && t.enabled){ t.body.addEventListener('mousemove', t.moveHandler, true); t.body.addEventListener('mouseout', t.outHandler, true); t.lastX = me.clientX; t.lastY = me.clientY; t.moving = true; } } } function CeventUp (that){ this.handler = handler; var t = that; function handler (me){ if (DEBUG_TRACE_DRAG) t.dispEvent ('eventUP', me); if (me.button==0 && t.moving) _doneMoving(t); } } function _doneMoving (t){ if (DEBUG_TRACE_DRAG) logit ('doneMoving'); t.body.removeEventListener('mousemove', t.moveHandler, true); t.body.removeEventListener('mouseout', t.outHandler, true); t.moving = false; } function CeventOut (that){ this.handler = handler; var t = that; function handler (me){ //t.dispEvent ('eventOUT', me); if (me.button==0){ t.moveHandler (me); } } } function CeventMove (that){ this.handler = handler; var t = that; function handler (me){ if (t.enabled && !t.wentOut){ //t.dispEvent ('eventMOVE', me); var newTop = parseInt(t.theDiv.style.top) + me.clientY - t.lastY; var newLeft = parseInt(t.theDiv.style.left) + me.clientX - t.lastX; if (newTop < t.bounds.top){ // if out-of-bounds... newTop = t.bounds.top; _doneMoving(t); } else if (newLeft < t.bounds.left){ newLeft = t.bounds.left; _doneMoving(t); } else if (newLeft > t.bounds.right){ newLeft = t.bounds.right; _doneMoving(t); } else if (newTop > t.bounds.bot){ newTop = t.bounds.bot; _doneMoving(t); } t.theDiv.style.top = newTop + 'px'; t.theDiv.style.left = newLeft + 'px'; t.lastX = me.clientX; t.lastY = me.clientY; } } } function debug (msg, e){ logit ("*************** "+ msg +" ****************"); logit ('clientWidth, Height: '+ e.clientWidth +','+ e.clientHeight); logit ('offsetLeft, Top, Width, Height (parent): '+ e.offsetLeft +','+ e.offsetTop +','+ e.offsetWidth +','+ e.offsetHeight +' ('+ e.offsetParent +')'); logit ('scrollLeft, Top, Width, Height: '+ e.scrollLeft +','+ e.scrollTop +','+ e.scrollWidth +','+ e.scrollHeight); } function dispEvent (msg, me){ logit (msg + ' Button:'+ me.button +' Screen:'+ me.screenX +','+ me.screenY +' client:'+ me.clientX +','+ me.clientY +' rTarget: '+ me.relatedTarget); } } function inspect(obj, maxLevels, level, doFunctions){ var str = '', type, msg; if(level == null) level = 0; if(maxLevels == null) maxLevels = 1; if(maxLevels < 1) return 'Inspect Error: Levels number must be > 0'; if(obj == null) return 'ERROR: Object is NULL\n'; var indent = ''; for (var i=0; i<level; i++) indent += ' '; for(property in obj) { try { type = matTypeof(obj[property]); if (doFunctions==true && (type == 'function')){ str += indent + '(' + type + ') ' + property + "[FUNCTION]\n"; } else if (type != 'function') { str += indent + '(' + type + ') ' + property + ( (obj[property]==null)?(': null'):('')) +' = '+ obj[property] +"\n"; } if((type=='object' || type=='array') && (obj[property] != null) && (level+1 < maxLevels)) str += inspect(obj[property], maxLevels, level+1, doFunctions); // recurse } catch(err) { // Is there some properties in obj we can't access? Print it red. if(typeof(err) == 'string') msg = err; else if(err.message) msg = err.message; else if(err.description) msg = err.description; else msg = 'Unknown'; str += '(Error) ' + property + ': ' + msg +"\n"; } } str += "\n"; return str; } Array.prototype.compare = function(testArr) { if (this.length != testArr.length) return false; for (var i = 0; i < testArr.length; i++) { if (this[i].compare) { if (!this[i].compare(testArr[i])) return false; } if (this[i] !== testArr[i]) return false; } return true; } String.prototype.entityTrans = { '&':'&', '<':'<', '>':'>', '\"':'"' }; String.prototype.htmlEntities = function() { var ret = this.toString(); for (k in this.entityTrans) ret = ret.split(k).join(this.entityTrans[k]); return ret; } String.prototype.stripTags = function(){ return this.replace(/<\w+(\s+("[^"]*"|'[^']*'|[^>])+)?>|<\/\w+>/gi, ''); } String.prototype.capitalize = function(){ return this.charAt(0).toUpperCase() + this.substring(1).toLowerCase(); } function objectName (o){ var s = o.toString(); return s.substr(7,s.length-8); } function matTypeof (v){ if (v == undefined) return 'undefined'; if (typeof (v) == 'object'){ if (!v) return 'null'; else if (v.constructor.toString().indexOf("Array")>=0 && typeof(v.splice)=='function') return 'array'; else return 'object'; } return typeof (v); } function addCommasInt(n){ nStr = parseInt(n) + ''; var rgx = /(\d+)(\d{3})/; while (rgx.test(nStr)) { nStr = nStr.replace(rgx, '$1' + ',' + '$2'); } return nStr; } function addCommas(nStr){ nStr += ''; x = nStr.split('.'); x1 = x[0]; x2 = x.length > 1 ? '.' + x[1] : ''; var rgx = /(\d+)(\d{3})/; while (rgx.test(x1)) { x1 = x1.replace(rgx, '$1' + ',' + '$2'); } return x1 + x2; } function addCommasWhole(nStr){ nStr += ''; x = nStr.split('.'); x1 = x[0]; x2 = x.length > 1 ? '.' + x[1] : ''; var rgx = /(\d+)(\d{3})/; while (rgx.test(x1)) { x1 = x1.replace(rgx, '$1' + ',' + '$2'); } return x1; } function htmlSelector (valNameObj, curVal, tags){ m = []; m.push ('<SELECT'); if (tags){ m.push (' '); m.push (tags); } for (k in valNameObj){ m.push ('><OPTION '); if (k == curVal) m.push ('SELECTED '); m.push ('value="'); m.push (k); m.push ('">'); m.push (valNameObj[k]); m.push ('</option>'); } m.push ('</select>'); return m.join (''); } function unixTime (){ return parseInt (new Date().getTime() / 1000) + unsafeWindow.g_timeoff; } function htmlOptions (a, curVal){ m = ''; for (k in a) m += '<OPTION value="'+ k +'"'+ (k==curVal?' SELECTED':'') +'>'+ a[k] +'</option>'; return m; } function getFunctionName (func){ var name=/\W*function\s+([\w\$]+)\(/.exec(func); if (!name) return ''; return name[1]; } function findAllBetween (txt, find1, find2){ var m = []; var last = 0; while ( (i1=txt.indexOf(find1, last))>=0 && (i2=txt.indexOf (find2, i1))>=0 ) { m.push (txt.substring(i1+find1.length, i2)); last = i2 + find2.length; } return m; } function strUpTo (s, find){ var i = s.indexOf(find); if (i > 0) return s.substr(0, i); return s; } /******** Xd Xh Xh Xm Xm Xs Xs ********/ function timestrShort(time) { time = parseInt (time); if (time > 86400){ var m = []; time /= 3600; m.push (parseInt(time/24)); m.push ('d '); m.push (parseInt(time%24)); m.push ('h '); return m.join (''); } else return timestr (time); } /********************** part full Xd Xh Xm Xd Xh Xm Xs Xh Xm Xh Xm Xs Xm Xs Xm Xs Xs Xs **********************/ function timestr(time, full) { time = parseInt (time); var m = []; var t = time; if (t < 61) return t + 's'; if (t > 86400){ m.push (parseInt(t/86400)); m.push ('d '); t %= 86400; } if (t>3600 || time>3600){ m.push (parseInt(t/3600)); m.push ('h '); t %= 3600; } m.push (parseInt(t/60)); m.push ('m'); if (full || time<=3600 ){ m.push (' '); m.push (t%60); m.push ('s'); } return m.join (''); } /************ LIB singletons .... **************/ // TODO: fix REopening window var WINLOG_MAX_ENTRIES = 1000; // TODO var WinLog = { state : null, win: null, eOut : null, lastE : null, enabled : true, reverse : true, busy : false, isOpening : false, open : function (){ var t = WinLog; function eventButClear(){ var t = WinLog; t.lastE = null; t.eOut.innerHTML =''; } function eventButReverse(){ var t = WinLog; if (t.busy) return; t.busy = true; if (t.reverse){ t.win.document.getElementById('wlRev').value= 'Top'; t.reverse = false; } else{ t.win.document.getElementById('wlRev').value= 'Bottom'; t.reverse = true; } var n = t.eOut.childNodes.length; if (n < 2) return; for (i=n-2; i>=0; i--){ t.eOut.appendChild (t.eOut.childNodes[i]); } t.busy = false; } if (!t.win || t.win.closed){ t.isOpening = true; // Firefox bug??? It appears as if a new thread is started on open, withOUT reusing same window //t.win = window.open('', 'uwtrace', 'top=30,left=0,width=900,height=700,scrollbars=no,location=no,menubar=no,directories=no,status=no'); t.win = new CPopup('ptwinlog', 0, 0, 500, 800, true, function(){t.win.destroy(); t.win=null; t.win.closed=true;}); t.win.show(true); t.isOpening = false; t.state = null; } if (t.state == null){ t.win.getMainDiv().innerHTML = '<STYLE>pre{margin:0px} hr{margin:3px; height:1px; border:0px; color:#cee; background-color:#cee}</style>\ <BODY style="margin:0px; padding:0px; border:none">\ <DIV id=winlogtop style="background-color:#d0d0d0; margin:0px; padding:0px; border:1px solid">\ <INPUT id=wlClear type=submit value="Clear"> <INPUT id=wlRev type=submit value="Bottom"></div>\ <DIV id=wlOut style="overflow-y:auto; overflow-x:auto; height:750px; max-height:800px; width:600px"></div></body>'; document.getElementById('wlClear').addEventListener('click', eventButClear, false); document.getElementById('wlRev').addEventListener('click', eventButReverse, false); t.eOut = document.getElementById('wlOut'); t.lastE = null; t.state = 1; } }, writeText : function (msg){ WinLog.write (msg.htmlEntities()); }, write : function (msg){ var t = WinLog; if (!t.enabled || t.isOpening) return; t.open(); var te = document.createElement('pre'); var now = new Date(); var m = []; var millis = now.getMilliseconds(); m.push (now.toTimeString().substring (0,8)); m.push ('.'); if (millis<100) m.push('0'); if (millis<10) m.push('0'); m.push(millis); m.push (': '); m.push (msg); te.innerHTML = m.join(''); if (t.reverse){ if (t.lastE == null){ t.eOut.appendChild(te); t.lastE = te; } else { t.eOut.insertBefore(te, t.lastE); } var hr = document.createElement('hr'); t.eOut.insertBefore(hr, te); t.lastE = hr; } else { t.eOut.appendChild(te); t.eOut.appendChild(document.createElement('hr')); } }, }; function getAllianceLeaders (){ var params = unsafeWindow.Object.clone(unsafeWindow.g_ajaxparams); new AjaxRequest(unsafeWindow.g_ajaxpath + "ajax/allianceGetLeaders.php" + unsafeWindow.g_ajaxsuffix, { method: "post", parameters: params, loading: true, onSuccess: function (rslt) { rslt = eval("(" + rslt.responseText + ")"); if (rslt.officers) { Options.AllianceLeaders = []; for (add in rslt.officers) { Options.AllianceLeaders.push(rslt.officers[add]['userId']); } } else { setTimeout(function(){getAllianceLeaders;}, 1500); } }, onFailure: function () {} }); }; function WhisperSound (){ //alert('enter'); document.all.sound.src = 'http://www.mediavue.net/phplive/sounds/doorbell.wav'; //test = '<embed src="http://www.mediavue.net/phplive/sounds/doorbell.wav" autostart=false loop=false>'; //var player = new CmatSimpleSound(SWF_PLAYER_URL, null, {height:0, width:0}, t.e_swfLoaded, 'debug=n'); //player.play(1,0); } function CmatSimpleSound (playerUrl, container, attrs, onLoad, flashVars) { var self = this; this.player = null; this.volume = 100; this.isLoaded = false; this.onSwfLoaded = null; var div = document.createElement ('div'); this.onSwfLoaded = onLoad; if (navigator.appName.toLowerCase().indexOf('microsoft')+1) { div.innerHTML = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"><param name="movie" value="'+playerUrl+'"><param name="quality" value="high"></object>'; this.player = div.getElementsByTagName('object')[0]; } else { div.innerHTML = '<embed src="'+playerUrl+'" bgcolor="#eeeeee" allowfullscreen=false FlashVars="'+ flashVars +'" quality="high" allowscriptaccess="always" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" ></embed>'; this.player = div.getElementsByTagName('embed')[0].wrappedJSObject; } if (container) container.appendChild (div); else document.body.appendChild (div); for (k in attrs) this.player.setAttribute(k, attrs[k]); this.setVolume = function (chanNum, vol){ if (!self.isLoaded) return; self.player.jsSetVolume (chanNum, vol); volume = vol; } this.load = function (chanNum, url, bStream, bAutoplay, bUsePolicyFile){ // loop ? self.player.jsLoad (chanNum, url, bStream, bAutoplay, bUsePolicyFile); } this.play = function (chanNum, position){ self.player.jsPlay (chanNum, position); } this.stop = function (chanNum){ self.player.jsStop (chanNum); } this.getStatus = function (chanNum){ // returns null if sound channel is 'empty' return self.player.jsGetStatus (chanNum); } this.debugFunc = function (msg){ // overload to use } this.swfDebug = function (msg){ // called by plugin self.debugFunc('SWF: '+ msg); } this.swfLoaded = function (){ // called by plugin when ready to go! self.isLoaded = true; self.debugFunc ('playerIsReady'); if (self.onSwfLoaded) self.onSwfLoaded(); } this.swfPlayComplete = function (chanNum){ // called by plugin when a sound finishes playing (overload to be notified) } this.swfLoadComplete = function (chanNum, isError){ // called by plugin when a sound finishes loading (overload to be notified) } } ptStartup ();
Mozilla add on,User script,Grease Monkey Script, greasemonkey userscripts, updater userscripts mafia wars userscripts mafia wars autoplayer userscripts mafia wars wall userscripts scripts userscripts travian greasemonkey greasemonkey download greasemonkey facebook greasemonkey tutorial greasemonkey youtube greasemonkey travian greasemonkey chrome greasemonkey mafia wars greasemonkey mafia wars autoplayer
Sunday, October 2, 2011
Power Tools - POC 3 With Food Alert
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment