diff --git a/doc/source/netscriptfunctions.rst b/doc/source/netscriptfunctions.rst index 3b0dd2a13..7402830d9 100644 --- a/doc/source/netscriptfunctions.rst +++ b/doc/source/netscriptfunctions.rst @@ -779,6 +779,12 @@ scriptKill Kills all scripts with the specified filename on the target server specified by *hostname/ip*, regardless of arguments. Returns true if one or more scripts were successfully killed, and false if none were. +getScriptName +^^^^^^^^^^^^^ + +.. js:function:: getScriptName() + Returns the current script name + getScriptRam ^^^^^^^^^^^^ diff --git a/src/NetscriptFunctions.js b/src/NetscriptFunctions.js index 799ca02df..d833a99e9 100644 --- a/src/NetscriptFunctions.js +++ b/src/NetscriptFunctions.js @@ -1994,6 +1994,10 @@ function NetscriptFunctions(workerScript) { } return suc; }, + getScriptName : function() { + if (workerScript.checkingRam) {return 0;} + return workerScript.name; + }, getScriptRam : function (scriptname, ip) { if (workerScript.checkingRam) { if (workerScript.loadedFns.getScriptRam) {