bitburner-src/doc/source/netscript/basicfunctions/getPurchasedServerUpgradeCost.rst
2023-01-06 14:43:09 +02:00

19 lines
776 B
ReStructuredText

getPurchasedServerUpgradeCost() Netscript Function
===========================================
.. js:function:: getPurchasedServerUpgradeCost(hostname, ram)
:RAM cost: 0.25 GB
:param string hostname: Hostname of target purchased server.
:param number ram: Target amount of RAM for purchased server. Must be a power of 2 (2, 4, 8, 16, etc.). Maximum value of :doc:`getPurchasedServerMaxRam<getPurchasedServerMaxRam>`
:returns: Cost to purchase a server with the specified amount of ``ram``.
Giving any non-power-of-2 as an argument results in the function returning `-1`
Example:
.. code-block:: javascript
ns.purchaseServer("smallServer",2) //costs 110000
ns.getPurchasedServerUpgradeCost("smallServer",8); // returns: 330000