Skip to content

Commit

Permalink
Change targeting display stats in hack exp mode
Browse files Browse the repository at this point in the history
  • Loading branch information
alainbryden committed Nov 27, 2024
1 parent 00c387c commit 1098c2b
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions daemon.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {
formatMoney, formatRam, formatDuration, formatDateTime, formatNumber,
formatMoney, formatRam, formatDuration, formatDateTime, formatNumber, formatNumberShort,
hashCode, disableLogs, log, getFilePath, getConfiguration,
getNsDataThroughFile_Custom, runCommand_Custom, waitForProcessToComplete_Custom,
tryGetBitNodeMultipliers_Custom, getActiveSourceFiles_Custom,
Expand Down Expand Up @@ -727,10 +727,14 @@ export async function main(ns) {
await refreshDynamicServerData(ns);
// Occassionally print our current targetting order (todo, make this controllable with a flag or custom UI?)
if (verbose || loops % 600 == 0) {
const targetsLog = 'Targetting Order:\n  ' + targetingOrder.filter(s => s.shouldHack()).map(s =>
`${s.isPrepped() ? '*' : ' '} ${s.canHack() ? '✓' : 'X'} Money: ${formatMoney(s.getMoney(), 4)} of ${formatMoney(s.getMaxMoney(), 4)} ` +
`(${formatMoney(s.getMoneyPerRamSecond(), 4)}/ram.sec), Sec: ${formatNumber(s.getSecurity(), 3)} of ${formatNumber(s.getMinSecurity(), 3)}, ` +
`TTW: ${formatDuration(s.timeToWeaken())}, Hack: ${s.requiredHackLevel} - ${s.name}` +
const targetsLog = 'Targetting Order: (* = prepped, ✓ = hackable)\n  ' + targetingOrder.filter(s => s.shouldHack()).map(s =>
`${s.isPrepped() ? '*' : ' '} ${s.canHack() ? '✓' : 'X'}` +
` Money: ${formatMoney(s.getMoney(), 4)} of ${formatMoney(s.getMaxMoney(), 4)} ` +
// In Hack Exp mode, show estimated hack exp earned per second, otherwise show money per RAM-second.
(xpOnly ? `Exp: ${formatNumberShort(s.getExpPerSecond(), 4)}/sec` : `(${formatMoney(s.getMoneyPerRamSecond(), 4)}/ram.sec),`) +
` Sec: ${formatNumber(s.getSecurity(), 3)} of ${formatNumber(s.getMinSecurity(), 3)},` +
` TTW: ${formatDuration(s.timeToWeaken())}, Hack: ${s.requiredHackLevel} - ${s.name}` +
// In stock mode, show any associated stock symbol and whether we have shares to dictate stock manipulation direction
(!stockMode || !serverStockSymbols[s.name] ? '' : ` Sym: ${serverStockSymbols[s.name]} Owned: ${serversWithOwnedStock.includes(s.name)} ` +
`Manip: ${shouldManipulateGrow[s.name] ? "grow" : shouldManipulateHack[s.name] ? "hack" : '(disabled)'}`))
.join('\n  ');
Expand Down

0 comments on commit 1098c2b

Please sign in to comment.