diff --git a/src/NetscriptFunctions.ts b/src/NetscriptFunctions.ts index e84d88a8b..8f5c8e266 100644 --- a/src/NetscriptFunctions.ts +++ b/src/NetscriptFunctions.ts @@ -1161,7 +1161,11 @@ export const ns: InternalAPI = { const cost = getPurchaseServerCost(ram); if (cost === Infinity) { - helpers.log(ctx, () => `Invalid argument: ram='${ram}'`); + if (ram > getPurchaseServerMaxRam()) { + helpers.log(ctx, () => `Invalid argument: ram='${ram}' must not be greater than getPurchaseServerMaxRam`); + } else { + helpers.log(ctx, () => `Invalid argument: ram='${ram}' must be a positive power of 2`); + } return Infinity; }