Hallo liebe Admins ist es jetzt nach 6 Jahren mal möglich das ihr euch darum kümmert ich liefere euch auch die ganze Flotten.js Fehler mit Behebung denn ihr habt maxResources() keine richtige Funktion zur Nebenrechnung der Kapazität etc. hinzugefügt.
Achtung der Code enthält ein bisschen mehr das müsst ihr mit eueren Variablen abgleichen und lasst euch die Seite ohne Übersetzer anzeigen sonst fuscht der im code block herum.
/* =========================================================
SMART MAX RESOURCES – GESAMT
========================================================= */
function maxResources() {
var totalCapacity = getMaxCargoCapacity();
var remainingCapacity = totalCapacity;
var inputs = {
metal: resolveResourceInput('metal'),
crystal: resolveResourceInput('crystal'),
deuterium: resolveResourceInput('deuterium')
};
var order = ['deuterium', 'crystal', 'metal'];
// Reset
for (var key in inputs) {
if (Object.prototype.hasOwnProperty.call(inputs, key) && inputs[key]) {
inputs[key].value = 0;
}
}
for (var i = 0; i < order.length; i++) {
var resource = order[i];
var input = inputs[resource];
if (!input || remainingCapacity <= 0) {
if (input) input.value = 0;
continue;
}
var availableAmount = getAvailableResource(resource, input);
if (availableAmount <= 0) {
input.value = 0;
continue;
}
var loadAmount = Math.min(availableAmount, remainingCapacity);
input.value = loadAmount;
remainingCapacity -= loadAmount;
}
calculateTransportCapacity();
countDots();
}
/* =========================================================
TRANSPORT-KAPAZITÄT
========================================================= */
function calculateTransportCapacity() {
DotsToCount();
var metal = Math.abs(document.getElementsByName("metal")[0].value);
var crystal = Math.abs(document.getElementsByName("crystal")[0].value);
var deuterium = Math.abs(document.getElementsByName("deuterium")[0].value);
transportCapacity =
data.fleetroom - data.consumption - metal - crystal - deuterium;
if (transportCapacity < 0) {
document.getElementById("remainingresources").innerHTML =
'<font color="red">' + NumberGetHumanReadable(transportCapacity) + '</font>';
} else {
document.getElementById("remainingresources").innerHTML =
'<font color="lime">' + NumberGetHumanReadable(transportCapacity) + '</font>';
}
countDots();
return transportCapacity;
}
/* =========================================================
SCHIFFE
========================================================= */
function maxShip(id) {
if (document.getElementsByName(id)[0]) {
var amount = document.getElementById(id + "_value").innerHTML;
document.getElementsByName(id)[0].value = amount.replace(/\./g, "");
}
countDots();
colorSet();
fleetPoints();
}
function minShip(id) {
if (document.getElementsByName(id)[0]) {
document.getElementsByName(id)[0].value = 0;
}
countDots();
colorSet();
fleetPoints();
}
function setShip(id, count) {
if (document.getElementsByName(id)[0]) {
document.getElementsByName(id)[0].value = count;
}
countDots();
colorSet();
fleetPoints();
}
function maxShips() {
var id;
for (var i = 200; i < 250; i++) {
id = "ship" + i;
maxShip(id);
}
countDots();
colorSet();
fleetPoints();
}
function maxShipsBatle() {
var id;
for (var i = 200; i < 250; i++) {
id = "ship" + i;
if (i != 202 && i != 203 && i != 217 &&
i != 209 && i != 219 && i != 208 &&
i != 210 && i != 220 && i != 223) {
maxShip(id);
}
}
countDots();
colorSet();
fleetPoints();
}
function maxShipsTransports() {
maxShip("ship" + 202);
maxShip("ship" + 203);
maxShip("ship" + 217);
countDots();
colorSet();
fleetPoints();
}
function maxShipsProcessors() {
maxShip("ship" + 209);
maxShip("ship" + 219);
countDots();
colorSet();
fleetPoints();
}
function maxShipsSpecial() {
maxShip("ship" + 208);
maxShip("ship" + 210);
maxShip("ship" + 220);
maxShip("ship" + 223);
countDots();
colorSet();
fleetPoints();
}
function GroopShips(idGroop) {
var id;
for (var i = 200; i < 250; i++) {
id = "ship" + i;
var count = 0;
if (typeof fleetGroopShip[idGroop][i] !== "undefined") {
count = fleetGroopShip[idGroop][i];
}
setShip(id, count);
}
countDots();
colorSet();
fleetPoints();
}
function onSave() {
$('#save').show();
}
function noShip(id) {
if (document.getElementsByName(id)[0]) {
document.getElementsByName(id)[0].value = 0;
}
countDots();
colorSet();
fleetPoints();
}
function noShips() {
var id;
for (var i = 200; i < 250; i++) {
id = "ship" + i;
noShip(id);
}
colorSet();
fleetPoints();
}
function noShipsBatle() {
var id;
for (var i = 200; i < 250; i++) {
id = "ship" + i;
if (i != 202 && i != 203 && i != 217 &&
i != 209 && i != 219 && i != 208 &&
i != 210 && i != 220 && i != 223) {
noShip(id);
}
}
colorSet();
fleetPoints();
}
function noShipsTransports() {
noShip("ship" + 202);
noShip("ship" + 203);
noShip("ship" + 217);
colorSet();
fleetPoints();
}
function noShipsProcessors() {
noShip("ship" + 209);
noShip("ship" + 219);
colorSet();
fleetPoints();
}
function noShipsSpecial() {
noShip("ship" + 208);
noShip("ship" + 210);
noShip("ship" + 220);
noShip("ship" + 223);
colorSet();
fleetPoints();
}
function setNumber(name, number) {
if (typeof document.getElementsByName("ship" + name)[0] != "undefined") {
document.getElementsByName("ship" + name)[0].value = number;
}
}
bitte nehmt euch die 5 Minuten die das dauert das um zu setzen und repariert am ende noch die enter Taste bitte. da habt ihr die Funktion offen gelassen könnt ihr selbst im Browser nachvollziehen unter den entwicklertools.











