mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-21 00:32:51 +02:00
Added RAM usage calculations for wget() Netscript fn
This commit is contained in:
@@ -2262,6 +2262,10 @@ function NetscriptFunctions(workerScript) {
|
||||
});
|
||||
},
|
||||
wget : async function(url, target, ip=workerScript.serverIp) {
|
||||
if (workerScript.checkingRam) {
|
||||
return updateStaticRam("wget", CONSTANTS.ScriptWgetRamCost);
|
||||
}
|
||||
updateDynamicRam("wget", CONSTANTS.ScriptWgetRamCost);
|
||||
if (!isScriptFilename(target) && !target.endsWith(".txt")) {
|
||||
workerSript.log(`ERROR: wget() failed because of an invalid target file: ${target}. Target file must be a script or text file`);
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user