log to file

This commit is contained in:
2022-09-10 06:31:43 +02:00
parent 71b3500d45
commit b0abc2a614
2 changed files with 12 additions and 8 deletions
+1 -1
View File
@@ -29,7 +29,7 @@ export async function main(ns) {
hackedMoney = await ns.hack(server);
}
ns.tprint(`{${server}: {loop: ${++loop}, hack: ${Math.floor(hackedMoney)}, money: ${Math.floor(currentMoney)} / ${Math.floor(maxMoney)} = ${((currentMoney / maxMoney) * 100).toFixed(2)}, security: ${currentSecurity.toFixed(2)} / ${Math.floor(minSecurity) } = ${((currentSecurity / minSecurity) * 100).toFixed(4)}}}`);
await ns.tryWritePort(1, `${server} = {loop: ${++loop}, hack: ${Math.floor(hackedMoney)}, money: "${Math.floor(currentMoney)} / ${Math.floor(maxMoney)} = ${((currentMoney / maxMoney) * 100).toFixed(2)}", security: "${currentSecurity.toFixed(2)} / ${Math.floor(minSecurity) } = ${((currentSecurity / minSecurity) * 100).toFixed(4)}"};\n`);
await ns.sleep(10);
}
}