This commit is contained in:
2023-08-29 03:50:21 +02:00
parent af84e9b05f
commit 673abd49b2
9 changed files with 133 additions and 130 deletions
+5 -5
View File
@@ -14,7 +14,7 @@
export async function main(ns) {
// ns.disableLog('ALL');
async function writeLog(type, obj) {
let timeNow = new Date();
let year = timeNow.getFullYear().toString().substring(2);
@@ -25,7 +25,7 @@ export async function main(ns) {
let second = (timeNow.getSeconds() < 10 ? '0' : '') + timeNow.getSeconds();
let timestamp = `${year}${month}${day}_${hour}${minute}${second}`;
await ns.tryWritePort(2, `t${timestamp}_${type} = ${obj};\n`);
if (['ERROR', 'TERMINAL'].indexOf(type) != -1) ns.tprint(`${timestamp} ${type} = ${obj}`);
}
@@ -117,13 +117,13 @@ export async function main(ns) {
result.concat(scanServer(nextServer, currentServer));
}
}
return [currentServer].concat(result);
}
while(true){
while (true) {
let network = scanServer('home');
await sleep(100);
await ns.sleep(100);
}
}