mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-29 12:27:07 +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:
@@ -776,6 +776,11 @@ export const ns: InternalAPI<NSFull> = {
|
||||
throw new ScriptDeath(ctx.workerScript);
|
||||
}
|
||||
},
|
||||
self: (ctx) => () => {
|
||||
const runningScript = helpers.getRunningScript(ctx, ctx.workerScript.pid);
|
||||
if (runningScript == null) throw helpers.errorMessage(ctx, "Cannot find running script. This is a bug.");
|
||||
return helpers.createPublicRunningScript(runningScript, ctx.workerScript);
|
||||
},
|
||||
kill:
|
||||
(ctx) =>
|
||||
(scriptID, hostname = ctx.workerScript.hostname, ...scriptArgs) => {
|
||||
|
||||
Reference in New Issue
Block a user