DOCUMENTATION: Clarify scp and exec darknet permissions in API docs (#2634)

This commit is contained in:
Lee Stutzman
2026-04-10 01:24:37 +01:00
committed by GitHub
parent 19b137e2fb
commit d6299becd6
3 changed files with 12 additions and 2 deletions

View File

@@ -132,4 +132,5 @@ ns.exec("generic-hack.js", "joesguns", {threads: 10});
// arguments to the script. // arguments to the script.
ns.exec("foo.js", "foodnstuff", 5, 1, "test"); ns.exec("foo.js", "foodnstuff", 5, 1, "test");
``` ```
For darknet servers: A session must be established with the target server, and the script must be running on a server that is directly connected to the target, or the target must have a backdoor or stasis link installed.

View File

@@ -112,5 +112,5 @@ const server = ns.args[0];
const files = ["hack.js", "weaken.js", "grow.js"]; const files = ["hack.js", "weaken.js", "grow.js"];
ns.scp(files, server, "home"); ns.scp(files, server, "home");
``` ```
For password-protected servers (such as darknet servers), a session must be established with the destination server before using this function. (The source server does not require a session.) For darknet servers: The destination requires a session, but unlike [exec](./bitburner.ns.exec.md)<!-- -->, does not require a direct connection — scp works at any distance. The source server has no darknet requirements (no session or connection needed). Use [dnet.authenticate](./bitburner.darknet.authenticate.md) (requires direct connection) or [dnet.connectToSession](./bitburner.darknet.connecttosession.md) (at any distance) to establish a session.

View File

@@ -7920,6 +7920,11 @@ export interface NS {
* // arguments to the script. * // arguments to the script.
* ns.exec("foo.js", "foodnstuff", 5, 1, "test"); * ns.exec("foo.js", "foodnstuff", 5, 1, "test");
* ``` * ```
*
* For darknet servers: A session must be established with the target server, and the script must be
* running on a server that is directly connected to the target, or the target must have a backdoor or
* stasis link installed.
*
* @param script - Filename of script to execute. This file must already exist on the target server. * @param script - Filename of script to execute. This file must already exist on the target server.
* @param host - Hostname/IP of the target server on which to execute the script. * @param host - Hostname/IP of the target server on which to execute the script.
* @param threadOrOptions - Either an integer number of threads for new script, or a {@link RunOptions} object. Threads defaults to 1. * @param threadOrOptions - Either an integer number of threads for new script, or a {@link RunOptions} object. Threads defaults to 1.
@@ -8057,7 +8062,11 @@ export interface NS {
* ns.scp(files, server, "home"); * ns.scp(files, server, "home");
* ``` * ```
* *
* For password-protected servers (such as darknet servers), a session must be established with the destination server before using this function. (The source server does not require a session.) * For darknet servers: The destination requires a session, but unlike {@link NS.exec | exec}, does not
* require a direct connection — scp works at any distance. The source server has no darknet requirements
* (no session or connection needed). Use {@link Darknet.authenticate | dnet.authenticate} (requires direct
* connection) or {@link Darknet.connectToSession | dnet.connectToSession} (at any distance) to
* establish a session.
* *
* @param files - Filename or an array of filenames of script/literature files to copy. Note that if a file is located in a subdirectory, the filename must include the leading `/`. * @param files - Filename or an array of filenames of script/literature files to copy. Note that if a file is located in a subdirectory, the filename must include the leading `/`.
* @param destination - Hostname/IP of the destination server, which is the server to which the file will be copied. * @param destination - Hostname/IP of the destination server, which is the server to which the file will be copied.