update
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { RunAndWait } from "./Library";
|
||||
import { DistributeRunAndWait, drun, RunAndWait } from "./Library";
|
||||
|
||||
/** @param {NS} ns */
|
||||
export async function main(ns) {
|
||||
@@ -14,23 +14,18 @@ export async function main(ns) {
|
||||
const sServerListFile = "serverList.txt";
|
||||
const sBestServerFile = "bestTarget.txt";
|
||||
const sWorkerList = "WorkerList.js";
|
||||
const sCorpControl = "CorpControl.js";
|
||||
|
||||
await RunAndWait(ns, sServerListScript);
|
||||
/*
|
||||
const oServerList = JSON.parse(ns.read(sServerListFile));
|
||||
const oHome = oServerList["home"];
|
||||
const nHomeMaxRAM = oHome.maxRam;
|
||||
ns.print("nHomeMaxRAM = " + nHomeMaxRAM);
|
||||
*/
|
||||
if (!ns.isRunning(sWorkerList)) { ns.run(sWorkerList); }
|
||||
if (!ns.isRunning(sGangScript)) { drun(ns, sGangScript); }
|
||||
//if (!ns.isRunning(sCorpControl)) { ns.run(sCorpControl); }
|
||||
if (!ns.isRunning(sPServScript)) { drun(ns, sPServScript); }
|
||||
await DistributeRunAndWait(ns, sBackdoorScript);
|
||||
await DistributeRunAndWait(ns, sUpdateTarget);
|
||||
|
||||
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);
|
||||
|
||||
if (nHomeMaxRAM >= 256) { if (!ns.isRunning(sMonitorScript)) { ns.run(sMonitorScript); } }
|
||||
}
|
||||
Reference in New Issue
Block a user