mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-18 07:18:38 +02:00
work to make documentation unified.
This commit is contained in:
@@ -6,20 +6,18 @@ hashCost() Netscript Function
|
||||
.. js:function:: hashCost(upgName)
|
||||
|
||||
:RAM cost: 0 GB
|
||||
|
||||
:param string upgName: Name of upgrade to get the cost of. Must be an exact match
|
||||
:returns: Number of hashes required for the specified upgrade. The name of
|
||||
the upgrade 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:
|
||||
|
||||
.. code:: javascript
|
||||
|
||||
var upgradeName = "Sell for Corporation Funds";
|
||||
upgradeName = "Sell for Corporation Funds";
|
||||
if (hacknet.numHashes() > hacknet.hashCost(upgradeName)) {
|
||||
hacknet.spendHashes(upgName);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user