Command and Conquer Tiberium Alliances USERSCRIPT Kampfaufstellung ??
Discussion on Command and Conquer Tiberium Alliances USERSCRIPT Kampfaufstellung ?? within the Browsergames forum part of the Other Online Games category.
Hm, also wer sich mit Coden auskennt... hier ist ein Script (leider veraltet) welches die Auto Aufstellung haben sollte. Es ist wie gesagt veraltet und ich habe keine Ahnung was man alles ändern müsste damit es wieder funktioniert.
Wenn es einer von euch schaffen sollte es anzupassen, bitte eine Kopie an mich (werde sie auch nicht verbreiten wenn du es nicht willst):
this.buttonReturnSetup = new qx.ui.form.Button("Setup");
this.buttonReturnSetup.set({width: 80, appearance: "button-text-small", toolTipText: "Return to Combat Setup"});
this.buttonReturnSetup.addListener("click", this.returnSetup, this);
_this = this;
setTimeout(function() {
try {
// Get the active modules
// Doing this the hard and unreliable way for now, until we figure out a better way
_this.attacker_modules = {};
var g = ClientLib.Res.ResMain.GetInstance$10();
var player = ClientLib.Data.MainData.GetInstance$9().get_Player $2();
_this.attacker_modules.l = [];
for (var i in g.m_Gamedata.units) {
var ug = g.GetUnit$0(i);
var research = player.m_PlayerResearch.GetResearchItemFomMdbId(ug .tl);
var modules = ug.m;
for (var j in modules) {
var module = modules[j];
if (module.t == 1) {
_this.attacker_modules.l.push(module.i);
}
if (research && module.t == 3 && research.m_Level == 2) {
_this.attacker_modules.l.push(module.i);
}
}
}
// Add the two buttons for save and load
var layHBox = new qx.ui.container.Composite();
layHBox.setLayout(new qx.ui.layout.HBox(5));
// Load button
this.buttonLayoutLoad = new qx.ui.form.Button("Load");
this.buttonLayoutLoad.set({width: 80, appearance: "button-text-small", toolTipText: "Load this saved layout."});
this.buttonLayoutLoad.addListener("click", this.loadCityLayout, this);
layHBox.add(this.buttonLayoutLoad);
// Delete button
this.buttonLayoutDelete = new qx.ui.form.Button("Delete");
this.buttonLayoutDelete.set({width: 80, appearance: "button-text-small", toolTipText: "Delete this saved layout."});
this.buttonLayoutDelete.addListener("click", this.deleteCityLayout, this);
layHBox.add(this.buttonLayoutDelete);
layoutPage.add(layHBox);
var layVBox = new qx.ui.container.Composite()
layVBox.setLayout(new qx.ui.layout.VBox(5));
layVBox.setThemedFont("bold");
layVBox.setThemedPadding(2);
layVBox.setThemedBackgroundColor("#eef");
// The Label Textbox
var layHBox2 = new qx.ui.container.Composite()
layHBox2.setLayout(new qx.ui.layout.HBox(5));
layHBox2.add(new qx.ui.basic.Label("Name: "));
this.layoutsLabelText = new qx.ui.form.TextField();
layHBox2.add(this.layoutsLabelText);
layVBox.add(layHBox2);
this.buttonLayoutSave = new qx.ui.form.Button("Save");
this.buttonLayoutSave.set({width: 80, appearance: "button-text-small", toolTipText: "Save this layout."});
this.buttonLayoutSave.addListener("click", this.saveCityLayout, this);
layVBox.add(this.buttonLayoutSave);
layoutPage.add(layVBox);
////////////////// Info ////////////////////
var infoPage = new qx.ui.tabview.Page("Info");
infoPage.setLayout(new qx.ui.layout.VBox(5));
tabView.add(infoPage);
// The Help Vertical Box
var pVBox = new qx.ui.container.Composite()
pVBox.setLayout(new qx.ui.layout.VBox(5));
pVBox.setThemedFont("bold");
pVBox.setThemedPadding(2);
pVBox.setThemedBackgroundColor("#eef");
infoPage.add(pVBox);
var proHelpBar = new qx.ui.basic.Label().set({
value: "<a target='_blank' href='http://www.youtube.com/watch?v=TcgryVL9jnk'>Tutorial</a> | <a target='_blank' href='http://www.moneyscripts.net/ta/faq'>FAQ</a> | <a target='_blank' href='http://userscripts.org/scripts/discuss/130344'>Forums</a>",
rich : true
});
pVBox.add(proHelpBar);
// The Spoils
var psVBox = new qx.ui.container.Composite()
psVBox.setLayout(new qx.ui.layout.VBox(5));
psVBox.setThemedFont("bold");
psVBox.setThemedPadding(2);
psVBox.setThemedBackgroundColor("#eef");
infoPage.add(psVBox);
psVBox.add(new qx.ui.basic.Label("Spoils"));
// Tiberium
this.tiberiumSpoils = new qx.ui.basic.Atom("0", "webfrontend/ui/common/icn_res_tiberium.png");
psVBox.add(this.tiberiumSpoils);
// Crystal
this.crystalSpoils = new qx.ui.basic.Atom("0", "webfrontend/ui/common/icn_res_chrystal.png");
psVBox.add(this.crystalSpoils);
// Credits
this.creditSpoils = new qx.ui.basic.Atom("0", "webfrontend/ui/common/icn_res_dollar.png");
psVBox.add(this.creditSpoils);
// Research
this.researchSpoils = new qx.ui.basic.Atom("0", "webfrontend/ui/common/icn_res_research_mission.png");
psVBox.add(this.researchSpoils);
this.battleResultsBox.add(tabView);
this.buttonProTools = new qx.ui.form.Button("Tools");
this.buttonProTools.set({width: 80, appearance: "button-text-small", toolTipText: "Open Simulator Tools"});
this.buttonProTools.addListener("click", this.togglePro, this);
armyBar.add(this.buttonProTools, {top: 17, right: 0});
},
updateLayoutsList: function() {
this.layoutsList.removeAll();
// Load the saved layouts for this city
var layouts = this.loadCityLayouts();
if (layouts) {
for (var i in layouts) {
var layout = layouts[i];
var item = new qx.ui.form.ListItem(layout.label, null, layout.id);
this.layoutsList.add(item);
};
}
},
deleteCityLayout: function() {
try {
var layouts = this.loadLayouts();
var current_city = ClientLib.Data.MainData.GetInstance().get_Cities() .get_CurrentCity().get_Id();
var lid = this.layoutsList.getSelection()[0].getModel();
if (layouts && typeof layouts[current_city] != 'undefined' && typeof layouts[current_city][lid] != 'undefined') {
delete layouts[current_city][lid];
this.saveLayouts(layouts);
this.updateLayoutsList();
}
}
catch (e) {
console.log(e);
}
},
loadCityLayout: function() {
try {
var layouts = this.loadCityLayouts();
var lid = this.layoutsList.getSelection()[0].getModel();
if (layouts && typeof layouts[lid] != 'undefined') {
// Load the selected city layout
var saved_units = layouts[lid].layout;
this.restoreFormation(saved_units);
}
}
catch (e) {
console.log(e);
}
},
saveCityLayout: function() {
try {
// Save the current layout for this city
var current_city = ClientLib.Data.MainData.GetInstance().get_Cities() .get_CurrentCity().get_Id();
var layouts = this.loadLayouts();
this.saveFormation();
var lid = new Date().getTime().toString();
var title = this.layoutsLabelText.getValue();
title += " (TS: " + this.lastPercentage.toFixed(2).toString() + ")";
var city_layouts = this.loadCityLayouts();
if (!layouts.hasOwnProperty(current_city)) {
layouts[current_city] = city_layouts;
}
layouts[current_city][lid] = {
id: lid,
label: title,
layout: this.saved_units,
};
this.saveLayouts(layouts);
this.updateLayoutsList();
this.layoutsLabelText.setValue("");
}
catch (e) {
console.log(e);
}
},
loadLayouts: function() {
var temp = localStorage.tasim_city_layouts;
if (temp) {
return JSON.parse(temp);
}
return {};
},
loadCityLayouts: function() {
var temp = localStorage.tasim_city_layouts;
if (temp) {
var layouts = JSON.parse(temp);
var current_city = ClientLib.Data.MainData.GetInstance().get_Cities() .get_CurrentCity().get_Id();
if (layouts.hasOwnProperty(current_city)) {
return layouts[current_city];
}
}
return {};
},
saveLayouts: function(layouts) {
// TODO - Add some kind of global layout support
// TODO - Remove cities that are no longer existing
// TODO - There should be another key for the attacking city
localStorage.tasim_city_layouts = JSON.stringify(layouts);
},
calculateLoot: function() {
// Adapted from the CNC Loot script:
var city = ClientLib.Data.MainData.GetInstance().get_Cities() .get_CurrentCity();
var num = city.m_CityBuildings.m_BuildSlotsCurrent;
var spoils = {
1: 0,
2: 0,
3: 0,
6: 0,
7: 0
};
for (var j=num; --j >= 0; ) {
var building = city.m_CityBuildings.m_Buildings.l[j];
var mod = building.m_CurrentHealth / building.m_MaxHealth;
for(var i=building.m_UnitLevelRequirements.rer.length; --i >= 0 {
spoils[building.m_UnitLevelRequirements.rer[i].t] += mod * building.m_UnitLevelRequirements.rer[i].c;
}
}
if(city.m_CityUnits.m_DefenseUnits != null) {
num = city.m_CityUnits.m_DefenseUnits.l.length;
for (j=num; --j >= 0; ) {
var unit = city.m_CityUnits.m_DefenseUnits.l[j];
mod = unit.m_CurrentHealth / unit.m_MaxHealth;
for(i=unit.m_UnitLevelRequirements.rer.length; --i >= 0 {
spoils[unit.m_UnitLevelRequirements.rer[i].t] += mod * unit.m_UnitLevelRequirements.rer[i].c;
}
}
}
this.tiberiumSpoils.setLabel(this.formatNumberWith Commas(spoils[1]));
this.crystalSpoils.setLabel(this.formatNumberWithC ommas(spoils[2]));
this.creditSpoils.setLabel(this.formatNumberWithCo mmas(spoils[3]));
this.researchSpoils.setLabel(this.formatNumberWith Commas(spoils[6]));
},
getCityPreArmyUnits: function() {
var armyBar = qx.core.Init.getApplication().getUIItem(ClientLib. Data.Missions.PATH.BAR_ATTACKSETUP);
var units = null;
for (var key in armyBar) {
try {
if (armyBar[key] instanceof ClientLib.Data.CityPreArmyUnits) {
units = armyBar[key];
break;
}
}
catch (e) {
}
}
return units;
},
closeProBox: function() {
try {
var units = this.getCityPreArmyUnits();
if (units) {
units.remove_ArmyChanged(this.add_ArmyChanged);
}
this.battleResultsBox.close();
}
catch(e) {
console.log(e);
}
},
togglePro: function() {
var units = this.getCityPreArmyUnits();
this.units = units.m_ArmyUnits.l;
if (this.battleResultsBox.isVisible()) {
this.closeProBox();
}
else {
// Add the event listener for armybar
try {
units.add_ArmyChanged(this.add_ArmyChanged);
}
catch (e) {
console.log(e);
}
this.updateLayoutsList();
this.calculateLoot();
this.updateProWindow();
this.battleResultsBox.open();
}
},
optimizeLayout: function() {
try {
// First, get the CityPreArmyUnits
var units = this.getCityPreArmyUnits();
if (this.optimizing) {
this.optimizingDone(false);
this.updateFormation();
}
else {
this.battleResultsBox.setModal(true);
this.battleResultsBox.setAllowClose(false);
this.buttonOptimize.setLabel("Stop");// Cancel means that all changes will be restored back
this.ajaxImage.setVisibility("visible");
this.optimizing = true;
// Set the current primary and secondary targets
this.updateProWindow();
this.setTargets();
this.degree = parseInt(this.degreeSelect.getSelection()[0].getModel());
this.found_improvement = false;
this.checkBetterFormation();
}
}
catch(e) {
console.log(e);
}
},
optimizingDone: function(cancelled) {
if (cancelled == null) {
var continuous = this.continuousCheckBox.getValue();
var play_sound = this.soundCheckBox.getValue();
}
else {
var play_sound = false;
var continuous = false;
}
if (continuous && this.found_improvement) {
this.optimizing = false;
this.optimizeLayout();
}
else {
this.buttonOptimize.setLabel("Optimize");
this.battleResultsBox.setAllowClose(true);
this.battleResultsBox.setModal(false);
this.optimizing = false;
this.ajaxImage.setVisibility("none");
return false;
},
moveLoop: function() {
ta = window.TASuite.main.getInstance();
if (!ta.optimizing) {
return;
}
// First check if this move is legal
var unit = ta.currentUnit;
var x = unit.get_CoordX();
var y = unit.get_CoordY();
var degree = ta.degree;
var dx = ta.currentDx;
var dy = ta.currentDy;
dx -= 1;
new_x = dx + x;
new_y = dy + y;
if (dy == 0 && dx == 0) {
dx -= 1;
}
else {
if (new_x >= 0 && new_x < 8) {
if (new_y >= 0 && new_y < 4) {
// Move the unit
// TODO - First, check if the unit is a different type or level
/*
var other_unit = units.GetUnitByCoord(new_x,new_y);
console.log(other_unit);
console.log(unit);
console.log(units);
*/
unit.MoveBattleUnit(new_x, new_y);
if (ta.checkNewResults()) {
ta.updateFormation();
ta.nextUnit();
return;
}
else {
unit.MoveBattleUnit(x, y);
}
}
}
}
if (dx < -degree || dx < 0) {
dx = degree;
dy -= 1;
if (dy < -degree || dy < 0) {
ta.nextUnit();
return;
}
}
// If we are still on this unit, then set the dx and dy and schedule another iteration
ta.currentDx = dx;
ta.currentDy = dy;
setTimeout(ta.moveLoop, 10);
},
nextUnit: function() {
// Set the next unit if this isn't the last one, and start the loop again
if (this.units_list.length > 0) {
this.currentDx = this.degree;
this.currentDy = this.degree;
this.currentUnit = this.units[this.units_list.pop()];
setTimeout(this.moveLoop, 10);
}
else {
// Subtract the degree and start over
this.degree -= 1;
if (this.degree > 0) {
this.checkBetterFormation();
}
else {
this.optimizingDone();
this.updateFormation();
}
}
},
setTargets: function() {
var p = this.primarySelect.getSelection()[0].getModel();
var s = this.secondarySelect.getSelection()[0].getModel();
var t = this.tertiarySelect.getSelection()[0].getModel();
this.currentPrimary = this.lastPrimary;
this.currentSecondary = this.lastSecondary;
this.currentTertiary = this.lastTertiary;
},
getTarget: function(key) {
// i will add some options soon
switch (key) {
case 'DF':// enemyDF -1
return this.lastDFPercentage;
case 'CY':// enemyCY -1
return this.lastCYPercentage;
case 'RT':// attackerRT -1
return this.lastRepairTime;
case 'TS':// attacker Overall +1
return this.lastPercentage;
case 'ES':// enemyBase -1
return this.lastEnemyPercentage;
case 'BT':// battleTime -1
return this.totalSeconds;
}
},
compareTargets: function() {
// simplyfied
var np = -1;
var ns = -1;
var nt = -1;
var p = this.primarySelect.getSelection()[0].getModel();
var s = this.secondarySelect.getSelection()[0].getModel();
var t = this.tertiarySelect.getSelection()[0].getModel();
// Check if the primary should be negated
switch (p) {
case 'TS':
np = 1;
break;
}
switch (s) {
case 'TS':
ns = 1;
break;
}
switch (t) {
case 'TS':
nt = 1;
break;
}
this.lastPrimary = this.getTarget(p);
this.lastSecondary = this.getTarget(s);
this.lastTertiary = this.getTarget(t);
// Check if the primary is higher, if so, return true
if ((this.lastPrimary * np) > (this.currentPrimary * np)) {
return true;
}
else if ((this.lastPrimary * np) == (this.currentPrimary * np)) {
// Check if the primary is equal, if so, check the secondary
if ((this.lastSecondary * ns) > (this.currentSecondary * ns)) {
return true;
}
else if ((this.lastSecondary * ns) == (this.currentSecondary * ns)) {
if ((this.lastTertiary * nt) > (this.currentTertiary * nt)) {
return true;
}
}
}
// Calculate the repair time
var own_city = ClientLib.Data.MainData.GetInstance().get_Cities() .get_CurrentOwnCity();
var crd = own_city.get_CityRepairData();
var repair_times = own_city.m_CityUnits.m_FullRawRepairTimeForUnitGro upTypes.d;
var r_types = ClientLib.Base.EResourceType;
// going to print these times
this.lastInfantryRepairTime = crd.ConvertRepairCost$0(r_types.RepairChargeInf, repair_times[ClientLib.Data.EUnitGroup.Infantry], (1 - this.lastInfantryPercentage / 100));
this.lastAircraftRepairTime = crd.ConvertRepairCost$0(r_types.RepairChargeAir, repair_times[ClientLib.Data.EUnitGroup.Aircraft], (1 - this.lastAirPercentage / 100));
this.lastVehicleRepairTime = crd.ConvertRepairCost$0(r_types.RepairChargeVeh, repair_times[ClientLib.Data.EUnitGroup.Vehicle], (1 - this.lastVehiclePercentage / 100));
this.lastRepairTime = Math.max(this.lastVehicleRepairTime, this.lastAircraftRepairTime, this.lastInfantryRepairTime);
},
updateFormation: function() {
this.restoreFormation();
},
onViewChange: function(oldMode, newMode) {
try {
if (newMode == webfrontend.gui.PlayArea.PlayArea.modes.EMode_Comb atSetupDefense) {
var current_city = ClientLib.Data.MainData.GetInstance().get_Cities() .get_CurrentCity().get_Id();
if (localStorage.ta_sim_last_city != current_city) {
// Reset the battleground
this.bustCache();
}
this.setupBattleground();
}
if (newMode == webfrontend.gui.PlayArea.PlayArea.modes.EMode_Play erDefense) {
this.closeProBox();
}
}
catch(e) {
console.log(e);
if (newMode == webfrontend.gui.PlayArea.modes.EMode_CombatSetupDe fense) {
var current_city = ClientLib.Data.MainData.GetInstance().get_Cities() .get_CurrentCity().get_Id();
if (localStorage.ta_sim_last_city != current_city) {
// Reset the battleground
this.bustCache();
}
this.setupBattleground();
}
if (newMode == webfrontend.gui.PlayArea.modes.EMode_PlayerDefense ) {
this.closeProBox();
}
}
},
onUnitMoved: function(sender, e) {
if (!this.optimizing) {
window.TASuite.main.getInstance().updateProWindow( );
}
},
onDamageDone: function(sender, e) {
// Try to update the Troop Strength meter
try {
battleground = sender.DamageDone.i[0].o;
// For the sake of performance, only run this every 10th step
if (battleground.m_CurrentStep % 10 == 0) {
window.TASuite.main.getInstance().updateTroopStren gth(battleground);
}
}
catch (e) {
console.log(e);
}
},
onDefenseDestroyed: function(sender, e) {
// Try to update the Troop Strength meter
try {
battleground = sender.DamageDone.i[0].o;
window.TASuite.main.getInstance().updateTroopStren gth(battleground);
}
catch (e) {
console.log(e);
}
},
calculateSimResults: function() {
var battleground = this.setupBattleground(this.getCityPreArmyUnits()) ;
// Run the simulation until it's done
while (battleground.m_Simulation.DoStep$0(false)) { }
this.calculateTroopStrengths(battleground);
this.lastVictory = battleground.m_Simulation.m_bDestroyDefense;
},
setLabelColor: function (obj, val, dir) {
var colors = ['black', 'blue', 'green', 'red'];
var color = colors[0];
var v = val;
if (dir >= 0) v = 100.0 - v;
if (v > 99.99) color = colors[3];
else if (v > 50) color = colors[2];
else if (v > 0) color = colors[1];
obj.setTextColor(color);
},
updateLabel100: function (obj, val, dir) {
this.setLabelColor(obj, val, dir);
obj.setValue(val.toFixed(2).toString());
},
updateLabel100time: function (obj, val, dir, time) {
var s = val.toFixed(2).toString() + " @ ";
s += this.formatSecondsAsTime(time, "h:mm:ss");
this.setLabelColor(obj, val, dir);
obj.setValue(s);
},
updateProWindow: function() {
this.calculateSimResults();
var colors = ['black', 'blue', 'green', 'red'];
var s = "";
var n = 0;
// VICTORY
if (this.lastCYPercentage == 0) {
s = "Total Victory";
n = 0;
}
else if (this.lastEnemyBuildingsPercentage < 100) {
s = "Victory";
n = 1;
}
else {
s = "Total Defeat";
n = 3;
}
this.simVictoryLabel.setValue(s);
this.simVictoryLabel.setTextColor(colors[n]);
// i'll clear it
// ENEMY
// -BASE
// this.updateLabel100(this.enemyBaseStrengthLabel, this.lastEnemyOverallPercentage, -1);// new names
this.updateLabel100(this.enemyTroopStrengthLabel, this.lastEnemyPercentage, -1);// current names
// -DEFENCES
// this.updateLabel100(this.enemyDefencesStrengthLabe l, this.lastEnemyDefencesPercentage, -1);
this.updateLabel100(this.enemyUnitsStrengthLabel, this.lastEnemyUnitsPercentage, -1);
// -BUILDINGS
// this.updateLabel100(this.enemyBuildingsStrengthLab el, this.lastEnemyBuildingsPercentage, -1);
this.updateLabel100(this.enemyBuildingsStrengthLab el, this.lastEnemyBuildingsPercentage, -1);
// this.updateLabel100(this.CYTroopStrengthLabel, this.lastEnemyCYPercentage, -1);//enemyCYStrengthLabel
this.updateLabel100(this.CYTroopStrengthLabel, this.lastCYPercentage, -1);
// this.updateLabel100(this.DFTroopStrengthLabel, this.lastEnemyDFPercentage, -1);//enemyDFStrengthLabel
this.updateLabel100(this.DFTroopStrengthLabel, this.lastDFPercentage, -1);
// -SUPPORT There is no label yet
// this.updateLabel100(this.enemySupportLabel, this.lastSupportPercentage, -1);
// var SLabel = (this.SupportLevel > 0) ? this.SupportLevel.toString() : '--';
// this.lvlSupportLabel.setValue('Suport lvl ' + SLabel + ': ');
// ATTACKER
// RepairTime
// this.setLabelColor(this.simRepairTimeLabel, this.lastRepairTime / 14400, -1);//max is 4h
// this.simRepairTimeLabel.setValue(this.formatSecond sAsTime(this.lastRepairTime, "h:mm:ss"));
this.setLabelColor(this.simRepairTimeLabel, this.lastRepairTime / 14400.0, -1);//max is 4h
this.simRepairTimeLabel.setValue(this.formatSecond sAsTime(this.lastRepairTime, "h:mm:ss"));
// OVERALL
// this.updateLabel100(this.simTroopLabel, this.lastTroopStrengthPercentage, 1);
this.updateLabel100(this.simTroopDamageLabel, this.lastPercentage, 1);
// INF
// this.updateLabel100time(this.infantryTroopStrength Label, this.lastInfantryPercentage, 1, this.lastInfantryRepairTime);
this.updateLabel100time(this.infantryTroopStrength Label, this.lastInfantryPercentage, 1, this.lastInfantryRepairTime);
// VEH
// this.updateLabel100time(this.vehicleTroopStrengthL abel, this.lastVehiclePercentage, 1, this.lastVehicleRepairTime);
this.updateLabel100time(this.vehicleTroopStrengthL abel, this.lastVehiclePercentage, 1, this.lastVehicleRepairTime);
// AIR
// this.updateLabel100time(this.aircraftTroopStrength Label, this.lastAircraftPercentage, 1, this.lastAircraftRepairTime);
this.updateLabel100time(this.airTroopStrengthLabel , this.lastAirPercentage, 1, this.lastAircraftRepairTime);
// BATTLE TIME
// this.setLabelColor(this.simBattleTimeLabel, this.totalBattleTime / 120, -1);//max is 120s
// this.simBattleTimeLabel.setValue(this.totalBattleT ime.toFixed(2).toString());
this.setLabelColor(this.simTimeLabel, this.totalSeconds / 120.0, -1);//max is 120s
this.simTimeLabel.setValue(this.totalSeconds.toFix ed(2).toString());
},
formatNumberWithCommas: function(x) {
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
},
formatSecondsAsTime: function(secs, format) {
var hr = Math.floor(secs / 3600);
var min = Math.floor((secs - (hr * 3600))/60);
var sec = Math.floor(secs - (hr * 3600) - (min * 60));
if (hr < 10) { hr = "0" + hr; }
if (min < 10) { min = "0" + min; }
if (sec < 10) { sec = "0" + sec; }
if (format != null) {
var formatted_time = format.replace('hh', hr);
formatted_time = formatted_time.replace('h', hr*1+"");
formatted_time = formatted_time.replace('mm', min);
formatted_time = formatted_time.replace('m', min*1+"");
formatted_time = formatted_time.replace('ss', sec);
formatted_time = formatted_time.replace('s', sec*1+"");
return formatted_time;
}
else {
return hr + ':' + min + ':' + sec;
}
},
unlockAttacks: function() {
var armyBar = qx.core.Init.getApplication().getUIItem(ClientLib. Data.Missions.PATH.BAR_ATTACKSETUP);
armyBar.remove(this.buttonUnlockAttack);
var _this = this;
setTimeout(function() { armyBar.add(_this.buttonUnlockAttack); }, 2000);
},
returnSetup: function() {
// Set the scene again, just in case it didn't work the first time
var app = qx.core.Init.getApplication();
var player_cities =ClientLib.Data.MainData.GetInstance().get_Cities( );
var current_city = player_cities.get_CurrentCity();
try {
app.getPlayArea().setView(webfrontend.gui.PlayArea .PlayArea.modes.EMode_CombatSetupDefense, localStorage.ta_sim_last_city, 0, 0);
}
catch (e) {
app.getPlayArea().setView(webfrontend.gui.PlayArea .modes.EMode_CombatSetupDefense, localStorage.ta_sim_last_city, 0, 0);
}
},
calculateTroopStrength: function(battleground) {
var total_hp = 0;
var end_hp = 0;
for (i in battleground.m_Entities.d) {
var entity = battleground.m_Entities.d[i];
if (entity.get_Entity$0().m_eAlignment == SharedLib.Combat.ECbtAlignment.Attacker) {
// This is one of the good guys
total_hp += entity.m_Entity.m_iHitpoints;
end_hp += entity.m_Entity.m_iHitpointsCurrent;
}
}
// Add the event listeners
battleground.m_Simulation.add_DamageDone$0((new System.EventHandler).$ctor(this, this.onDamageDone));
battleground.m_Simulation.add_OnDestroyDefense$0(( new System.EventHandler).$ctor(this,this.onDefenseDest royed));
// Set the scene again, just in case it didn't work the first time
try {
app.getPlayArea().setView(webfrontend.gui.PlayArea .PlayArea.modes.EMode_CombatReplay, current_city.get_Id(), 0, 0);
}
catch (e) {
app.getPlayArea().setView(webfrontend.gui.PlayArea .modes.EMode_CombatReplay, current_city.get_Id(), 0, 0);
}
}
catch (e) {
console.log(e);
}
}
}
});
}
function TASuite_checkIfLoaded() {
try {
if (typeof qx != 'undefined') {
a = qx.core.Init.getApplication(); // application
mb = qx.core.Init.getApplication().getMenuBar();
if (a && mb) {
createTweak();
window.TASuite.main.getInstance().initialize();
} else
window.setTimeout(TASuite_checkIfLoaded, 1000);
} else {
window.setTimeout(TASuite_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)) {
window.setTimeout(TASuite_checkIfLoaded, 1000);
}
}
// injecting, because there seem to be problems when creating game interface with unsafeWindow
var TASuiteScript = document.createElement("script");
var txt = TASuite_mainFunction.toString();
TASuiteScript.innerHTML = "(" + txt + ")();";
TASuiteScript.type = "text/javascript";
if (/commandandconquer\.com/i.test(document.domain)) {
document.getElementsByTagName("head")[0].appendChild(TASuiteScript);
}
Hm, also wer sich mit Coden auskennt... hier ist ein Script (leider veraltet) welches die Auto Aufstellung haben sollte. Es ist wie gesagt veraltet und ich habe keine Ahnung was man alles ändern müsste damit es wieder funktioniert.
Wenn es einer von euch schaffen sollte es anzupassen, bitte eine Kopie an mich (werde sie auch nicht verbreiten wenn du es nicht willst):
hi, auch Ich suche schon LAAANGE nach dem Scipt Combat Sims gibts ja genug, nur leider keins das selbstständig Simt. um die beste Formation zu finden, das einzigste war das Pro das leider nicht weiter entwickelt wurde ( is hier niemand der sowas wie es im Pro war in ein vorhandenes Script einbauen kann ??
Command and Conquer Tiberium Alliances 01/27/2013 - Browsergames - 17 Replies Hallo gibt es irgend etwas für das Spiel Command and Conquer Tiberium Alliances ?
Command & Conquer Tiberium Alliances 20.09.2012 12/26/2012 - Browsergames - 7 Replies "neuer" Code vom 20.09.2012 CAMD-XLLA-9Q63-ETTG
4 Energie-Pakete (jeweils einmal 500, 3.000, 15.000 und 40.000 Einheiten)
4 Tiberium-Pakete (jeweils einmal 1.000, 6.000, 30.000 und 80.000 Einheiten)
4 Kristall-Pakete (jeweils einmal 1.000, 6.000, 30.000 und 80.000 Einheiten)
4 Credit-Pakete (jeweils einmal 750, 4.000, 22.500 und 60.000 Einheiten)
1 Ressourcen-Paket-Menge +1 für eine Woche auf allen Basen
12 Kommandopunkte
Quelle http://command-and-conquer.browsergames.de/
Command & Conquer Tiberium Alliances: Erreicht über 1 Millionen Fans 11/28/2012 - User Submitted News - 3 Replies Zwei Monate sind vergangen seit Command & Conquer Tiberium Alliances im Handel erschienen ist, haben sich mehr als 1 Millionen Menschen das Spiel gekauft und spielen es Aktiv, zu diesem Anlass verschenkt Electronic Arts 1.000.000 Starter Kits an alle Spieler.
Alle, die ein solches Starter Kit besitzen wollen, können sich bis zum 20. Juli 2012 anmelden oder ein Konto erstellen, um dann den folgenden Code: HMKV-VWGN-8GEH-6BTZ auf der Homepage einzulösen.
Das Starter Kit beinhaltet folgendes:...
Command & Counqer Tiberium Alliances [Suche TS3] 11/23/2012 - Browsergames - 1 Replies Hallo,
Führe auf Welt 10 eine Gute ALllianz und bräuchte einen TeamSpeak Server ...
Ich möchte mir keinen zulegen oder mieten sondern benutzen.
Falls jemand von euch sowas macht,vil. wenn zu wenig los ist etc.
Bitte einfach hier schreiben.
MfG
Command and Conquer Tiberium Alliances Cheats/Hacks? 06/19/2012 - General Gaming Discussion - 5 Replies Hallo liebes epvp ,
ich wollte mal ganz lieb nachfragen es z.z schon Cheats sprich Hacks
für das neue (command and conquer tiberium alliances) gibt?
Mehr Kristalle ,mehr Money oder sonnstiges wäre ja schon was feines^^.
Ich würde mich sehr über eine schnelle Antwort von euch freuen.