Creates a new Hacknet instance which allows for purchasing and upgrading nodes.
The Netscript object.
Current RAM count
The Netscript object.
Current number of nodes purchased.
Verifies that the RAM is divisible by 8.
Parameters for this transaction.
Whether the parameters are valid.
Gets best available RAM purchase.
The best available RAM purchase, based on available money.
Purchase a new worker with params.ram
.
Parameters for this transaction.
Whether the transaction was successful.
Sell a worker with hostnmae params.hostname
.
Parameters for this sale.
Whether the transaction was successful.
Update the current RAM of purchased workers.
The RAM of the first worker if available, this._currentRAM
otherwise.
Update the number of workers purchased.
The number of workers purchased.
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 current RAM value.
Current RAM value based on available money.
Get cost of purchasing a new worker with params.ram
.
Parameters for this transaction.
Cost of the transaction.
Gets current workers.
All purchased workers.
Purchase an item with parameters params
if there is money available.
Parameters for this transaction.
Whether the transaction was successful.
Sell an item with params params
, if possible.
Parameters for this sale.
Whether the transaction was successful.
Check RAM level based on available money, and sell servers if needed.
Whether servers were sold.
Generated using TypeDoc
Layer on top of
NS
to simplify worker management.