bitnode1
This commit is contained in:
+5
-5
@@ -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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user