From 21ac94dbb3f57e973449faf8a7a35916f0088da4 Mon Sep 17 00:00:00 2001 From: Xynrati <84252507+Xynrati@users.noreply.github.com> Date: Wed, 22 Dec 2021 09:38:21 -0800 Subject: [PATCH] Add ns2 example for scp --- src/ScriptEditor/NetscriptDefinitions.d.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/ScriptEditor/NetscriptDefinitions.d.ts b/src/ScriptEditor/NetscriptDefinitions.d.ts index 5cfed67ad..857b5e89d 100644 --- a/src/ScriptEditor/NetscriptDefinitions.d.ts +++ b/src/ScriptEditor/NetscriptDefinitions.d.ts @@ -4497,6 +4497,13 @@ export interface NS extends Singularity { * files = ["foo1.lit", "foo2.script", "foo3.script"]; * scp(files, "rothman-uni", "home"); * ``` + * @example + * ```ts + * //ns2, copies files from home to a target server + * const server = ns.args[0]; + * const files = ["hack.js","weaken.js","grow.js"]; + * await ns.scp(files, "home", server); + * ``` * @param files - Filename or an array of filenames of script/literature files to copy. * @param source - Host of the source server, which is the server from which the file will be copied. This argument is optional and if it’s omitted the source will be the current server. * @param destination - Host of the destination server, which is the server to which the file will be copied.