mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-26 09:33:49 +01:00
31 lines
1003 B
ReStructuredText
31 lines
1003 B
ReStructuredText
scriptRunning() Netscript Function
|
|
==================================
|
|
|
|
.. js:function:: scriptRunning(scriptname, hostname)
|
|
|
|
:RAM cost: 1 GB
|
|
:param string scriptname: Filename of script to check. case-sensitive.
|
|
:param string hostname: Hostname of target server.
|
|
:returns: ``true`` if any script with that file name is running on that
|
|
server.
|
|
|
|
This is different than the :doc:`isRunning<isRunning>` function because it
|
|
does not try to identify a specific instance of a running script by its
|
|
arguments.
|
|
|
|
Examples:
|
|
|
|
The example below will return true if there is any script named
|
|
``foo.js`` running on the ``foodnstuff`` server, and false otherwise:
|
|
|
|
.. code-block:: javascript
|
|
|
|
ns.scriptRunning("foo.js", "foodnstuff");
|
|
|
|
The example below will return true if there is any script named
|
|
``foo.js`` running on the current server, and false otherwise:
|
|
|
|
.. code-block:: javascript
|
|
|
|
ns.scriptRunning("foo.js", ns.getHostname());
|