Mizzajl/home/wip/hgw.js

This commit is contained in:
2024-10-07 18:55:53 +02:00
parent b7425cbe13
commit 860f3fa455
12 changed files with 154 additions and 22 deletions

13
Mizzajl/home/ShareHome.js Normal file
View File

@@ -0,0 +1,13 @@
/** @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);
}
}