From 577f73dce7cf3e878572018dddbfb00aff53ca0c Mon Sep 17 00:00:00 2001 From: Olivier Gagnon Date: Mon, 7 May 2018 15:56:55 -0400 Subject: [PATCH] getScriptRam now optionally take hostname/ip or default to localhost --- doc/source/netscriptfunctions.rst | 4 ++-- src/NetscriptFunctions.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/source/netscriptfunctions.rst b/doc/source/netscriptfunctions.rst index 3b0dd2a13..d483e7d63 100644 --- a/doc/source/netscriptfunctions.rst +++ b/doc/source/netscriptfunctions.rst @@ -782,10 +782,10 @@ scriptKill getScriptRam ^^^^^^^^^^^^ -.. js:function:: getScriptRam(scriptname, hostname/ip) +.. js:function:: getScriptRam(scriptname[, hostname/ip]) :param string scriptname: Filename of script. This is case-sensitive. - :param string hostname/ip: Hostname or IP of target server + :param string hostname/ip: Hostname or IP of target server the script is located on. This is optional, If it is not specified then the function will se the current server as the target server. Returns the amount of RAM required to run the specified script on the target server diff --git a/src/NetscriptFunctions.js b/src/NetscriptFunctions.js index 799ca02df..139a23905 100644 --- a/src/NetscriptFunctions.js +++ b/src/NetscriptFunctions.js @@ -1994,7 +1994,7 @@ function NetscriptFunctions(workerScript) { } return suc; }, - getScriptRam : function (scriptname, ip) { + getScriptRam : function (scriptname, ip=workerScript.serverIp) { if (workerScript.checkingRam) { if (workerScript.loadedFns.getScriptRam) { return 0;