added getScriptName

This commit is contained in:
Olivier Gagnon 2018-05-06 03:27:16 -04:00
parent 8dba456b65
commit 60cc6e15d5
2 changed files with 10 additions and 0 deletions

@ -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
^^^^^^^^^^^^

@ -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) {