mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-12-20 13:15:48 +01:00
ae15914efa
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.
18 lines
702 B
ReStructuredText
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.
|