Creates a new Hacknet instance which allows for purchasing and upgrading nodes.
The Netscript object.
Base node (index 0) to use for upgrades.
Hacknet object within NS.
The Netscript object.
Current number of nodes purchased.
Verifies the Hacknet purchase transaction.
If upgrade
is set to "node", checks that index
is unset.
Otherwise, checks if index
is set.
Parameters for this transaction.
Whether the parameters are valid.
Upgrade upgrade
stat on index
node by levels
amount.
Purchase a new node.
Sell an item with params params
, must be overridden by implementing classes if supported.
Parameters for this sale.
Whether the transaction was successful.
Update the base node stats.
The statistics of the base node.
Update the number of nodes purchased.
The number of nodes purchased.
Upgrade node index
to base node stats.
The index of the node to upgrade.
Checks whether the user can purchase based on parameters params
.
Parameters for this transaction.
Whether this transaction is possible.
Gets the amount of money available to this store.
Available money according to this._budget
.
Gets the price of a hacknet upgrade, multiplied by number of nodes.
The price of the upgrade.
Purchase an item with parameters params
if there is money available.
Parameters for this transaction.
Whether the transaction was successful.
Upgrade upgrade
stat on all nodes by levels
amount.
Parameters for purchasing.
Whether the upgrades were successful.
Sell an item with params params
, if possible.
Parameters for this sale.
Whether the transaction was successful.
Upgrade all nodes to base node stats, if needed.
Generated using TypeDoc
Layer on top of
NS
andHacknet
to simplify node management.