mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-09 17:23:53 +01:00
example for ns2 arguments from terminal
example for ns2 arguments from terminal because args array seems to not be used anymore
This commit is contained in:
parent
535812a0fc
commit
a4b7f69307
@ -23,3 +23,14 @@ into a script using::
|
||||
args.length
|
||||
|
||||
**WARNING: Do not try to modify the args array. This will break the game.**
|
||||
|
||||
|
||||
example for accessing arguments in ns2 from terminal execution:
|
||||
terminal command:
|
||||
run name_of_script.js -t 10 --tail argument1 argument2
|
||||
|
||||
ns2 script:
|
||||
|
||||
const args_obj = arguments[0]
|
||||
const argument1 = (args_obj.server.args[0])
|
||||
const argument2 = (args_obj.server.args[1])
|
||||
|
Loading…
Reference in New Issue
Block a user