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

25 lines
884 B
ReStructuredText
Raw Normal View History

killall() Netscript Function
============================
.. js:function:: killall([hostname = current hostname[, safetyguard = true]])
:RAM cost: 0.5 GB
2021-03-12 08:51:56 +01:00
:param string hostname: Hostname of the server on which to kill all scripts.
2023-01-06 13:43:09 +01:00
:param boolean safetyguard: Whether the function will safeguard the current script or not.
2021-03-12 08:51:56 +01:00
:returns: ``true`` if scripts were killed on target server.
2021-03-12 08:51:56 +01:00
Kills all running scripts on the specified server.
Example:
.. code-block:: javascript
2023-01-06 13:43:09 +01:00
ns.killall('foodnstuff'); // returns: true
.. code-block:: javascript
ns.killall(); // returns: true, kills all scripts on the current server, except the current script
ns.killall(); // returns: false, because all no available scripts are running anymore
ns.killall(ns.getHostname(),false) // returns: true, but also kills the current script