mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-18 07:18:38 +02:00
Minor bug fixes, adding spotify music player, and adding sphinx documentation
This commit is contained in:
17
doc/build/html/_sources/netscriptscriptarguments.rst.txt
vendored
Normal file
17
doc/build/html/_sources/netscriptscriptarguments.rst.txt
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
Netscript Script Arguments
|
||||
==========================
|
||||
|
||||
Arguments passed into a script can be accessed in Netscript using a special array called *args*. The arguments can be
|
||||
accessed using a normal array using the [] operator (args[0], args[1], etc...).
|
||||
|
||||
For example, let's say we want to make a generic script 'generic-run.script' and we plan to pass two arguments into that script.
|
||||
The first argument will be the name of another script, and the second argument will be a number. This generic script will run the
|
||||
script specified in the first argument with the amount of threads specified in the second element. The code would look like::
|
||||
|
||||
run(args[0], args[1]);
|
||||
|
||||
It is also possible to get the number of arguments that was passed into a script using::
|
||||
|
||||
args.length
|
||||
|
||||
WARNING: Do not try to modify the args array. This will break the game. I will do my best to prevent players from doing this.
|
||||
Reference in New Issue
Block a user