您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Relay your levels etc in a wink of an eye.
当前为
// ==UserScript== // @name C&C Tiberium Alliances Info - Updated Layout // @author Soera and TheStriker(OriginalAuthor) and dbendure // @description Relay your levels etc in a wink of an eye. // @description Alt+Y - Insert to message/chat/post all your bases/cities info // @description Alt+N - Insert to message/chat/post ally support info // @description Alt+P - Insert to message/chat/post Prodution POIs info with infosticker functions ability // @description Alt+O - Insert to message/chat/post OffnDef POIs info with infosticker functions ability // @namespace https://prodgame*.alliances.commandandconquer.com/*/index.aspx* // @include https://prodgame*.alliances.commandandconquer.com/*/index.aspx* // @version 1.0.8 // ==/UserScript== (function () { function InfoSticker_IsInstalled() { return (typeof (InfoSticker_IsInstalled) != 'undefined' && InfoSticker_IsInstalled); } var TAI_main = function () { function createInstance() { qx.Class.define("TAI", { //TAS.main type : "singleton", extend : qx.core.Object, members : { initialize : function () { addEventListener("keyup", this.onKey, false); console.log("TA Info loaded."); }, onKey : function (ev) { var s = String.fromCharCode(ev.keyCode); var inputField = document.querySelector('input:focus, textarea:focus'); if (inputField != null) { // ALT+ if (ev.altKey && !ev.altGraphKey && !ev.ctrlKey && !ev.shiftKey && s == "Y") { // player bases info to share with others var apc = ClientLib.Data.MainData.GetInstance().get_Cities().get_AllCities().d;//all player cities var playername = ClientLib.Data.MainData.GetInstance().get_Player().get_Name(); var txt = "", c, unitData, bh, supp, type, df; txt += "[quote="+playername+"]"; for (var key in apc) { c = apc[key]; txt += "[quote]Def: [b]" + ('0' + c.get_LvlDefense().toFixed(2)).slice(-5) + "[/b] "; txt += "Off: [b]" + ('0' + c.get_LvlOffense().toFixed(2)).slice(-5) + "[/b] "; unitData = c.get_CityBuildingsData(); bh = unitData.GetUniqueBuildingByTechName(ClientLib.Base.ETechName.Construction_Yard); df = unitData.GetUniqueBuildingByTechName(ClientLib.Base.ETechName.Defense_Facility); supp = unitData.GetUniqueBuildingByTechName(ClientLib.Base.ETechName.Support_Ion); if (supp === null) supp = unitData.GetUniqueBuildingByTechName(ClientLib.Base.ETechName.Support_Art); if (supp === null) supp = unitData.GetUniqueBuildingByTechName(ClientLib.Base.ETechName.Support_Air); if (bh !== null) { txt += "CY: [b]" + bh.get_CurrentLevel() + "[/b] "; //txt += "[u]BaseRep:[/u] [b]" + (c.get_CityBuildingsData().GetFullRepairTime() / 3600).toFixed(2) + "h[/b] "; //txt += "[u]DefRep:[/u] [b]" + (c.get_CityUnitsData().GetRepairTimeFromEUnitGroup(ClientLib.Data.EUnitGroup.Defense) / 3600).toFixed(2) + "h[/b] "; } if (df !== null) { txt += "DF: [b]" + df.get_CurrentLevel() + "[/b] "; } else { txt += "DF: [b]NA[/b] "; } if (supp !== null) { txt += "" + supp.get_TechGameData_Obj().dn.slice(0, 3) + ": [b]" + supp.get_CurrentLevel() + "[/b] "; } else { txt += "SUP: [b]NA[/b] "; } if(this.InfoSticker_IsInstalled == true ){ var _IS = window.InfoSticker.Base.$$instance; txt += "[/quote][quote][u]Tib cont : [b]" + _IS.formatNumbersCompact(c.GetResourceGrowPerHour(ClientLib.Base.EResourceType.Tiberium, false, false)) + "/h[/b][/u] [u]Cry cont : [b]" + _IS.formatNumbersCompact(c.GetResourceGrowPerHour(ClientLib.Base.EResourceType.Crystal, false, false)) + "/h[/b][/u] [u]Pow cont : [b]" + _IS.formatNumbersCompact(c.GetResourceGrowPerHour(ClientLib.Base.EResourceType.Power, false, false)) + "/h[/b][/u][/quote]"; } else { txt += "[/quote][quote][u]Tib cont : [b]" + c.GetResourceGrowPerHour(ClientLib.Base.EResourceType.Tiberium, false, false) + "/h[/b][/u] [u]Cry cont : [b]" + c.GetResourceGrowPerHour(ClientLib.Base.EResourceType.Crystal, false, false) + "/h[/b][/u] [u]Pow cont : [b]" + c.GetResourceGrowPerHour(ClientLib.Base.EResourceType.Power, false, false) + "/h[/b][/u][/quote]"; } txt += "--" + "[b][coords]"+ c.get_PosX() + ":" + c.get_PosY() + ":" + c.get_Name() + "[/b][/coords]"; txt += "[hr]"; } inputField.value += txt + "[/quote]"; } else if (ev.altKey && !ev.altGraphKey && !ev.ctrlKey && !ev.shiftKey && s == "N") { var bases = ClientLib.Data.MainData.GetInstance().get_AllianceSupportState().get_Bases().d; var base, keys = Object.keys(bases), len = keys.length, info = {}, avg = 0, high = 0, supBaseCount = len; while (len--) { base = bases[keys[len]]; if (!info.hasOwnProperty(base.get_Type())) { info[base.get_Type()] = 0; } info[base.get_Type()]++; if (base.get_Level() >= 30) high++; avg += base.get_Level(); } avg /= supBaseCount; var members = ClientLib.Data.MainData.GetInstance().get_Alliance().get_MemberData().d, member, baseCount = 0; keys = Object.keys(members); len = keys.length; while (len--) { member = members[keys[len]]; baseCount += member.Bases; } inputField.value += "Bases: " + baseCount + " SupCount: " + supBaseCount + "(" + (supBaseCount / baseCount * 100).toFixed(0) + "%) Avg: " + avg.toFixed(2) + " 30+: " + high + "(" + (high / baseCount * 100).toFixed(0) + "%)"; //for (var i in info) // console.log("Type: " + i + " Count: " + info[i]); }else if (ev.altKey && !ev.altGraphKey && !ev.ctrlKey && !ev.shiftKey && s == "P") { var alliance = ClientLib.Data.MainData.GetInstance().get_Alliance(); var pois = alliance.get_POIRankScore(); var nextscore = ClientLib.Base.PointOfInterestTypes.GetNextScore; var poi = ClientLib.Data.MainData.GetInstance().get_Alliance().get_OwnedPOIs(); var tibpts = pois[0].ps; var crypts = pois[1].ps; var powpts = pois[2].ps; var tibmaxpts = nextscore(tibpts); var crymaxpts = nextscore(crypts); var powmaxpts = nextscore(powpts); if(this.InfoSticker_IsInstalled == true ){ var _IS = window.InfoSticker.Base.$$instance; var tib = _IS.formatNumbersCompact(alliance.get_POITiberiumBonus()); var cry = _IS.formatNumbersCompact(alliance.get_POICrystalBonus()); var pow = _IS.formatNumbersCompact(alliance.get_POIPowerBonus()); var tibnum = _IS.formatNumbersCompact(tibpts); var crynum = _IS.formatNumbersCompact(crypts); var pownum = _IS.formatNumbersCompact(powpts); var tibmaxnum = _IS.formatNumbersCompact(tibmaxpts); var crymaxnum = _IS.formatNumbersCompact(crymaxpts); var powmaxnum = _IS.formatNumbersCompact(powmaxpts); } else { var tib = alliance.get_POITiberiumBonus(); var cry = alliance.get_POICrystalBonus(); var pow = alliance.get_POIPowerBonus(); var tibnum = tibpts; var crynum = crypts; var pownum = powpts; var tibmaxnum = tibmaxpts; var crymaxnum = crymaxpts; var powmaxnum = powmaxpts; } txt = "[quote="+alliance.get_Abbreviation()+"sProduction]"; txt += "Tiberium score: [b]" + tibnum +"/"+ tibmaxnum + "[/b] Tiberium rank: [b]" + pois[0].r + "[/b] Tiberium Bonus: [b]" + tib + "[/b]"; for(var key in poi){ var poi0 = ClientLib.Data.MainData.GetInstance().get_Alliance().get_OwnedPOIs()[key]; //console.log(poi0.t, poi0.l); if(poi0.t == ClientLib.Base.EPOIType.TiberiumBonus){ txt += "[quote]Level : " + poi0.l + " [coords]" + poi0.x + ":" + poi0.y + "[/coords]" + " Score: " + ClientLib.Base.PointOfInterestTypes.GetScoreByLevel(poi0.l) + " Amount: " + ClientLib.Base.PointOfInterestTypes.GetBonusByType(ClientLib.Base.EPOIType.TiberiumBonus, ClientLib.Base.PointOfInterestTypes.GetScoreByLevel(poi0.l))+"[/quote]"; } } txt += " Crystal score: [b]" + crynum +"/"+ crymaxnum + "[/b] Crystal rank: [b]" + pois[1].r + "[/b] Crystal Bonus: [b]" + cry + "[/b]"; for(var key in poi){ var poi0 = ClientLib.Data.MainData.GetInstance().get_Alliance().get_OwnedPOIs()[key]; //console.log(poi0.t, poi0.l); if(poi0.t == ClientLib.Base.EPOIType.CrystalBonus){ txt += "[quote]Level : " + poi0.l + " [coords]" + poi0.x + ":" + poi0.y + "[/coords]" + " Score: " + ClientLib.Base.PointOfInterestTypes.GetScoreByLevel(poi0.l) + " Amount: " + ClientLib.Base.PointOfInterestTypes.GetBonusByType(ClientLib.Base.EPOIType.CrystalBonus, ClientLib.Base.PointOfInterestTypes.GetScoreByLevel(poi0.l))+"[/quote]"; } } txt += " Power score: [b]" + pownum +"/"+ powmaxnum + "[/b] Power rank: [b]" + pois[2].r + "[/b] Power Bonus: [b]" + pow + "[/b]"; for(var key in poi){ var poi0 = ClientLib.Data.MainData.GetInstance().get_Alliance().get_OwnedPOIs()[key]; //console.log(poi0.t, poi0.l); if(poi0.t == ClientLib.Base.EPOIType.PowerBonus){ txt += "[quote]Level : " + poi0.l + " [coords]" + poi0.x + ":" + poi0.y + "[/coords]" + " Score: " + ClientLib.Base.PointOfInterestTypes.GetScoreByLevel(poi0.l) + " Amount: " + ClientLib.Base.PointOfInterestTypes.GetBonusByType(ClientLib.Base.EPOIType.PowerBonus, ClientLib.Base.PointOfInterestTypes.GetScoreByLevel(poi0.l))+"[/quote]"; } } txt += "[/quote]"; inputField.value += txt; }else if (ev.altKey && !ev.altGraphKey && !ev.ctrlKey && !ev.shiftKey && s == "O") { var alliance = ClientLib.Data.MainData.GetInstance().get_Alliance(); var pois = alliance.get_POIRankScore(); var nextscore = ClientLib.Base.PointOfInterestTypes.GetNextScore; var poi = ClientLib.Data.MainData.GetInstance().get_Alliance().get_OwnedPOIs(); var infpts = pois[3].ps; var vehpts = pois[4].ps; var airpts = pois[5].ps; var defpts = pois[6].ps; var infmaxpts = nextscore(infpts); var vehmaxpts = nextscore(vehpts); var airmaxpts = nextscore(airpts); var defmaxpts = nextscore(defpts); if(this.InfoSticker_IsInstalled == true ){ var _IS = window.InfoSticker.Base.$$instance; var infnum = _IS.formatNumbersCompact(infpts); var vehnum = _IS.formatNumbersCompact(vehpts); var airnum = _IS.formatNumbersCompact(airpts); var defnum = _IS.formatNumbersCompact(defpts); var infmaxnum = _IS.formatNumbersCompact(infmaxpts); var vehmaxnum = _IS.formatNumbersCompact(vehmaxpts); var airmaxnum = _IS.formatNumbersCompact(airmaxpts); var defmaxnum = _IS.formatNumbersCompact(defmaxpts); } else { var infnum = infpts; var vehnum = vehpts; var airnum = airpts; var defnum = defpts; var infmaxnum = infmaxpts; var vehmaxnum = vehmaxpts; var airmaxnum = airmaxpts; var defmaxnum = defmaxpts; } txt = "[quote="+alliance.get_Abbreviation()+"sOffnDef]"; txt += "Inf score: [b]" + infnum +"/"+ infmaxnum + "[/b] Inf rank: [b]" + pois[3].r + "[/b] Inf Bonus: [b]" + alliance.get_POIInfantryBonus() + "%[/b]"; for(var key in poi){ var poi0 = ClientLib.Data.MainData.GetInstance().get_Alliance().get_OwnedPOIs()[key]; //console.log(poi0.t, poi0.l); if(poi0.t == ClientLib.Base.EPOIType.InfanteryBonus){ txt += "[quote]Level : " + poi0.l + " [coords]" + poi0.x + ":" + poi0.y + "[/coords]" + " Score: " + ClientLib.Base.PointOfInterestTypes.GetScoreByLevel(poi0.l) + " Amount: " + ClientLib.Base.PointOfInterestTypes.GetBonusByType(ClientLib.Base.EPOIType.InfanteryBonus, ClientLib.Base.PointOfInterestTypes.GetScoreByLevel(poi0.l))+"[/quote]"; } } txt += " Veh score : [b]" + vehnum +"/"+ vehmaxnum + "[/b] Veh rank : [b]" + pois[4].r + "[/b] Veh Bonus: [b]" + alliance.get_POIVehicleBonus() + "%[/b]"; for(var key in poi){ var poi0 = ClientLib.Data.MainData.GetInstance().get_Alliance().get_OwnedPOIs()[key]; //console.log(poi0.t, poi0.l); if(poi0.t == ClientLib.Base.EPOIType.VehicleBonus){ txt += "[quote]Level : " + poi0.l + " [coords]" + poi0.x + ":" + poi0.y + "[/coords]" + " Score: " + ClientLib.Base.PointOfInterestTypes.GetScoreByLevel(poi0.l) + " Amount: " + ClientLib.Base.PointOfInterestTypes.GetBonusByType(ClientLib.Base.EPOIType.VehicleBonus, ClientLib.Base.PointOfInterestTypes.GetScoreByLevel(poi0.l))+"[/quote]"; } } txt += " Air score : [b]" + airnum +"/"+ airmaxnum + "[/b] Air rank : [b]" + pois[5].r + "[/b] Air Bonus: [b]" + alliance.get_POIAirBonus() + "%[/b]"; for(var key in poi){ var poi0 = ClientLib.Data.MainData.GetInstance().get_Alliance().get_OwnedPOIs()[key]; //console.log(poi0.t, poi0.l); if(poi0.t == ClientLib.Base.EPOIType.AirBonus){ txt += "[quote]Level : " + poi0.l + " [coords]" + poi0.x + ":" + poi0.y + "[/coords]" + " Score: " + ClientLib.Base.PointOfInterestTypes.GetScoreByLevel(poi0.l) + " Amount: " + ClientLib.Base.PointOfInterestTypes.GetBonusByType(ClientLib.Base.EPOIType.AirBonus, ClientLib.Base.PointOfInterestTypes.GetScoreByLevel(poi0.l))+"[/quote]"; } } txt += " Def score : [b]" + defnum +"/"+ defmaxnum + "[/b] Def rank : [b]" + pois[6].r + "[/b] Def Bonus: [b]" + alliance.get_POIDefenseBonus() + "%[/b]"; for(var key in poi){ var poi0 = ClientLib.Data.MainData.GetInstance().get_Alliance().get_OwnedPOIs()[key]; //console.log(poi0.t, poi0.l); if(poi0.t == ClientLib.Base.EPOIType.DefenseBonus){ txt += "[quote]Level : " + poi0.l + " [coords]" + poi0.x + ":" + poi0.y + "[/coords]" + " Score: " + ClientLib.Base.PointOfInterestTypes.GetScoreByLevel(poi0.l) + " Amount: " + ClientLib.Base.PointOfInterestTypes.GetBonusByType(ClientLib.Base.EPOIType.DefenseBonus, ClientLib.Base.PointOfInterestTypes.GetScoreByLevel(poi0.l))+"[/quote]"; } } txt += "[/quote]"; inputField.value += txt; } } }, } // members }); } // Loading function TAI_checkIfLoaded() { try { if (typeof qx != 'undefined') { if (qx.core.Init.getApplication().getMenuBar() !== null) { createInstance(); TAI.getInstance().initialize(); } else setTimeout(TAI_checkIfLoaded, 1000); } else { setTimeout(TAI_checkIfLoaded, 1000); } } catch (e) { if (typeof console != 'undefined') { console.log(e); } else if (window.opera) { opera.postError(e); } else { GM_log(e); } } } if (/commandandconquer\.com/i.test(document.domain)) { setTimeout(TAI_checkIfLoaded, 1000); } }; // injecting, because there seem to be problems when creating game interface with unsafeWindow var TAIScript = document.createElement("script"); var txt = TAI_main.toString(); TAIScript.innerHTML = "(" + txt + ")();"; TAIScript.type = "text/javascript"; if (/commandandconquer\.com/i.test(document.domain)) { document.getElementsByTagName("head")[0].appendChild(TAIScript); } })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址