/** @param {NS} ns */ export async function main(ns) { const bKill = ns.args[0]; // if true kill all existing processess const sShareScript = "factionboost.js"; if (bKill) { ns.killall("home"); } else { ns.scriptKill(sShareScript, "home"); } let nShare = Math.floor(((ns.getServerMaxRam("home") - ns.getServerUsedRam("home")) / ns.getScriptRam(sShareScript))); if (nShare > 0) { ns.exec(sShareScript, "home", nShare); } }