Mizzajl/home/wip/hgw.js
This commit is contained in:
13
Mizzajl/home/ShareHome.js
Normal file
13
Mizzajl/home/ShareHome.js
Normal 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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user