33 lines
1.2 KiB
JavaScript
33 lines
1.2 KiB
JavaScript
import { DistributeRunAndWait, drun, RunAndWait } from "./Library";
|
|
|
|
/** @param {NS} ns */
|
|
export async function main(ns) {
|
|
ns.tail();
|
|
|
|
const sServerListScript = "Serverlist.js";
|
|
const sGangScript = "RunGang.js";
|
|
const sPServScript = "purchaseServers.js";
|
|
const sBatchController = "EveryServerRun.js";
|
|
const sBackdoorScript = "backdoor.js";
|
|
const sUpdateTarget = "Updatebesttarget.js"
|
|
const sMonitorScript = "autoexec.js";
|
|
const sServerListFile = "serverList.txt";
|
|
const sBestServerFile = "bestTarget.txt";
|
|
const sWorkerList = "WorkerList.js";
|
|
const sCorpControl = "CorpControl.js";
|
|
|
|
await RunAndWait(ns, sServerListScript);
|
|
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 RunAndWait(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 (nHomeMaxRAM >= 256) { if (!ns.isRunning(sMonitorScript)) { ns.run(sMonitorScript); } }
|
|
*/
|
|
} |