mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-19 15:54:09 +02:00
[feature] added "getPurchasedServerCost" NS function
This commit is contained in:
@@ -670,6 +670,21 @@ purchaseHacknetNode
|
||||
end of the Hacknet Node's name (e.g The Hacknet Node named 'hacknet-node-4' will have an index of 4). If the player cannot afford
|
||||
to purchase a new Hacknet Node then the function will return false.
|
||||
|
||||
getPurchasedServerCost
|
||||
^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
.. js:function:: getPurchasedServerCost(ram)
|
||||
|
||||
:param number ram: Amount of RAM of a potential purchased server. Must be a power of 2 (2, 4, 8, 16, etc.). Maximum value of 1048576 (2^20)
|
||||
|
||||
Returns the cost to purchase a server with the specified amount of *ram*.
|
||||
|
||||
Examples::
|
||||
|
||||
for (i = 1; i <= 20; i++) {
|
||||
tprint(i + " -- " + getPurchasedServerCost(Math.pow(2, i)));
|
||||
}
|
||||
|
||||
purchaseServer
|
||||
^^^^^^^^^^^^^^
|
||||
|
||||
|
||||
Reference in New Issue
Block a user