From dc6432fa4e997b1465e53e4ef72791694fb2b696 Mon Sep 17 00:00:00 2001 From: "Jeffrey A. Robinson" Date: Fri, 14 Jan 2022 17:14:35 -0800 Subject: [PATCH] getWeakenTime should take an optional hostname --- dist/bitburner.d.ts | 2 +- src/NetscriptFunctions.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/bitburner.d.ts b/dist/bitburner.d.ts index bc1328bb4..9855c3e34 100644 --- a/dist/bitburner.d.ts +++ b/dist/bitburner.d.ts @@ -3848,7 +3848,7 @@ export declare interface NS extends Singularity { * @param host - Host of target server. * @returns Returns the amount of time in milliseconds it takes to execute the weaken Netscript function. Returns Infinity if called on a Hacknet Server. */ - getWeakenTime(host: string): number; + getWeakenTime(host?: string): number; /** * Get the income of a script. diff --git a/src/NetscriptFunctions.ts b/src/NetscriptFunctions.ts index b047aba7e..f51a81d45 100644 --- a/src/NetscriptFunctions.ts +++ b/src/NetscriptFunctions.ts @@ -2014,7 +2014,7 @@ export function NetscriptFunctions(workerScript: WorkerScript): NS { return calculateGrowTime(server, Player) * 1000; }, - getWeakenTime: function (hostname: any): any { + getWeakenTime: function (hostname: any = workerScript.hostname): any { updateDynamicRam("getWeakenTime", getRamCost(Player, "getWeakenTime")); const server = safeGetServer(hostname, "getWeakenTime"); if (!(server instanceof Server)) {