mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-12-27 00:17:32 +01:00
19 lines
775 B
ReStructuredText
19 lines
775 B
ReStructuredText
getPurchasedServerUpgradeCost() Netscript Function
|
|
===========================================
|
|
|
|
.. js:function:: getPurchasedServerUpgradeCost(hostname, ram)
|
|
|
|
:RAM cost: 0.1 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
|