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

23 lines
795 B
ReStructuredText
Raw Normal View History

getHackTime() Netscript Function
================================
2021-03-12 08:51:56 +01:00
.. js:function:: getHackTime(hostname[, hackLvl=current level])
:RAM cost: 0.05 GB
2021-03-12 08:51:56 +01:00
:param string hostname: Hostname of target server.
:param number hackLvl: Optional hacking level for the calculation. Defaults
to player's current hacking level.
:returns: seconds it takes to execute :doc:`hack<hack>` on that server.
2021-03-12 08:51:56 +01:00
The function takes in an optional ``hackLvl`` parameter that can be
specified to see what the hack time would be at different hacking levels.
2021-03-12 08:51:56 +01:00
Example:
.. code-block:: javascript
getHackTime("foodnstuff"); // returns: 53.4
.. note:: For Hacknet Servers (the upgraded version of a Hacknet Node), this function will
return :code:`Infinity`.