save backup

This commit is contained in:
2022-09-11 05:03:16 +02:00
parent 7b393a7ffc
commit 3529597fb0
10 changed files with 71 additions and 9 deletions
+4 -4
View File
@@ -1,7 +1,7 @@
/** @param {import(".").NS } ns */
export async function main(ns) {
// ns.disableLog('ALL');
ns.disableLog('ALL');
let excludeServers = ['home'];
for (let index = 0; index < 25; index++) {
@@ -9,7 +9,7 @@ export async function main(ns) {
}
excludeServers.push('CSEC');
excludeServers.push('avmnite-02h');
async function scanServer(currentServer, maxDepth = Number.MAX_SAFE_INTEGER, depth = 1, previousServer = currentServer) {
if (depth <= maxDepth) {
let availableServers = ns.scan(currentServer);
@@ -32,11 +32,11 @@ export async function main(ns) {
}
await ns.sleep(10);
}
let runDepth = ns.args.length ? ns.args[0] : 1;
while (true) {
let runDepth = ns.args.length ? ns.args[0] : 1;
ns.tprint(`Running scan depth: ${runDepth}`);
ns.print(`Running scan depth: ${runDepth}`);
await scanServer('home', runDepth);
}
}