getWeakenTime should take an optional hostname

This commit is contained in:
Jeffrey A. Robinson 2022-01-14 17:14:35 -08:00
parent 3e7a9ac896
commit dc6432fa4e
2 changed files with 2 additions and 2 deletions

2
dist/bitburner.d.ts vendored

@ -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.

@ -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)) {