UI: Corrected ns.tail examples to ns.ui.openTail (#2270)

Changed to ns.ui.openTail in the example text where needed.
This commit is contained in:
gmcew
2025-07-29 21:06:32 +01:00
committed by GitHub
parent 7928800bbc
commit 952fc28b67
4 changed files with 10 additions and 10 deletions
+1 -1
View File
@@ -58,6 +58,6 @@ const reset = "\u001b[0m";
ns.print(`${red}Ugh! What a mess.${reset}`); ns.print(`${red}Ugh! What a mess.${reset}`);
ns.print(`${green}Well done!${reset}`); ns.print(`${green}Well done!${reset}`);
ns.print(`${cyan}ERROR Should this be in red?${reset}`); ns.print(`${cyan}ERROR Should this be in red?${reset}`);
ns.tail(); ns.ui.openTail();
``` ```
+1 -1
View File
@@ -43,6 +43,6 @@ ns.printf("My age in binary is %b.", age);
ns.printf("My age in scientific notation is %e.", age); ns.printf("My age in scientific notation is %e.", age);
ns.printf("In %d seconds, I'll be %s.", 6, "Byte"); ns.printf("In %d seconds, I'll be %s.", 6, "Byte");
ns.printf("Am I a nibble? %t", (4 === age)); ns.printf("Am I a nibble? %t", (4 === age));
ns.tail(); ns.ui.openTail();
``` ```
+3 -3
View File
@@ -39,12 +39,12 @@ Otherwise, the PID or filename, hostname/ip, and args… arguments can be used t
```js ```js
//Open logs from foo.js on the current server that was run with no args //Open logs from foo.js on the current server that was run with no args
ns.tail("foo.js"); ns.ui.openTail("foo.js");
//Get logs from foo.js on the foodnstuff server that was run with no args //Get logs from foo.js on the foodnstuff server that was run with no args
ns.tail("foo.js", "foodnstuff"); ns.ui.openTail("foo.js", "foodnstuff");
//Get logs from foo.js on the foodnstuff server that was run with the arguments [1, "test"] //Get logs from foo.js on the foodnstuff server that was run with the arguments [1, "test"]
ns.tail("foo.js", "foodnstuff", 1, "test"); ns.ui.openTail("foo.js", "foodnstuff", 1, "test");
``` ```
+5 -5
View File
@@ -5944,13 +5944,13 @@ interface UserInterface {
* @example * @example
* ```js * ```js
* //Open logs from foo.js on the current server that was run with no args * //Open logs from foo.js on the current server that was run with no args
* ns.tail("foo.js"); * ns.ui.openTail("foo.js");
* *
* //Get logs from foo.js on the foodnstuff server that was run with no args * //Get logs from foo.js on the foodnstuff server that was run with no args
* ns.tail("foo.js", "foodnstuff"); * ns.ui.openTail("foo.js", "foodnstuff");
* *
* //Get logs from foo.js on the foodnstuff server that was run with the arguments [1, "test"] * //Get logs from foo.js on the foodnstuff server that was run with the arguments [1, "test"]
* ns.tail("foo.js", "foodnstuff", 1, "test"); * ns.ui.openTail("foo.js", "foodnstuff", 1, "test");
* ``` * ```
* @param fn - Optional. Filename or PID of the script being tailed. If omitted, the current script is tailed. * @param fn - Optional. Filename or PID of the script being tailed. If omitted, the current script is tailed.
* @param host - Optional. Hostname/IP of the script being tailed. Defaults to the server this script is running on. If args are specified, this is not optional. * @param host - Optional. Hostname/IP of the script being tailed. Defaults to the server this script is running on. If args are specified, this is not optional.
@@ -6602,7 +6602,7 @@ export interface NS {
* ns.print(`${red}Ugh! What a mess.${reset}`); * ns.print(`${red}Ugh! What a mess.${reset}`);
* ns.print(`${green}Well done!${reset}`); * ns.print(`${green}Well done!${reset}`);
* ns.print(`${cyan}ERROR Should this be in red?${reset}`); * ns.print(`${cyan}ERROR Should this be in red?${reset}`);
* ns.tail(); * ns.ui.openTail();
* ``` * ```
* *
* @param args - Value(s) to be printed. * @param args - Value(s) to be printed.
@@ -6637,7 +6637,7 @@ export interface NS {
* ns.printf("My age in scientific notation is %e.", age); * ns.printf("My age in scientific notation is %e.", age);
* ns.printf("In %d seconds, I'll be %s.", 6, "Byte"); * ns.printf("In %d seconds, I'll be %s.", 6, "Byte");
* ns.printf("Am I a nibble? %t", (4 === age)); * ns.printf("Am I a nibble? %t", (4 === age));
* ns.tail(); * ns.ui.openTail();
* ``` * ```
* *
* @param format - Format of the message. * @param format - Format of the message.