mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-22 15:43:49 +01:00
Set up the skeleton of an ns.closeTail function
This commit is contained in:
parent
0121fee6e4
commit
5526355a43
@ -988,6 +988,10 @@ export function NetscriptFunctions(workerScript: WorkerScript): NS {
|
||||
|
||||
LogBoxEvents.emit(runningScriptObj);
|
||||
},
|
||||
closeTail: function (fn: any, hostname: any = workerScript.hostname, ...scriptArgs: any[]): void {
|
||||
updateDynamicRam("closeTail", getRamCost(Player, "closeTail"));
|
||||
// TODO
|
||||
},
|
||||
nuke: function (_hostname: unknown): boolean {
|
||||
updateDynamicRam("nuke", getRamCost(Player, "nuke"));
|
||||
const hostname = helper.string("tail", "hostname", _hostname);
|
||||
|
18
src/ScriptEditor/NetscriptDefinitions.d.ts
vendored
18
src/ScriptEditor/NetscriptDefinitions.d.ts
vendored
@ -4981,6 +4981,24 @@ export interface NS {
|
||||
*/
|
||||
tail(fn?: FilenameOrPID, host?: string, ...args: any[]): void;
|
||||
|
||||
/**
|
||||
* Close the tail window of a script.
|
||||
* @remarks
|
||||
* RAM cost: 0 GB
|
||||
*
|
||||
* Closes a script’s logs. This is functionally the same pressing the "Close" button on the tail window.
|
||||
*
|
||||
* If the function is called with no arguments, it will close the current script’s logs.
|
||||
*
|
||||
* Otherwise, the fn, hostname/ip, and args… arguments can be used to close the logs from another script.
|
||||
* Remember that scripts are uniquely identified by both their names and arguments.
|
||||
*
|
||||
* @param fn - Optional. Filename or PID of the script having its tail closed. If omitted, the current script is used.
|
||||
* @param host - Optional. Hostname of the script having its tail closed. Defaults to the server this script is running on. If args are specified, this is not optional.
|
||||
* @param args - Arguments for the script having its tail closed.
|
||||
*/
|
||||
closeTail(fn?: FilenameOrPID, host?: string, ...args: any[]): void;
|
||||
|
||||
/**
|
||||
* Get the list of servers connected to a server.
|
||||
* @remarks
|
||||
|
@ -131,6 +131,8 @@ function LogWindow(props: IProps): React.ReactElement {
|
||||
return () => clearInterval(id);
|
||||
}, []);
|
||||
|
||||
//TODO Not actually a todo I just want this file to show up as changed
|
||||
//so I can find it easier later
|
||||
function kill(): void {
|
||||
killWorkerScript(script, script.server, true);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user