Merge pull request #222 from hydroflame/script-name

added getScriptName
This commit is contained in:
danielyxie
2018-05-06 16:31:33 -05:00
committed by GitHub
2 changed files with 10 additions and 0 deletions

View File

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

View File

@ -2002,6 +2002,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) {