mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-10 01:33:54 +01:00
Merge pull request #2243 from TheMas3212/dev
Add Function Call signatures to ns.kill so typescript is able to call ns.kill correctly
This commit is contained in:
commit
a6be7ecc3e
@ -1009,7 +1009,7 @@ export function NetscriptFunctions(workerScript: WorkerScript): NS {
|
||||
workerScript.log("spawn", () => "Exiting...");
|
||||
}
|
||||
},
|
||||
kill: function (filename: any, hostname: any, ...scriptArgs: any): any {
|
||||
kill: function (filename: any, hostname?: any, ...scriptArgs: any): any {
|
||||
updateDynamicRam("kill", getRamCost("kill"));
|
||||
|
||||
let res;
|
||||
@ -2025,7 +2025,7 @@ export function NetscriptFunctions(workerScript: WorkerScript): NS {
|
||||
|
||||
return calculateWeakenTime(server, Player) * 1000;
|
||||
},
|
||||
getScriptIncome: function (scriptname: any, hostname: any, ...args: any[]): any {
|
||||
getScriptIncome: function (scriptname?: any, hostname?: any, ...args: any[]): any {
|
||||
updateDynamicRam("getScriptIncome", getRamCost("getScriptIncome"));
|
||||
if (arguments.length === 0) {
|
||||
const res = [];
|
||||
@ -2054,7 +2054,7 @@ export function NetscriptFunctions(workerScript: WorkerScript): NS {
|
||||
return runningScriptObj.onlineMoneyMade / runningScriptObj.onlineRunningTime;
|
||||
}
|
||||
},
|
||||
getScriptExpGain: function (scriptname: any, hostname: any, ...args: any[]): any {
|
||||
getScriptExpGain: function (scriptname?: any, hostname?: any, ...args: any[]): any {
|
||||
updateDynamicRam("getScriptExpGain", getRamCost("getScriptExpGain"));
|
||||
if (arguments.length === 0) {
|
||||
let total = 0;
|
||||
|
7
src/ScriptEditor/NetscriptDefinitions.d.ts
vendored
7
src/ScriptEditor/NetscriptDefinitions.d.ts
vendored
@ -4680,7 +4680,8 @@ export interface NS extends Singularity {
|
||||
* @param args - Arguments to identify which script to kill.
|
||||
* @returns True if the script is successfully killed, and false otherwise.
|
||||
*/
|
||||
kill(script: string | number, host: string, ...args: string[]): boolean;
|
||||
kill(script: number): boolean;
|
||||
kill(script: string, host: string, ...args: string[]): boolean;
|
||||
|
||||
/**
|
||||
* Terminate all scripts on a server.
|
||||
@ -5543,7 +5544,8 @@ export interface NS extends Singularity {
|
||||
* @param args - Arguments that the script is running with.
|
||||
* @returns Amount of income the specified script generates while online.
|
||||
*/
|
||||
getScriptIncome(script: string, host: string, ...args: string[]): number | [number, number];
|
||||
getScriptIncome(): [number, number];
|
||||
getScriptIncome(script: string, host: string, ...args: string[]): number;
|
||||
|
||||
/**
|
||||
* Get the exp gain of a script.
|
||||
@ -5562,6 +5564,7 @@ export interface NS extends Singularity {
|
||||
* @param args - Arguments that the script is running with.
|
||||
* @returns Amount of hacking experience the specified script generates while online.
|
||||
*/
|
||||
getScriptExpGain(): number;
|
||||
getScriptExpGain(script: string, host: string, ...args: string[]): number;
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user