added { entry.serverOrgs = "" } { entry.serverCores = 1 } { entry.serverFiles = [] } to purchaseAndUpgradeServers(ns) in Library.js
This commit is contained in:
@@ -13,19 +13,24 @@ export async function main(ns) {
|
||||
const sMonitorScript = "autoexec.js";
|
||||
const sServerListFile = "serverList.txt";
|
||||
const sBestServerFile = "bestTarget.txt";
|
||||
const sWorkerList = "WorkerList.js";
|
||||
|
||||
await RunAndWait(ns, sServerListScript);
|
||||
|
||||
/*
|
||||
const oServerList = JSON.parse(ns.read(sServerListFile));
|
||||
const oHome = oServerList["home"];
|
||||
const nHomeMaxRAM = oHome.maxRam;
|
||||
ns.print("nHomeMaxRAM = " + nHomeMaxRAM);
|
||||
*/
|
||||
let oServerlist = JSON.parse(ns.read(sServerListFile));
|
||||
let nHomeMaxRAM = oServerlist.find((entry) => entry.serverName === "home").maxRam;
|
||||
ns.print("nHomeMaxRAM = " + nHomeMaxRAM);
|
||||
|
||||
if (!ns.isRunning(sGangScript)) { ns.run(sGangScript); }
|
||||
if (!ns.isRunning(sPServScript)) { ns.run(sPServScript); }
|
||||
await RunAndWait(ns, sBackdoorScript);
|
||||
await RunAndWait(ns, sUpdateTarget);
|
||||
await RunAndWait(ns, sBatchController);
|
||||
//await RunAndWait(ns, sBatchController);
|
||||
|
||||
if (nHomeMaxRAM >= 256) { if (!ns.isRunning(sMonitorScript)) { ns.run(sMonitorScript); } }
|
||||
}
|
||||
Reference in New Issue
Block a user