mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-18 07:18:38 +02:00
Merge branch 'dev' into corp-remove-async
This commit is contained in:
57
src/ScriptEditor/NetscriptDefinitions.d.ts
vendored
57
src/ScriptEditor/NetscriptDefinitions.d.ts
vendored
@@ -3080,28 +3080,30 @@ export interface Bladeburner {
|
||||
* @remarks
|
||||
* RAM cost: 4 GB
|
||||
*
|
||||
* This function returns the number of skill points needed to upgrade the specified skill.
|
||||
* This function returns the number of skill points needed to upgrade the specified skill the specified number of times.
|
||||
*
|
||||
* The function returns -1 if an invalid skill name is passed in.
|
||||
*
|
||||
* @param skillName - Name of skill. Case-sensitive and must be an exact match
|
||||
* @param count - Number of times to upgrade the skill. Defaults to 1 if not specified.
|
||||
* @returns Number of skill points needed to upgrade the specified skill.
|
||||
*/
|
||||
getSkillUpgradeCost(name: string): number;
|
||||
getSkillUpgradeCost(name: string, count?: number): number;
|
||||
|
||||
/**
|
||||
* Upgrade skill.
|
||||
* @remarks
|
||||
* RAM cost: 4 GB
|
||||
*
|
||||
* Attempts to upgrade the specified Bladeburner skill.
|
||||
* Attempts to upgrade the specified Bladeburner skill the specified number of times.
|
||||
*
|
||||
* Returns true if the skill is successfully upgraded, and false otherwise.
|
||||
*
|
||||
* @param skillName - Name of skill to be upgraded. Case-sensitive and must be an exact match
|
||||
* @param count - Number of times to upgrade the skill. Defaults to 1 if not specified.
|
||||
* @returns true if the skill is successfully upgraded, and false otherwise.
|
||||
*/
|
||||
upgradeSkill(name: string): boolean;
|
||||
upgradeSkill(name: string, count?: number): boolean;
|
||||
|
||||
/**
|
||||
* Get team size.
|
||||
@@ -4859,6 +4861,7 @@ export interface NS {
|
||||
* @remarks
|
||||
* RAM cost: 0 GB
|
||||
*
|
||||
* see: https://github.com/alexei/sprintf.js
|
||||
* @param format - format of the message
|
||||
* @param msg - Value to be printed.
|
||||
*/
|
||||
@@ -4950,7 +4953,7 @@ export interface NS {
|
||||
* @param args - Arguments to identify which scripts to get logs for.
|
||||
* @returns Returns an string array, where each line is an element in the array. The most recently logged line is at the end of the array.
|
||||
*/
|
||||
getScriptLogs(fn?: string, host?: string, ...args: any[]): string[];
|
||||
getScriptLogs(fn?: string, host?: string, ...args: (string | number | boolean)[]): string[];
|
||||
|
||||
/**
|
||||
* Get an array of recently killed scripts across all servers.
|
||||
@@ -5013,7 +5016,7 @@ export interface NS {
|
||||
* @param host - Optional. Hostname of the script being tailed. Defaults to the server this script is running on. If args are specified, this is not optional.
|
||||
* @param args - Arguments for the script being tailed.
|
||||
*/
|
||||
tail(fn?: FilenameOrPID, host?: string, ...args: any[]): void;
|
||||
tail(fn?: FilenameOrPID, host?: string, ...args: (string | number | boolean)[]): void;
|
||||
|
||||
/**
|
||||
* Close the tail window of a script.
|
||||
@@ -5218,7 +5221,7 @@ export interface NS {
|
||||
* @param args - Additional arguments to pass into the new script that is being run. Note that if any arguments are being passed into the new script, then the second argument numThreads must be filled in with a value.
|
||||
* @returns Returns the PID of a successfully started script, and 0 otherwise.
|
||||
*/
|
||||
run(script: string, numThreads?: number, ...args: Array<string | number | boolean>): number;
|
||||
run(script: string, numThreads?: number, ...args: (string | number | boolean)[]): number;
|
||||
|
||||
/**
|
||||
* Start another script on any server.
|
||||
@@ -5266,7 +5269,7 @@ export interface NS {
|
||||
* @param args - Additional arguments to pass into the new script that is being run. Note that if any arguments are being passed into the new script, then the third argument numThreads must be filled in with a value.
|
||||
* @returns Returns the PID of a successfully started script, and 0 otherwise.
|
||||
*/
|
||||
exec(script: string, host: string, numThreads?: number, ...args: Array<string | number | boolean>): number;
|
||||
exec(script: string, host: string, numThreads?: number, ...args: (string | number | boolean)[]): number;
|
||||
|
||||
/**
|
||||
* Terminate current script and start another in 10s.
|
||||
@@ -5296,7 +5299,7 @@ export interface NS {
|
||||
* @param numThreads - Number of threads to spawn new script with. Will be rounded to nearest integer.
|
||||
* @param args - Additional arguments to pass into the new script that is being run.
|
||||
*/
|
||||
spawn(script: string, numThreads?: number, ...args: string[]): void;
|
||||
spawn(script: string, numThreads?: number, ...args: (string | number | boolean)[]): void;
|
||||
|
||||
/**
|
||||
* Terminate another script.
|
||||
@@ -5366,7 +5369,7 @@ export interface NS {
|
||||
* ns.kill("foo.script", getHostname(), 1, "foodnstuff");
|
||||
* ```
|
||||
*/
|
||||
kill(script: string, host: string, ...args: string[]): boolean;
|
||||
kill(script: string, host: string, ...args: (string | number | boolean)[]): boolean;
|
||||
|
||||
/**
|
||||
* Terminate all scripts on a server.
|
||||
@@ -5863,7 +5866,7 @@ export interface NS {
|
||||
* @param args - Arguments to specify/identify which scripts to search for.
|
||||
* @returns True if specified script is running on the target server, and false otherwise.
|
||||
*/
|
||||
isRunning(script: FilenameOrPID, host: string, ...args: string[]): boolean;
|
||||
isRunning(script: FilenameOrPID, host?: string, ...args: (string | number | boolean)[]): boolean;
|
||||
|
||||
/**
|
||||
* Get general info about a running script.
|
||||
@@ -5878,7 +5881,11 @@ export interface NS {
|
||||
* @param args - Arguments to identify the script
|
||||
* @returns The info about the running script if found, and null otherwise.
|
||||
*/
|
||||
getRunningScript(filename?: FilenameOrPID, hostname?: string, ...args: (string | number)[]): RunningScript | null;
|
||||
getRunningScript(
|
||||
filename?: FilenameOrPID,
|
||||
hostname?: string,
|
||||
...args: (string | number | boolean)[]
|
||||
): RunningScript | null;
|
||||
|
||||
/**
|
||||
* Get cost of purchasing a server.
|
||||
@@ -6204,13 +6211,13 @@ export interface NS {
|
||||
* Get the execution time of a hack() call.
|
||||
* @remarks
|
||||
* RAM cost: 0.05 GB
|
||||
*When `hack` completes an amount of money is stolen depending on the player's skills.
|
||||
*
|
||||
* When `hack` completes an amount of money is stolen depending on the player's skills.
|
||||
* Returns the amount of time in milliseconds it takes to execute the hack Netscript function on the target server.
|
||||
* The function takes in an optional hackLvl parameter that can be specified to see what the hack time would be at different hacking levels.
|
||||
* The required time is increased by the security level of the target server and decreased by the player's hacking level.
|
||||
*
|
||||
* @param host - Host of target server.
|
||||
* @returns Returns the amount of time in milliseconds it takes to execute the hack Netscript function. Returns Infinity if called on a Hacknet Server.
|
||||
* @returns Returns the amount of time in milliseconds it takes to execute the hack Netscript function.
|
||||
*/
|
||||
getHackTime(host: string): number;
|
||||
|
||||
@@ -6220,11 +6227,10 @@ export interface NS {
|
||||
* RAM cost: 0.05 GB
|
||||
*
|
||||
* Returns the amount of time in milliseconds it takes to execute the grow Netscript function on the target server.
|
||||
* The function takes in an optional hackLvl parameter that can be specified to see what the grow time would be at different hacking levels.
|
||||
* The required time is increased by the security level of the target server and decreased by the player's hacking level.
|
||||
*
|
||||
* @param host - Host of target server.
|
||||
* @returns Returns the amount of time in milliseconds it takes to execute the grow Netscript function. Returns Infinity if called on a Hacknet Server.
|
||||
* @returns Returns the amount of time in milliseconds it takes to execute the grow Netscript function.
|
||||
*/
|
||||
getGrowTime(host: string): number;
|
||||
|
||||
@@ -6234,11 +6240,10 @@ export interface NS {
|
||||
* RAM cost: 0.05 GB
|
||||
*
|
||||
* Returns the amount of time in milliseconds it takes to execute the weaken Netscript function on the target server.
|
||||
* The function takes in an optional hackLvl parameter that can be specified to see what the weaken time would be at different hacking levels.
|
||||
* The required time is increased by the security level of the target server and decreased by the player's hacking level.
|
||||
*
|
||||
* @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.
|
||||
*/
|
||||
getWeakenTime(host: string): number;
|
||||
|
||||
@@ -6271,7 +6276,7 @@ export interface NS {
|
||||
/**
|
||||
* {@inheritDoc NS.(getScriptIncome:1)}
|
||||
*/
|
||||
getScriptIncome(script: string, host: string, ...args: string[]): number;
|
||||
getScriptIncome(script: string, host: string, ...args: (string | number | boolean)[]): number;
|
||||
|
||||
/**
|
||||
* Get the exp gain of a script.
|
||||
@@ -6295,7 +6300,7 @@ export interface NS {
|
||||
/**
|
||||
* {@inheritDoc NS.(getScriptExpGain:1)}
|
||||
*/
|
||||
getScriptExpGain(script: string, host: string, ...args: string[]): number;
|
||||
getScriptExpGain(script: string, host: string, ...args: (string | number | boolean)[]): number;
|
||||
|
||||
/**
|
||||
* Returns the amount of time in milliseconds that have passed since you last installed Augmentations.
|
||||
@@ -7047,9 +7052,9 @@ export interface Corporation extends WarehouseAPI, OfficeAPI {
|
||||
levelUpgrade(upgradeName: string): void;
|
||||
/**
|
||||
* Issue dividends
|
||||
* @param percent - Percent of profit to issue as dividends.
|
||||
* @param rate - Fraction of profit to issue as dividends.
|
||||
*/
|
||||
issueDividends(percent: number): void;
|
||||
issueDividends(rate: number): void;
|
||||
/**
|
||||
* Buyback Shares
|
||||
* @param amount - Amount of shares to buy back.
|
||||
@@ -7099,6 +7104,12 @@ interface CorporationInfo {
|
||||
issuedShares: number;
|
||||
/** Price of the shares */
|
||||
sharePrice: number;
|
||||
/** Fraction of profits issued as dividends */
|
||||
dividendRate: number;
|
||||
/** Tax applied on your earnings as a shareholder */
|
||||
dividendTax: number;
|
||||
/** Your earnings as a shareholder per second this cycle */
|
||||
dividendEarnings: number;
|
||||
/** State of the corporation. Possible states are START, PURCHASE, PRODUCTION, SALE, EXPORT. */
|
||||
state: string;
|
||||
/** Array of all divisions */
|
||||
|
||||
Reference in New Issue
Block a user