2019-04-05 11:08:41 +02:00
|
|
|
spendHashes() Netscript Function
|
|
|
|
================================
|
|
|
|
|
|
|
|
.. warning:: This page contains spoilers for the game
|
|
|
|
|
|
|
|
.. js:function:: spendHashes(upgName, upgTarget)
|
|
|
|
|
2021-03-07 10:37:56 +01:00
|
|
|
:RAM cost: 0 GB
|
2019-04-05 11:08:41 +02:00
|
|
|
:param string upgName: Name of upgrade to spend hashes on. Must be an exact match
|
|
|
|
:param string upgTarget: Object to which upgrade applies. Required for certain upgrades
|
2021-03-12 08:51:56 +01:00
|
|
|
:returns: ``true`` if the purchase was successful.
|
2019-04-05 11:08:41 +02:00
|
|
|
|
|
|
|
.. note:: This function is only applicable for Hacknet Servers (the upgraded version
|
|
|
|
of a Hacknet Node).
|
|
|
|
|
2021-03-12 08:51:56 +01:00
|
|
|
Spend the hashes generated by your Hacknet Servers on an upgrade.
|
2019-04-05 11:08:41 +02:00
|
|
|
|
2021-03-12 08:51:56 +01:00
|
|
|
The name of the upgrade must be an exact match. The ``upgTarget`` argument
|
|
|
|
is used for upgrades such as ``Reduce Minimum Security``, which applies to a
|
|
|
|
specific server. In this case, the ``upgTarget`` argument must be the
|
|
|
|
hostname of the server.
|
2019-04-05 11:08:41 +02:00
|
|
|
|
|
|
|
Example:
|
|
|
|
|
|
|
|
.. code:: javascript
|
|
|
|
|
|
|
|
hacknet.spendHashes("Sell for Corporation Funds");
|
|
|
|
hacknet.spendHashes("Increase Maximum Money", "foodnstuff");
|