-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathweakenNetwork.ts
More file actions
24 lines (20 loc) · 829 Bytes
/
weakenNetwork.ts
File metadata and controls
24 lines (20 loc) · 829 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import {BitBurner as NS} from "Bitburner";
import {
DCRun,
getServers
} from "hhelper.js";
export async function main(ns) {
let servers = getServers(ns).filter(function(server) {
return (server.hasRoot && (server.secLvl > server.minSecLvl));
});
let processes: any = [];
servers.forEach(function(s) {
let reqReduction = s.secLvl - s.minSecLvl;
let threads = Math.ceil(reqReduction / 0.05);
//ns.tprint(`Need to weaken ${s.name} with ${threads} threads`);
processes.push({ "script": "1weaken.js", "threads": threads, "modules": 1, "args": s.name, "RAM": 1.75, "allowSplit": true });
});
//ns.tprint(`Launchind DCRun...`);
let dcResult = await DCRun(ns, processes, true);
ns.tprint(`Weakening: ${dcResult.success}, message: ${dcResult.result}`);
}