Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion daemon.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ const argsSchema = [
['n', false], // Can toggle on using hacknet nodes for extra hacking ram (at the expense of hash production)
['use-hacknet-nodes', false], // Same as above (kept for backwards compatibility, but these are now called hacknet-servers)
['use-hacknet-servers', false], // Same as above, but the game recently renamed these
['hacknet-use-ram-percentage', 0.75],
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
['hacknet-use-ram-percentage', 0.75],
['hacknet-use-ram-percentage', 1.00],

['spend-hashes-for-money-when-under', 10E6], // (Default 10m) Convert 4 hashes to money whenever we're below this amount
['disable-spend-hashes', false], // An easy way to set the above to a very large negative number, thus never spending hashes for Money
['silent-misfires', false], // Instruct remote scripts not to alert when they misfire
Expand Down Expand Up @@ -118,6 +119,7 @@ let xpOnly = false; // "-x" command line arg - focus on a strategy that produces
let verbose = false; // "-v" command line arg - Detailed logs about batch scheduling / tuning
let runOnce = false; // "-o" command line arg - Good for debugging, run the main targettomg loop once then stop
let useHacknetNodes = false; // "-n" command line arg - Can toggle using hacknet nodes for extra hacking ram
let hacknetUsePercentage = 0.75 // How much ram percentage ram from the hacknet is getting used.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
let hacknetUsePercentage = 0.75 // How much ram percentage ram from the hacknet is getting used.
let hacknetUsePercentage = 1.00 // How much ram percentage ram from the hacknet is getting used.

let loopingMode = false;
let recoveryThreadPadding = 1; // How many multiples to increase the weaken/grow threads to recovery from misfires automatically (useful when RAM is abundant and timings are tight)

Expand Down Expand Up @@ -250,6 +252,7 @@ export async function main(ns) {
stockMode = (options.s || options['stock-manipulation'] || options['stock-manipulation-focus']) && !options['disable-stock-manipulation'];
stockFocus = options['stock-manipulation-focus'] && !options['disable-stock-manipulation'];
useHacknetNodes = options.n || options['use-hacknet-nodes'] || options['use-hacknet-servers'];
hacknetUsePercentage = Math.max(options['hacknet-use-ram-percentage'])
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
hacknetUsePercentage = Math.max(options['hacknet-use-ram-percentage'])
hacknetUsePercentage = options['hacknet-use-ram-percentage']

Not sure why the max was there, it would do nothing

verbose = options.v || options['verbose'];
runOnce = options.o || options['run-once'];
loopingMode = options['looping-mode'];
Expand Down Expand Up @@ -1008,8 +1011,11 @@ class Server {
isHost() { return this.name == daemonHost; }
totalRam() {
let maxRam = this.ns.getServerMaxRam(this.name);
if (this.name == "home")
if (this.name == "home") {
maxRam = Math.max(0, maxRam - homeReservedRam); // Complete HACK: but for most planning purposes, we want to pretend home has less ram to leave room for temp scripts to run
} else if (this.name.startsWith('hacknet-server-')) {
maxRam = maxRam * hacknetUsePercentage;
}
return maxRam;
}
usedRam() { return this.ns.getServerUsedRam(this.name); }
Expand Down