24 lines
880 B
ReStructuredText
Raw Normal View History

growthAnalyze() Netscript Function
==================================
2021-03-12 02:51:56 -05:00
.. js:function:: growthAnalyze(hostname, growthAmount)
:RAM cost: 1 GB
2021-03-12 02:51:56 -05: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.
:returns: The amount of :doc:`grow<grow>` threads needed to grow the specified
server by the specified amount.
2021-03-12 02:51:56 -05:00
Example:
2021-03-12 02:51:56 -05:00
.. code-block:: javascript
2021-03-12 02:51:56 -05:00
// How many grow threads are needed to double the current money on 'foodnstuff'
growthAnalyze("foodnstuff", 2); // returns: 5124
2021-03-12 02:51:56 -05: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).
**Warning**: The value returned by this function isn't necessarily a whole number.