From bb6c2cd79e7380a35eb335a7357c0e17fa807098 Mon Sep 17 00:00:00 2001 From: lethern Date: Mon, 17 Jan 2022 23:53:44 +0100 Subject: [PATCH 1/4] Update NetscriptFunctions.ts --- src/NetscriptFunctions.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/NetscriptFunctions.ts b/src/NetscriptFunctions.ts index ae122b980..dfa931e6c 100644 --- a/src/NetscriptFunctions.ts +++ b/src/NetscriptFunctions.ts @@ -522,7 +522,7 @@ export function NetscriptFunctions(workerScript: WorkerScript): NS { if (isNaN(hackAmount)) { throw makeRuntimeErrorMsg( "hackAnalyzeThreads", - `Invalid growth argument passed into hackAnalyzeThreads: ${hackAmount}. Must be numeric.`, + `Invalid hackAmount argument passed into hackAnalyzeThreads: ${hackAmount}. Must be numeric.`, ); } From 1dcae1aeec751d87afd493f9b61b2a979576f557 Mon Sep 17 00:00:00 2001 From: lethern Date: Tue, 18 Jan 2022 16:15:40 +0100 Subject: [PATCH 2/4] Update NetscriptDefinitions.d.ts grow/weaken/hack: removed threads part from example - confuses newbies --- src/ScriptEditor/NetscriptDefinitions.d.ts | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/ScriptEditor/NetscriptDefinitions.d.ts b/src/ScriptEditor/NetscriptDefinitions.d.ts index 16a778fc5..4a566a6c7 100644 --- a/src/ScriptEditor/NetscriptDefinitions.d.ts +++ b/src/ScriptEditor/NetscriptDefinitions.d.ts @@ -4196,13 +4196,11 @@ export interface NS extends Singularity { * ```ts * // NS1: * var earnedMoney = hack("foodnstuff"); - * earnedMoney = earnedMoney + hack("foodnstuff", { threads: 5 }); // Only use 5 threads to hack * ``` * @example * ```ts * // NS2: * let earnedMoney = await ns.hack("foodnstuff"); - * earnedMoney += await ns.hack("foodnstuff", { threads: 5 }); // Only use 5 threads to hack * ``` * @param host - Hostname of the target server to hack. * @param opts - Optional parameters for configuring function behavior. @@ -4230,16 +4228,14 @@ export interface NS extends Singularity { * @example * ```ts * // NS1: - * var availableMoney = getServerMoneyAvailable("foodnstuff"); + * var currentMoney = getServerMoneyAvailable("foodnstuff"); * currentMoney = currentMoney * (1 + grow("foodnstuff")); - * currentMoney = currentMoney * (1 + grow("foodnstuff", { threads: 5 })); // Only use 5 threads to grow * ``` * @example * ```ts * // NS2: - * let availableMoney = ns.getServerMoneyAvailable("foodnstuff"); + * let currentMoney = ns.getServerMoneyAvailable("foodnstuff"); * currentMoney *= (1 + await ns.grow("foodnstuff")); - * currentMoney *= (1 + await ns.grow("foodnstuff", { threads: 5 })); // Only use 5 threads to grow * ``` * @param host - Hostname of the target server to grow. * @param opts - Optional parameters for configuring function behavior. @@ -4265,14 +4261,12 @@ export interface NS extends Singularity { * // NS1: * var currentSecurity = getServerSecurityLevel("foodnstuff"); * currentSecurity = currentSecurity - weaken("foodnstuff"); - * currentSecurity = currentSecurity - weaken("foodnstuff", { threads: 5 }); // Only use 5 threads to weaken * ``` * @example * ```ts * // NS2: * let currentSecurity = ns.getServerSecurityLevel("foodnstuff"); * currentSecurity -= await ns.weaken("foodnstuff"); - * currentSecurity -= await ns.weaken("foodnstuff", { threads: 5 }); // Only use 5 threads to weaken * ``` * @param host - Hostname of the target server to weaken. * @param opts - Optional parameters for configuring function behavior. From 61cea12ca237b85e3b86fcff0028b8fcadebb13d Mon Sep 17 00:00:00 2001 From: lethern Date: Wed, 19 Jan 2022 19:09:33 +0100 Subject: [PATCH 3/4] purchaseServer: improved error message for ram > maxRam --- src/NetscriptFunctions.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/NetscriptFunctions.ts b/src/NetscriptFunctions.ts index dfa931e6c..faafef35c 100644 --- a/src/NetscriptFunctions.ts +++ b/src/NetscriptFunctions.ts @@ -1631,7 +1631,12 @@ export function NetscriptFunctions(workerScript: WorkerScript): NS { const cost = getPurchaseServerCost(ram); if (cost === Infinity) { - workerScript.log("purchaseServer", () => `Invalid argument: ram='${ram}' must be a positive power of 2`); + if(ram > getPurchaseServerMaxRam()){ + workerScript.log("purchaseServer", () => `Invalid argument: ram='${ram}' must not be greater than getPurchaseServerMaxRam`); + }else{ + workerScript.log("purchaseServer", () => `Invalid argument: ram='${ram}' must be a positive power of 2`); + } + return ""; } From a96053a82b754415c6362afd2b9e5ead411c16e9 Mon Sep 17 00:00:00 2001 From: lethern Date: Fri, 21 Jan 2022 15:51:31 +0100 Subject: [PATCH 4/4] Aug info: fixed typo --- src/Augmentation/AugmentationHelpers.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Augmentation/AugmentationHelpers.tsx b/src/Augmentation/AugmentationHelpers.tsx index 915e01c33..27d19ab76 100644 --- a/src/Augmentation/AugmentationHelpers.tsx +++ b/src/Augmentation/AugmentationHelpers.tsx @@ -2050,7 +2050,7 @@ function initAugmentations(): void { info: "A brain implant carefully assembled around the synapses, which " + "micromanages the activity and levels of various neuroreceptor " + - "chemicals and modulates electrical acvitiy to optimize concentration, " + + "chemicals and modulates electrical activity to optimize concentration, " + "allowing the user to multitask much more effectively.", stats: ( <>