mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-16 14:28:36 +02:00
NETSCRIPT: Add ns.self() as a free info function (#1636)
* added utility info * moved info to running script * fix for RAM cost * description changes Co-authored-by: David Walker <d0sboots@gmail.com> * fixed wrong formatting * Added parent to ignored fields --------- Co-authored-by: David Walker <d0sboots@gmail.com>
This commit is contained in:
26
src/ScriptEditor/NetscriptDefinitions.d.ts
vendored
26
src/ScriptEditor/NetscriptDefinitions.d.ts
vendored
@@ -245,6 +245,13 @@ interface RunningScript {
|
||||
onlineRunningTime: number;
|
||||
/** Process ID. Must be an integer */
|
||||
pid: number;
|
||||
/**
|
||||
* Process ID of the parent process.
|
||||
*
|
||||
* If this script was started by another script, this will be the PID of that script.
|
||||
* If this script was started directly through the terminal, the value will be 0.
|
||||
*/
|
||||
parent: number;
|
||||
/**
|
||||
* How much RAM this script uses for ONE thread.
|
||||
* Also known as "static RAM usage," this value does not change once the
|
||||
@@ -6592,6 +6599,14 @@ export interface NS {
|
||||
* @param args - Additional arguments to pass into the new script that is being run.
|
||||
*/
|
||||
spawn(script: string, threadOrOptions?: number | SpawnOptions, ...args: ScriptArg[]): void;
|
||||
|
||||
/**
|
||||
* Returns the currently running script.
|
||||
* @remarks
|
||||
* RAM cost: 0 GB
|
||||
*/
|
||||
self(): RunningScript;
|
||||
|
||||
/**
|
||||
* Terminate the script with the provided PID.
|
||||
* @remarks
|
||||
@@ -9502,11 +9517,22 @@ interface GameInfo {
|
||||
* @public
|
||||
*/
|
||||
interface AutocompleteData {
|
||||
/** All server hostnames */
|
||||
servers: string[];
|
||||
/** All scripts on the current server */
|
||||
scripts: string[];
|
||||
/** All text files on the current server */
|
||||
txts: string[];
|
||||
/** Netscript Enums */
|
||||
enums: NSEnums;
|
||||
/** Parses the flags schema on the already inputted flags */
|
||||
flags(schema: [string, string | number | boolean | string[]][]): { [key: string]: ScriptArg | string[] };
|
||||
/** The hostname of the server the script would be running on */
|
||||
hostname: string;
|
||||
/** The filename of the script about to be run */
|
||||
filename: string;
|
||||
/** The processes running on the host */
|
||||
processes: ProcessInfo[];
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user