diff --git a/doc/source/netscript/netscriptscriptarguments.rst b/doc/source/netscript/netscriptscriptarguments.rst index 024fd648e..945941557 100644 --- a/doc/source/netscript/netscriptscriptarguments.rst +++ b/doc/source/netscript/netscriptscriptarguments.rst @@ -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])