2019-03-03 04:08:54 +01:00
|
|
|
growthAnalyze() Netscript Function
|
|
|
|
==================================
|
|
|
|
|
2021-10-08 18:09:44 +02:00
|
|
|
.. js:function:: growthAnalyze(hostname, growthAmount[, cores])
|
2019-03-03 04:08:54 +01:00
|
|
|
|
|
|
|
:RAM cost: 1 GB
|
2021-03-12 08:51:56 +01:00
|
|
|
:param string hostname: Hostname of server to analyze.
|
|
|
|
:param number growthAmount: Multiplicative factor by which the server is
|
|
|
|
grown. Decimal form. Must be >= 1.
|
2021-10-08 18:09:44 +02:00
|
|
|
:param number cores: Amount of cores on the server that would run the growth, defaults to 1
|
2021-03-12 08:51:56 +01:00
|
|
|
:returns: The amount of :doc:`grow<grow>` threads needed to grow the specified
|
|
|
|
server by the specified amount.
|
2019-03-03 04:08:54 +01:00
|
|
|
|
2021-03-12 08:51:56 +01:00
|
|
|
Example:
|
2019-03-03 04:08:54 +01:00
|
|
|
|
2021-03-12 08:51:56 +01:00
|
|
|
.. code-block:: javascript
|
2019-03-03 04:08:54 +01:00
|
|
|
|
2021-03-12 08:51:56 +01:00
|
|
|
// How many grow threads are needed to double the current money on 'foodnstuff'
|
|
|
|
growthAnalyze("foodnstuff", 2); // returns: 5124
|
2019-03-03 04:08:54 +01:00
|
|
|
|
2021-03-12 08:51:56 +01:00
|
|
|
If this returns 5124, then this means you need to call :doc:`grow<grow>`
|
|
|
|
5124 times in order to double the money (or once with 5124 threads).
|
2019-03-03 04:08:54 +01:00
|
|
|
|
|
|
|
**Warning**: The value returned by this function isn't necessarily a whole number.
|