diff --git a/src/ezgame/cloud/upgrade-all.ts b/src/ezgame/cloud/upgrade-all.ts index 009445c..f606f57 100644 --- a/src/ezgame/cloud/upgrade-all.ts +++ b/src/ezgame/cloud/upgrade-all.ts @@ -21,6 +21,8 @@ export const upgradeAll = (ns: NS) => { const ram = Math.pow(2, pow); let totalCost = 0; for (const serverName of cloudServerNames) { + const currentRam = ns.getServerMaxRam(serverName); + if (currentRam >= ram) continue; // already at or above this tier, no cost const upgradeCost = ns.cloud.getServerUpgradeCost(serverName, ram); if (upgradeCost === -1) { totalCost = Infinity; diff --git a/src/ezgame/startall.ts b/src/ezgame/startall.ts index 42928f4..47f3054 100644 --- a/src/ezgame/startall.ts +++ b/src/ezgame/startall.ts @@ -53,8 +53,8 @@ export const startall = (ns: NS, scriptName: string, options: StartOptions = {}) ns.tprint(`Hosts affected: ${hostsStartedOn}`); }; -// export const main = (ns: NS) => { -// // get the arguments from the command line -// const args = ns.args as string[]; -// startall(ns, "super.js", { args: args }); -// }; +export const main = (ns: NS) => { + // get the arguments from the command line + const args = ns.args as string[]; + startall(ns, "super.js", { args: args }); +}; diff --git a/src/test.ts b/src/test.ts index 9a68d11..8358873 100644 --- a/src/test.ts +++ b/src/test.ts @@ -2,5 +2,7 @@ import { NS } from "@ns"; import { cloud } from "./ezgame/cloud"; export const main = (ns: NS) => { + const upgradeCost = ns.cloud.getServerUpgradeCost("worker-1", 2); + console.log(upgradeCost); cloud.upgradeAll(ns); };