2019-03-03 04:08:54 +01:00
|
|
|
scriptRunning() Netscript Function
|
|
|
|
==================================
|
|
|
|
|
2021-03-12 08:51:56 +01:00
|
|
|
.. js:function:: scriptRunning(scriptname, hostname)
|
2019-03-03 04:08:54 +01:00
|
|
|
|
|
|
|
:RAM cost: 1 GB
|
2021-03-12 08:51:56 +01:00
|
|
|
: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.
|
2019-03-03 04:08:54 +01:00
|
|
|
|
2021-03-12 08:51:56 +01:00
|
|
|
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.
|
2019-03-03 04:08:54 +01:00
|
|
|
|
2021-03-12 08:51:56 +01:00
|
|
|
Examples:
|
2019-03-03 04:08:54 +01:00
|
|
|
|
2021-03-12 08:51:56 +01:00
|
|
|
The example below will return true if there is any script named
|
|
|
|
``foo.script`` running on the ``foodnstuff`` server, and false otherwise:
|
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
|
|
|
|
|
|
|
scriptRunning("foo.script", "foodnstuff");
|
|
|
|
|
2021-03-12 08:51:56 +01:00
|
|
|
The example below will return true if there is any script named
|
|
|
|
``foo.script`` running on the current server, and false otherwise:
|
|
|
|
|
|
|
|
.. code-block:: javascript
|
2019-03-03 04:08:54 +01:00
|
|
|
|
|
|
|
scriptRunning("foo.script", getHostname());
|