grow helpers improvement

This commit is contained in:
2023-09-05 00:58:08 +02:00
parent 673abd49b2
commit 7b14e98658
25 changed files with 359 additions and 136 deletions
+1 -3
View File
@@ -26,8 +26,6 @@ export async function main(ns) {
while (maxMoney != 0) {
let currentMoney = ns.getServerMoneyAvailable(server);
let currentSecurity = ns.getServerSecurityLevel(server);
ns.print(`Money: ${currentMoney} / ${maxMoney}`);
ns.print(`Security: ${currentSecurity} / ${minSecurity}`);
let hackedMoney = 0;
if (currentMoney > 0.1 * maxMoney) {
@@ -48,7 +46,7 @@ export async function main(ns) {
currentSecurity = ns.getServerSecurityLevel(server);
}
await writeLog('LOG', `{server: '${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)}}`);
ns.print(`{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.sleep(50);
}
}