mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-12-18 04:05:46 +01:00
Merge pull request #2640 from deathly809/bug/getWeakenTime_should_take_optional_hostname
GetWeakenTime should take optional hostname as docs suggest
This commit is contained in:
commit
903e8f16a2
2
dist/bitburner.d.ts
vendored
2
dist/bitburner.d.ts
vendored
@ -3848,7 +3848,7 @@ export declare interface NS extends Singularity {
|
|||||||
* @param host - Host of target server.
|
* @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.
|
* @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.
|
* Get the income of a script.
|
||||||
|
@ -2012,7 +2012,7 @@ export function NetscriptFunctions(workerScript: WorkerScript): NS {
|
|||||||
|
|
||||||
return calculateGrowTime(server, Player) * 1000;
|
return calculateGrowTime(server, Player) * 1000;
|
||||||
},
|
},
|
||||||
getWeakenTime: function (hostname: any): any {
|
getWeakenTime: function (hostname: any = workerScript.hostname): any {
|
||||||
updateDynamicRam("getWeakenTime", getRamCost(Player, "getWeakenTime"));
|
updateDynamicRam("getWeakenTime", getRamCost(Player, "getWeakenTime"));
|
||||||
const server = safeGetServer(hostname, "getWeakenTime");
|
const server = safeGetServer(hostname, "getWeakenTime");
|
||||||
if (!(server instanceof Server)) {
|
if (!(server instanceof Server)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user