bitburner-src/doc/source/netscript/basicfunctions/exit.rst
MageKing17 ae15914efa Update netscript documentation.
Unfortunately, I haven't used most of the specialty APIs yet, so I'm not intimately familiar with where their documentation might be wrong. I figured some fixes were better than no fixes, and I can always make more fixes later.

Fixes #1023.
2021-07-06 00:18:22 -07:00

18 lines
702 B
ReStructuredText

exit() Netscript Function
=========================
.. js:function:: exit()
:RAM cost: 0 GB
Terminates the current script immediately.
.. warning:: In :ref:`netscriptjs`, execution may continue past a call to
this function; while some game-related functions (e.g. those with an
``ns.`` prefix) will not function after this function has been called,
there might still be unintended behavior if you assume ``exit`` will
immediately halt execution, like it does in :ref:`netscript1`. To be
safe, you should probably ``return`` from the main function instead
of/in addition to calling ``ns.exit()`` when halting a NetscriptJS
script.