work to make documentation unified.

This commit is contained in:
Olivier Gagnon
2021-03-12 02:51:56 -05:00
parent a00c253dcb
commit 2ce6ff2041
176 changed files with 1325 additions and 916 deletions

View File

@@ -1,29 +1,40 @@
isRunning() Netscript Function
==============================
.. js:function:: isRunning(filename, hostname/ip, [args...])
.. js:function:: isRunning(filename, hostname, [args...])
:param string filename: Filename of script to check. This is case-sensitive.
:param string hostname/ip: Hostname or IP of target server
:param args...: Arguments to specify/identify which scripts to search for
:RAM cost: 0.1 GB
:param string filename: Filename of script to check. case-sensitive.
:param string hostname: Hostname of target server.
:param args...: Arguments to specify/identify which scripts to search for
:returns: ``true`` if that script with those args is running on that server.
Returns a boolean indicating whether the specified script is running on the target server. Remember that a script is
uniquely identified by both its name and its arguments.
.. note::
Remember that a script is uniquely identified by both its name and its arguments.
**Examples:**
In this first example below, the function call will return true if there is a script named *foo.script* with no arguments
running on the *foodnstuff* server, and false otherwise::
In this first example below, the function call will return true if there is
a script named ``foo.script`` with no arguments running on the
``foodnstuff`` server, and false otherwise:
isRunning("foo.script", "foodnstuff");
.. code-block:: javascript
In this second example below, the function call will return true if there is a script named *foo.script* with no arguments
running on the current server, and false otherwise::
isRunning("foo.script", "foodnstuff");
isRunning("foo.script", getHostname());
In this second example below, the function call will return true if there is
a script named ``foo.script`` with no arguments running on the current
server, and false otherwise:
In this next example below, the function call will return true if there is a script named *foo.script* running with the arguments
1, 5, and "test" (in that order) on the *joesguns* server, and false otherwise::
.. code-block:: javascript
isRunning("foo.script", "joesguns", 1, 5, "test");
isRunning("foo.script", getHostname());
In this next example below, the function call will return true if there is a
script named ``foo.script`` running with the arguments 1, 5, and "test" (in
that order) on the ``joesguns`` server, and false otherwise:
.. code-block:: javascript
isRunning("foo.script", "joesguns", 1, 5, "test");