small doc fixes

This commit is contained in:
Mughur 2023-02-07 16:26:02 +02:00
parent 23199ee705
commit 6590fa1c97
2 changed files with 2 additions and 12 deletions
doc/source/netscript

@ -15,4 +15,4 @@ mv() Netscript Function
.. code-block:: javascript
ns.tprint("home", "foo.js", "old_foo.txt")
ns.mv("home", "foo.js", "old_foo.txt")

@ -20,9 +20,7 @@ through 20. When using the functions above, the ports are specified
by passing the number as the first argument and the value as the second.
The default maximum capacity of a port is 50, but this can be changed in Options > System. Setting this too high can cause the game to use a lot of memory.
.. important:: The data inside ports are not saved! This means if you close and
re-open the game, or reload the page then you will lose all of the data in
the ports!
.. important:: The data inside ports are not saved! This means if you close and re-open the game, or reload the page then you will lose all of the data in the ports!
**Example Usage**
@ -34,8 +32,6 @@ Let's assume Port 1 starts out empty (no data inside). We'll represent the port
Now assume we ran the following simple script
.. code-block:: js
.. code:: javascript
export async function main(ns) {
@ -50,8 +46,6 @@ After this script executes, our script will contain every number from 0 through
Then, assume we run the following script
.. code-block:: js
.. code:: javascript
export async function main(ns) {
@ -125,8 +119,6 @@ This handle allows you to access several new port-related functions. The functio
Port Handle Example
.. code-block:: js
.. code:: javascript
export async function main(ns) {
@ -217,8 +209,6 @@ Then, if you wanted to use these functions in another script, you can import the
If you only wanted to import certain functions, you can do so without needing
to specify a namespace for the import
.. code-block:: js
.. code:: javascript
import {foo1, foo3} from "testlibrary.js"; //Saves RAM since not all functions are imported!