added atExit

This commit is contained in:
Olivier Gagnon
2021-10-14 20:13:26 -04:00
parent fe6473f426
commit 3fddb3c9f2
7 changed files with 55 additions and 14 deletions

View File

@@ -0,0 +1,18 @@
atExit() Netscript Function
============================
.. js:function:: atExit(f)
:RAM cost: 0 GB
:param function f: function to call when the script dies.
Runs when the script dies.
Example:
.. code-block:: javascript
function onDeath() {
console.log('I died!!!')
}
atExit(onDeath);