bitburner-src/doc/source/netscript/basicfunctions/grow.rst

39 lines
1.7 KiB
ReStructuredText
Raw Normal View History

grow() Netscript Function
=========================
2021-03-12 08:51:56 +01:00
.. js:function:: grow(hostname[, opts={}])
2021-03-12 08:51:56 +01:00
:RAM cost: 0.15 GB
:param string hostname: Hostname of the target server.
:param object opts: Optional parameters for configuring function behavior. Properties:
* threads (*number*) - Number of threads to use for this function.
Must be less than or equal to the number of threads the script is running with.
* stock (*boolean*) - If true, the function can affect the stock market. See
:ref:`gameplay_stock_market_player_actions_influencing_stock`
:returns: The number by which the money on the server was multiplied for the growth
2021-03-12 08:51:56 +01:00
Increase the amount of money available on a server. The time it takes to
execute depends on your hacking level and the target server's security
level. When :doc:`grow<grow>` completes, the money available on a target
2023-01-06 13:43:09 +01:00
server will be increased by the number of threads used and a certain, fixed percentage.
The percentage is determined by the target server's growth rate (which varies between servers)
2021-03-12 08:51:56 +01:00
and security level. Generally, higher-level servers have higher growth
2021-11-18 01:56:17 +01:00
rates.
2021-03-12 08:51:56 +01:00
Like :doc:`hack<hack>`, :doc:`grow<grow>` can be called on any server, from
any server. The :doc:`grow<grow>` command requires root access to the target
server, but there is no required hacking level to run the command. It also
raises the security level of the target server by 0.004 per thread.
2021-09-21 23:47:27 +02:00
Action time is calculated at the start, effect is calculated at the end.
2021-03-12 08:51:56 +01:00
Example:
2021-03-12 08:51:56 +01:00
.. code-block:: javascript
2021-03-12 08:51:56 +01:00
while(true) {
2023-01-06 13:43:09 +01:00
await ns.grow("foodnstuff");
2021-03-12 08:51:56 +01:00
}