diff --git a/src/NetscriptFunctions.ts b/src/NetscriptFunctions.ts index 5ffbce6c4..b52f1b83c 100644 --- a/src/NetscriptFunctions.ts +++ b/src/NetscriptFunctions.ts @@ -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; diff --git a/src/ScriptEditor/NetscriptDefinitions.d.ts b/src/ScriptEditor/NetscriptDefinitions.d.ts index 76b24953a..cfc02ffe9 100644 --- a/src/ScriptEditor/NetscriptDefinitions.d.ts +++ b/src/ScriptEditor/NetscriptDefinitions.d.ts @@ -4680,8 +4680,9 @@ 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. * @remarks @@ -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; /**