grow helpers improvement
This commit is contained in:
+1
-3
@@ -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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user