hashCost() Netscript Function

Warning

This page contains spoilers for the game

hashCost(upgName)
Arguments:
  • upgName (string) – Name of upgrade to get the cost of. Must be an exact match

Note

This function is only applicable for Hacknet Servers (the upgraded version of a Hacknet Node).

Returns the number of hashes required for the specified upgrade. The name of the upgrade must be an exact match.

Example:

var upgradeName = "Sell for Corporation Funds";
if (hacknet.numHashes() > hacknet.hashCost(upgradeName)) {
    hacknet.spendHashes(upgName);
}