This commit is contained in:
Zakary Timson 2022-04-28 17:24:59 -04:00
parent 4df3a889e2
commit 1f0810e507
2 changed files with 3 additions and 3 deletions

View File

@ -1,7 +1,7 @@
import {ArgParser} from '/scripts/lib/arg-parser'; import {ArgParser} from '/scripts/lib/arg-parser';
import {availableExploits} from '/scripts/rootkit'; import {availableExploits} from '/scripts/rootkit';
import {copyWithDependencies} from '/scripts/copy'; import {copyWithDependencies} from '/scripts/copy';
import {maxThreads} from "/scripts/lib/utils"; import {availableThreads} from "/scripts/lib/utils";
/** /**
* Scan the network for servers. * Scan the network for servers.
@ -70,7 +70,7 @@ export async function main(ns) {
// Start script // Start script
if(args['kill']) ns.killall(server); if(args['kill']) ns.killall(server);
const scriptArgs = args['args'].map(arg => arg.toUpperCase() == '{{SERVER}}' ? server : arg); const scriptArgs = args['args'].map(arg => arg.toUpperCase() == '{{SERVER}}' ? server : arg);
const threads = args['cpu'] || maxThreads(ns, args['script'], server) || 1; const threads = args['cpu'] || availableThreads(ns, args['script'], server) || 1;
if(args['remoteExec']) await copyWithDependencies(ns, args['script'], server); if(args['remoteExec']) await copyWithDependencies(ns, args['script'], server);
const pid = ns.exec(args['script'], args['remoteExec'] ? server : localhost, threads, ...scriptArgs); const pid = ns.exec(args['script'], args['remoteExec'] ? server : localhost, threads, ...scriptArgs);
if(pid == 0) { if(pid == 0) {

View File

@ -27,7 +27,7 @@ export async function main(ns) {
// Logger // Logger
const logger = new Logger(ns, [ const logger = new Logger(ns, [
() => `Mining: ${args['server']}`, () => `Mining: ${args['server']}`,
() => `Security: ${Math.round(security)}/${minSecurity}\tBalance: \$${toCurrency(balance)}` () => `Security: ${Math.round(security)}/${minSecurity}\tBalance: ${toCurrency(balance)}`
]); ]);
// Main loop // Main loop