merge dev

This commit is contained in:
Olivier Gagnon 2022-07-20 12:16:42 -04:00
commit c9b9c2c55b
47 changed files with 223 additions and 120 deletions

66
dist/bitburner.d.ts vendored

@ -313,7 +313,7 @@ export declare interface Bladeburner {
* @remarks
* RAM cost: 4 GB
*
* Returns the number of seconds it takes to complete the specified action
* Returns the number of milliseconds it takes to complete the specified action
*
* @param type - Type of action.
* @param name - Name of action. Must be an exact match.
@ -321,6 +321,17 @@ export declare interface Bladeburner {
*/
getActionTime(type: string, name: string): number;
/**
* Get the time elapsed on current action.
* @remarks
* RAM cost: 4 GB
*
* Returns the number of milliseconds already spent on the current action.
*
* @returns Number of milliseconds already spent on the current action.
*/
getActionCurrentTime(): number;
/**
* Get estimate success chance of an action.
* @remarks
@ -496,28 +507,30 @@ export declare 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.
@ -673,7 +686,7 @@ export declare interface Bladeburner {
* @remarks
* RAM cost: 0 GB
*
* Returns the amount of accumulated bonus time (seconds) for the Bladeburner mechanic.
* Returns the amount of accumulated bonus time (milliseconds) for the Bladeburner mechanic.
*
* Bonus time is accumulated when the game is offline or if the game is inactive in the browser.
*
@ -1483,7 +1496,7 @@ export declare interface Gang {
* @remarks
* RAM cost: 0 GB
*
* Returns the amount of accumulated bonus time (seconds) for the Gang mechanic.
* Returns the amount of accumulated bonus time (milliseconds) for the Gang mechanic.
*
* Bonus time is accumulated when the game is offline or if the game is inactive in the browser.
*
@ -3059,6 +3072,7 @@ export declare 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.
*/
@ -3150,7 +3164,7 @@ export declare 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.
@ -3213,7 +3227,7 @@ export declare 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.
@ -3418,7 +3432,7 @@ export declare 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.
@ -3466,7 +3480,7 @@ export declare 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.
@ -3496,7 +3510,7 @@ export declare 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.
@ -3566,7 +3580,7 @@ export declare 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.
@ -4063,7 +4077,7 @@ export declare 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.
@ -4078,7 +4092,11 @@ export declare 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.
@ -4404,13 +4422,13 @@ export declare 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;
@ -4420,11 +4438,10 @@ export declare 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;
@ -4434,11 +4451,10 @@ export declare 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;
@ -4471,7 +4487,7 @@ export declare 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.
@ -4495,7 +4511,7 @@ export declare 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.
@ -6439,6 +6455,8 @@ export declare interface SleeveTask {
gymStatType: string;
/** Faction work type being performed, if any */
factionWorkType: string;
/** Class being taken at university, if any */
className: string;
}
/**

4
dist/main.bundle.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

30
dist/vendor.bundle.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -35,6 +35,8 @@ Furthermore, some BitNodes introduce new content and mechanics. For example ther
BitNode that grants access to the `Singularity API <https://github.com/danielyxie/bitburner/blob/dev/markdown/bitburner.singularity.md>`_.
There is another BitNode in which you can manage a gang to earn money and reputation.
.. _gameplay_bitnodes_howtodestroy:
How to destroy a BitNode
^^^^^^^^^^^^^^^^^^^^^^^^
Initially, the only way to destroy a BitNode is to join the Daedalus :ref:`Daedalus <gameplay_factions>`.

@ -5,7 +5,7 @@
Source-Files
============
Source-Files are a type of persistent upgrade that is more powerful than Augmentations.
Source-Files are received by destroying a BitNode. There are many different BitNodes
Source-Files are received by :ref:`destroying a BitNode <gameplay_bitnodes_howtodestroy>`. There are many different BitNodes
in the game and each BitNode will grant a different Source-File when it is destroyed.
A Source-File can be upgraded by destroying its corresponding BitNode a second or

@ -0,0 +1,25 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [Bladeburner](./bitburner.bladeburner.md) &gt; [getActionCurrentTime](./bitburner.bladeburner.getactioncurrenttime.md)
## Bladeburner.getActionCurrentTime() method
Get the time elapsed on current action.
<b>Signature:</b>
```typescript
getActionCurrentTime(): number;
```
<b>Returns:</b>
number
Number of milliseconds already spent on the current action.
## Remarks
RAM cost: 4 GB
Returns the number of milliseconds already spent on the current action.

@ -29,5 +29,5 @@ Number of milliseconds it takes to complete the specified action.
RAM cost: 4 GB
Returns the number of seconds it takes to complete the specified action
Returns the number of milliseconds it takes to complete the specified action

@ -21,7 +21,7 @@ Amount of accumulated “bonus time” (milliseconds) for the Bladeburner mechan
RAM cost: 0 GB
Returns the amount of accumulated “bonus time” (seconds) for the Bladeburner mechanic.
Returns the amount of accumulated “bonus time” (milliseconds) for the Bladeburner mechanic.
“Bonus time” is accumulated when the game is offline or if the game is inactive in the browser.

@ -9,7 +9,7 @@ Get cost to upgrade skill.
<b>Signature:</b>
```typescript
getSkillUpgradeCost(name: string): number;
getSkillUpgradeCost(name: string, count?: number): number;
```
## Parameters
@ -17,6 +17,7 @@ getSkillUpgradeCost(name: string): number;
| Parameter | Type | Description |
| --- | --- | --- |
| name | string | |
| count | number | Number of times to upgrade the skill. Defaults to 1 if not specified. |
<b>Returns:</b>
@ -28,7 +29,7 @@ Number of skill points needed to upgrade the specified skill.
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.

@ -23,6 +23,7 @@ You have to be employed in the Bladeburner division and be in BitNode-7 or have
| [getActionAutolevel(type, name)](./bitburner.bladeburner.getactionautolevel.md) | Get whether an action is set to autolevel. |
| [getActionCountRemaining(type, name)](./bitburner.bladeburner.getactioncountremaining.md) | Get action count remaining. |
| [getActionCurrentLevel(type, name)](./bitburner.bladeburner.getactioncurrentlevel.md) | Get the current level of an action. |
| [getActionCurrentTime()](./bitburner.bladeburner.getactioncurrenttime.md) | Get the time elapsed on current action. |
| [getActionEstimatedSuccessChance(type, name)](./bitburner.bladeburner.getactionestimatedsuccesschance.md) | Get estimate success chance of an action. |
| [getActionMaxLevel(type, name)](./bitburner.bladeburner.getactionmaxlevel.md) | Get the maximum level of an action. |
| [getActionRepGain(type, name, level)](./bitburner.bladeburner.getactionrepgain.md) | Get the reputation gain of an action. |
@ -42,7 +43,7 @@ You have to be employed in the Bladeburner division and be in BitNode-7 or have
| [getSkillLevel(name)](./bitburner.bladeburner.getskilllevel.md) | Get skill level. |
| [getSkillNames()](./bitburner.bladeburner.getskillnames.md) | List all skills. |
| [getSkillPoints()](./bitburner.bladeburner.getskillpoints.md) | Get bladeburner skill points. |
| [getSkillUpgradeCost(name)](./bitburner.bladeburner.getskillupgradecost.md) | Get cost to upgrade skill. |
| [getSkillUpgradeCost(name, count)](./bitburner.bladeburner.getskillupgradecost.md) | Get cost to upgrade skill. |
| [getStamina()](./bitburner.bladeburner.getstamina.md) | Get bladeburner stamina. |
| [getTeamSize(type, name)](./bitburner.bladeburner.getteamsize.md) | Get team size. |
| [joinBladeburnerDivision()](./bitburner.bladeburner.joinbladeburnerdivision.md) | Join the bladeburner division. |
@ -53,5 +54,5 @@ You have to be employed in the Bladeburner division and be in BitNode-7 or have
| [startAction(type, name)](./bitburner.bladeburner.startaction.md) | Start an action. |
| [stopBladeburnerAction()](./bitburner.bladeburner.stopbladeburneraction.md) | Stop current action. |
| [switchCity(name)](./bitburner.bladeburner.switchcity.md) | Travel to another city in bladeburner. |
| [upgradeSkill(name)](./bitburner.bladeburner.upgradeskill.md) | Upgrade skill. |
| [upgradeSkill(name, count)](./bitburner.bladeburner.upgradeskill.md) | Upgrade skill. |

@ -9,7 +9,7 @@ Upgrade skill.
<b>Signature:</b>
```typescript
upgradeSkill(name: string): boolean;
upgradeSkill(name: string, count?: number): boolean;
```
## Parameters
@ -17,6 +17,7 @@ upgradeSkill(name: string): boolean;
| Parameter | Type | Description |
| --- | --- | --- |
| name | string | |
| count | number | Number of times to upgrade the skill. Defaults to 1 if not specified. |
<b>Returns:</b>
@ -28,7 +29,7 @@ true if the skill is successfully upgraded, and false otherwise.
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.

@ -21,7 +21,7 @@ Bonus time for the Gang mechanic in milliseconds.
RAM cost: 0 GB
Returns the amount of accumulated “bonus time” (seconds) for the Gang mechanic.
Returns the amount of accumulated “bonus time” (milliseconds) for the Gang mechanic.
“Bonus time” is accumulated when the game is offline or if the game is inactive in the browser.

@ -9,7 +9,7 @@ Start another script on any server.
<b>Signature:</b>
```typescript
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;
```
## Parameters
@ -19,7 +19,7 @@ exec(script: string, host: string, numThreads?: number, ...args: Array<string |
| script | string | Filename of script to execute. |
| host | string | Hostname of the <code>target server</code> on which to execute the script. |
| numThreads | number | Optional thread count for new script. Set to 1 by default. Will be rounded to nearest integer. |
| args | Array&lt;string \| number \| boolean&gt; | 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. |
| args | (string \| number \| boolean)\[\] | 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. |
<b>Returns:</b>

@ -22,11 +22,11 @@ getGrowTime(host: string): number;
number
Returns the amount of time in milliseconds it takes to execute the grow Netscript function. Returns Infinity if called on a Hacknet Server.
Returns the amount of time in milliseconds it takes to execute the grow Netscript function.
## Remarks
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.
Returns the amount of time in milliseconds it takes to execute the grow Netscript function on the target server. The required time is increased by the security level of the target server and decreased by the player's hacking level.

@ -22,9 +22,11 @@ getHackTime(host: string): number;
number
Returns the amount of time in milliseconds it takes to execute the hack Netscript function. Returns Infinity if called on a Hacknet Server.
Returns the amount of time in milliseconds it takes to execute the hack Netscript function.
## Remarks
RAM cost: 0.05 GB 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.
RAM cost: 0.05 GB
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 required time is increased by the security level of the target server and decreased by the player's hacking level.

@ -9,7 +9,11 @@ Get general info about a running script.
<b>Signature:</b>
```typescript
getRunningScript(filename?: FilenameOrPID, hostname?: string, ...args: (string | number)[]): RunningScript | null;
getRunningScript(
filename?: FilenameOrPID,
hostname?: string,
...args: (string | number | boolean)[]
): RunningScript | null;
```
## Parameters
@ -18,7 +22,7 @@ getRunningScript(filename?: FilenameOrPID, hostname?: string, ...args: (string |
| --- | --- | --- |
| filename | [FilenameOrPID](./bitburner.filenameorpid.md) | Optional. Filename or PID of the script. |
| hostname | string | Optional. Name of host server the script is running on. |
| args | (string \| number)\[\] | Arguments to identify the script |
| args | (string \| number \| boolean)\[\] | Arguments to identify the script |
<b>Returns:</b>

@ -9,7 +9,7 @@ Get the exp gain of a script.
<b>Signature:</b>
```typescript
getScriptExpGain(script: string, host: string, ...args: string[]): number;
getScriptExpGain(script: string, host: string, ...args: (string | number | boolean)[]): number;
```
## Parameters
@ -18,7 +18,7 @@ getScriptExpGain(script: string, host: string, ...args: string[]): number;
| --- | --- | --- |
| script | string | Filename of script. |
| host | string | Server on which script is running. |
| args | string\[\] | Arguments that the script is running with. |
| args | (string \| number \| boolean)\[\] | Arguments that the script is running with. |
<b>Returns:</b>

@ -9,7 +9,7 @@ Get the income of a script.
<b>Signature:</b>
```typescript
getScriptIncome(script: string, host: string, ...args: string[]): number;
getScriptIncome(script: string, host: string, ...args: (string | number | boolean)[]): number;
```
## Parameters
@ -18,7 +18,7 @@ getScriptIncome(script: string, host: string, ...args: string[]): number;
| --- | --- | --- |
| script | string | Filename of script. |
| host | string | Server on which script is running. |
| args | string\[\] | Arguments that the script is running with. |
| args | (string \| number \| boolean)\[\] | Arguments that the script is running with. |
<b>Returns:</b>

@ -9,7 +9,7 @@ Get all the logs of a script.
<b>Signature:</b>
```typescript
getScriptLogs(fn?: string, host?: string, ...args: any[]): string[];
getScriptLogs(fn?: string, host?: string, ...args: (string | number | boolean)[]): string[];
```
## Parameters
@ -18,7 +18,7 @@ getScriptLogs(fn?: string, host?: string, ...args: any[]): string[];
| --- | --- | --- |
| fn | string | Optional. Filename of script to get logs from. |
| host | string | Optional. Hostname of the server that the script is on. |
| args | any\[\] | Arguments to identify which scripts to get logs for. |
| args | (string \| number \| boolean)\[\] | Arguments to identify which scripts to get logs for. |
<b>Returns:</b>

@ -22,11 +22,11 @@ getWeakenTime(host: string): number;
number
Returns the amount of time in milliseconds it takes to execute the weaken Netscript function. Returns Infinity if called on a Hacknet Server.
Returns the amount of time in milliseconds it takes to execute the weaken Netscript function.
## Remarks
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.
Returns the amount of time in milliseconds it takes to execute the weaken Netscript function on the target server. The required time is increased by the security level of the target server and decreased by the player's hacking level.

@ -9,7 +9,7 @@ Check if a script is running.
<b>Signature:</b>
```typescript
isRunning(script: FilenameOrPID, host: string, ...args: string[]): boolean;
isRunning(script: FilenameOrPID, host?: string, ...args: (string | number | boolean)[]): boolean;
```
## Parameters
@ -18,7 +18,7 @@ isRunning(script: FilenameOrPID, host: string, ...args: string[]): boolean;
| --- | --- | --- |
| script | [FilenameOrPID](./bitburner.filenameorpid.md) | Filename or PID of script to check. This is case-sensitive. |
| host | string | Host of target server. |
| args | string\[\] | Arguments to specify/identify which scripts to search for. |
| args | (string \| number \| boolean)\[\] | Arguments to specify/identify which scripts to search for. |
<b>Returns:</b>

@ -9,7 +9,7 @@ Terminate another script.
<b>Signature:</b>
```typescript
kill(script: string, host: string, ...args: string[]): boolean;
kill(script: string, host: string, ...args: (string | number | boolean)[]): boolean;
```
## Parameters
@ -18,7 +18,7 @@ kill(script: string, host: string, ...args: string[]): boolean;
| --- | --- | --- |
| script | string | Filename or pid of the script to kill |
| host | string | Hostname of the server on which to kill the script. |
| args | string\[\] | Arguments to identify which script to kill. |
| args | (string \| number \| boolean)\[\] | Arguments to identify which script to kill. |
<b>Returns:</b>

@ -9,7 +9,7 @@ Start another script on the current server.
<b>Signature:</b>
```typescript
run(script: string, numThreads?: number, ...args: Array<string | number | boolean>): number;
run(script: string, numThreads?: number, ...args: (string | number | boolean)[]): number;
```
## Parameters
@ -18,7 +18,7 @@ run(script: string, numThreads?: number, ...args: Array<string | number | boolea
| --- | --- | --- |
| script | string | Filename of script to run. |
| numThreads | number | Optional thread count for new script. Set to 1 by default. Will be rounded to nearest integer. |
| args | Array&lt;string \| number \| boolean&gt; | 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. |
| args | (string \| number \| boolean)\[\] | 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. |
<b>Returns:</b>

@ -9,7 +9,7 @@ Terminate current script and start another in 10s.
<b>Signature:</b>
```typescript
spawn(script: string, numThreads?: number, ...args: string[]): void;
spawn(script: string, numThreads?: number, ...args: (string | number | boolean)[]): void;
```
## Parameters
@ -18,7 +18,7 @@ spawn(script: string, numThreads?: number, ...args: string[]): void;
| --- | --- | --- |
| script | string | Filename of script to execute. |
| numThreads | number | Number of threads to spawn new script with. Will be rounded to nearest integer. |
| args | string\[\] | Additional arguments to pass into the new script that is being run. |
| args | (string \| number \| boolean)\[\] | Additional arguments to pass into the new script that is being run. |
<b>Returns:</b>

@ -9,7 +9,7 @@ Open the tail window of a script.
<b>Signature:</b>
```typescript
tail(fn?: FilenameOrPID, host?: string, ...args: any[]): void;
tail(fn?: FilenameOrPID, host?: string, ...args: (string | number | boolean)[]): void;
```
## Parameters
@ -18,7 +18,7 @@ tail(fn?: FilenameOrPID, host?: string, ...args: any[]): void;
| --- | --- | --- |
| fn | [FilenameOrPID](./bitburner.filenameorpid.md) | Optional. Filename or PID of the script being tailed. If omitted, the current script is tailed. |
| host | string | Optional. Hostname of the script being tailed. Defaults to the server this script is running on. If args are specified, this is not optional. |
| args | any\[\] | Arguments for the script being tailed. |
| args | (string \| number \| boolean)\[\] | Arguments for the script being tailed. |
<b>Returns:</b>

@ -27,3 +27,5 @@ void
RAM cost: 0 GB
see: https://github.com/alexei/sprintf.js

@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [SleeveTask](./bitburner.sleevetask.md) &gt; [className](./bitburner.sleevetask.classname.md)
## SleeveTask.className property
Class being taken at university, if any
<b>Signature:</b>
```typescript
className: string;
```

@ -16,6 +16,7 @@ export interface SleeveTask
| Property | Type | Description |
| --- | --- | --- |
| [className](./bitburner.sleevetask.classname.md) | string | Class being taken at university, if any |
| [crime](./bitburner.sleevetask.crime.md) | string | Crime currently attempting, if any |
| [factionWorkType](./bitburner.sleevetask.factionworktype.md) | string | Faction work type being performed, if any |
| [gymStatType](./bitburner.sleevetask.gymstattype.md) | string | Stat being trained at the gym, if any |

@ -236,13 +236,13 @@ export class Bladeburner implements IBladeburner {
}
}
upgradeSkill(skill: Skill): void {
upgradeSkill(skill: Skill, count = 1): void {
// This does NOT handle deduction of skill points
const skillName = skill.name;
if (this.skills[skillName]) {
++this.skills[skillName];
this.skills[skillName] += count;
} else {
this.skills[skillName] = 1;
this.skills[skillName] = count;
}
if (isNaN(this.skills[skillName]) || this.skills[skillName] < 0) {
throw new Error("Level of Skill " + skillName + " is invalid: " + this.skills[skillName]);
@ -2277,7 +2277,7 @@ export class Bladeburner implements IBladeburner {
}
}
getSkillUpgradeCostNetscriptFn(skillName: string, workerScript: WorkerScript): number {
getSkillUpgradeCostNetscriptFn(skillName: string, count: number, workerScript: WorkerScript): number {
if (skillName === "" || !Skills.hasOwnProperty(skillName)) {
workerScript.log("bladeburner.getSkillUpgradeCost", () => `Invalid skill: '${skillName}'`);
return -1;
@ -2285,13 +2285,13 @@ export class Bladeburner implements IBladeburner {
const skill = Skills[skillName];
if (this.skills[skillName] == null) {
return skill.calculateCost(0);
return skill.calculateCost(0, count);
} else {
return skill.calculateCost(this.skills[skillName]);
return skill.calculateCost(this.skills[skillName], count);
}
}
upgradeSkillNetscriptFn(skillName: string, workerScript: WorkerScript): boolean {
upgradeSkillNetscriptFn(skillName: string, count: number, workerScript: WorkerScript): boolean {
const errorLogText = `Invalid skill: '${skillName}'`;
if (!Skills.hasOwnProperty(skillName)) {
workerScript.log("bladeburner.upgradeSkill", () => errorLogText);
@ -2303,10 +2303,10 @@ export class Bladeburner implements IBladeburner {
if (this.skills[skillName] && !isNaN(this.skills[skillName])) {
currentLevel = this.skills[skillName];
}
const cost = skill.calculateCost(currentLevel);
const cost = skill.calculateCost(currentLevel, count);
if (skill.maxLvl && currentLevel >= skill.maxLvl) {
workerScript.log("bladeburner.upgradeSkill", () => `Skill '${skillName}' is already maxed.`);
if (skill.maxLvl && currentLevel + count > skill.maxLvl) {
workerScript.log("bladeburner.upgradeSkill", () => `Skill '${skillName}' cannot be upgraded ${count} time(s).`);
return false;
}
@ -2314,13 +2314,13 @@ export class Bladeburner implements IBladeburner {
workerScript.log(
"bladeburner.upgradeSkill",
() =>
`You do not have enough skill points to upgrade ${skillName} (You have ${this.skillPoints}, you need ${cost})`,
`You do not have enough skill points to upgrade ${skillName} ${count} time(s). (You have ${this.skillPoints}, you need ${cost})`,
);
return false;
}
this.skillPoints -= cost;
this.upgradeSkill(skill);
this.upgradeSkill(skill, count);
workerScript.log("bladeburner.upgradeSkill", () => `'${skillName}' upgraded to level ${this.skills[skillName]}`);
return true;
}

@ -84,8 +84,8 @@ export interface IBladeburner {
getActionEstimatedSuccessChanceNetscriptFn(person: IPerson, type: string, name: string): [number, number] | string;
getActionCountRemainingNetscriptFn(type: string, name: string, workerScript: WorkerScript): number;
getSkillLevelNetscriptFn(skillName: string, workerScript: WorkerScript): number;
getSkillUpgradeCostNetscriptFn(skillName: string, workerScript: WorkerScript): number;
upgradeSkillNetscriptFn(skillName: string, workerScript: WorkerScript): boolean;
getSkillUpgradeCostNetscriptFn(skillName: string, count: number, workerScript: WorkerScript): number;
upgradeSkillNetscriptFn(skillName: string, count: number, workerScript: WorkerScript): boolean;
getTeamSizeNetscriptFn(type: string, name: string, workerScript: WorkerScript): number;
setTeamSizeNetscriptFn(type: string, name: string, size: number, workerScript: WorkerScript): number;
joinBladeburnerFactionNetscriptFn(workerScript: WorkerScript): boolean;

@ -133,8 +133,37 @@ export class Skill {
}
}
calculateCost(currentLevel: number): number {
return Math.floor((this.baseCost + currentLevel * this.costInc) * BitNodeMultipliers.BladeburnerSkillCost);
calculateCost(currentLevel: number, count = 1): number {
//Recursive mode does not handle invalid inputs properly, but it should never
//be possible for it to run with them. For the sake of not crashing the game,
const recursiveMode = (currentLevel: number, count: number): number => {
if (count <= 1) {
return Math.floor((this.baseCost + currentLevel * this.costInc) * BitNodeMultipliers.BladeburnerSkillCost);
} else {
const thisUpgrade = Math.floor(
(this.baseCost + currentLevel * this.costInc) * BitNodeMultipliers.BladeburnerSkillCost,
);
return this.calculateCost(currentLevel + 1, count - 1) + thisUpgrade;
}
};
//Count must be a positive integer.
if (count < 0 || count % 1 != 0) {
throw new Error(`${count} is an invalid number of upgrades`);
}
//Use recursive mode if count is small
if (count <= 100) {
return recursiveMode(currentLevel, count);
}
//Use optimized mode if count is large
else {
//unFloored is roughly equivalent to
//(this.baseCost + currentLevel * this.costInc) * BitNodeMultipliers.BladeburnerSkillCost
//being repeated for increasing currentLevel
const preMult = (count * (2 * this.baseCost + this.costInc * (2 * currentLevel + count + 1))) / 2;
const unFloored = preMult * BitNodeMultipliers.BladeburnerSkillCost - count / 2;
return Math.floor(unFloored);
}
}
getMultiplier(name: string): number {

@ -74,7 +74,7 @@ export function GeneralActionElem(props: IProps): React.ReactElement {
<CopyableText value={props.action.name} />
<StartButton
bladeburner={props.bladeburner}
type={ActionTypes[props.action.name ]}
type={ActionTypes[props.action.name]}
name={props.action.name}
rerender={rerender}
/>

@ -22,7 +22,7 @@ export function Augmentations(props: IProps): React.ReactElement {
const [augmentation, setAugmentation] = useState("Augmented Targeting I");
function setAugmentationDropdown(event: SelectChangeEvent<string>): void {
setAugmentation(event.target.value );
setAugmentation(event.target.value);
}
function queueAug(): void {
props.player.queueAugmentation(augmentation);

@ -15,7 +15,7 @@ import { CodingContractTypes } from "../../CodingContracts";
export function CodingContracts(): React.ReactElement {
const [codingcontract, setCodingcontract] = useState("Find Largest Prime Factor");
function setCodingcontractDropdown(event: SelectChangeEvent<string>): void {
setCodingcontract(event.target.value );
setCodingcontract(event.target.value);
}
function specificContract(): void {

@ -18,7 +18,7 @@ const bigNumber = 1e12;
export function Companies(): React.ReactElement {
const [company, setCompany] = useState(FactionNames.ECorp as string);
function setCompanyDropdown(event: SelectChangeEvent<string>): void {
setCompany(event.target.value );
setCompany(event.target.value);
}
function resetCompanyRep(): void {
AllCompanies[company].playerReputation = 0;

@ -29,7 +29,7 @@ export function Factions(props: IProps): React.ReactElement {
const [faction, setFaction] = useState(FactionNames.Illuminati as string);
function setFactionDropdown(event: SelectChangeEvent<string>): void {
setFaction(event.target.value );
setFaction(event.target.value);
}
function receiveInvite(): void {

@ -19,7 +19,7 @@ interface IProps {
export function Programs(props: IProps): React.ReactElement {
const [program, setProgram] = useState("NUKE.exe");
function setProgramDropdown(event: SelectChangeEvent<string>): void {
setProgram(event.target.value );
setProgram(event.target.value);
}
function addProgram(): void {
if (!props.player.hasProgram(program)) {

@ -15,7 +15,7 @@ import MenuItem from "@mui/material/MenuItem";
export function Servers(): React.ReactElement {
const [server, setServer] = useState("home");
function setServerDropdown(event: SelectChangeEvent<string>): void {
setServer(event.target.value );
setServer(event.target.value);
}
function rootServer(): void {
const s = GetServer(server);

@ -8,8 +8,8 @@ export function Unclickable(): React.ReactElement {
function unclickable(event: React.MouseEvent<HTMLDivElement>): void {
if (!event.target || !(event.target instanceof Element)) return;
const display = getComputedStyle(event.target ).display;
const visibility = getComputedStyle(event.target ).visibility;
const display = getComputedStyle(event.target).display;
const visibility = getComputedStyle(event.target).visibility;
if (display === "none" && visibility === "hidden" && event.isTrusted) player.giveExploit(Exploit.Unclickable);
}

@ -281,26 +281,28 @@ export function NetscriptBladeburner(player: IPlayer, workerScript: WorkerScript
},
getSkillUpgradeCost:
(ctx: NetscriptContext) =>
(_skillName: unknown): number => {
(_skillName: unknown, _count: unknown = 1): number => {
const skillName = ctx.helper.string("skillName", _skillName);
const count = ctx.helper.number("count", _count);
checkBladeburnerAccess(ctx);
const bladeburner = player.bladeburner;
if (bladeburner === null) throw new Error("Should not be called without Bladeburner");
try {
return bladeburner.getSkillUpgradeCostNetscriptFn(skillName, workerScript);
return bladeburner.getSkillUpgradeCostNetscriptFn(skillName, count, workerScript);
} catch (e: unknown) {
throw ctx.makeRuntimeErrorMsg(String(e));
}
},
upgradeSkill:
(ctx: NetscriptContext) =>
(_skillName: unknown): boolean => {
(_skillName: unknown, _count: unknown = 1): boolean => {
const skillName = ctx.helper.string("skillName", _skillName);
const count = ctx.helper.number("count", _count);
checkBladeburnerAccess(ctx);
const bladeburner = player.bladeburner;
if (bladeburner === null) throw new Error("Should not be called without Bladeburner");
try {
return bladeburner.upgradeSkillNetscriptFn(skillName, workerScript);
return bladeburner.upgradeSkillNetscriptFn(skillName, count, workerScript);
} catch (e: unknown) {
throw ctx.makeRuntimeErrorMsg(String(e));
}

@ -42,7 +42,7 @@ export function NetscriptInfiltration(player: IPlayer): InternalAPI<IInfiltratio
};
return {
getPossibleLocations: () => (): string[] => {
return getLocationsWithInfiltrations.map((l) => l + "");
return getLocationsWithInfiltrations.map((l) => l.name);
},
getInfiltration:
(ctx: NetscriptContext) =>

@ -3065,28 +3065,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.

@ -84,7 +84,7 @@ export function mv(
script.filename = destPath;
} else if (srcFile instanceof TextFile) {
const textFile = srcFile ;
const textFile = srcFile;
if (!dest.endsWith(".txt")) {
terminal.error(`Source and destination files must have the same type`);
return;

@ -56,11 +56,12 @@ const lineClass = (classes: Record<string, string>, s: string): string => {
};
interface IProps {
text: string;
text: unknown;
color: "primary" | "error" | "success" | "info" | "warn";
}
export const ANSIITypography = React.memo((props: IProps): React.ReactElement => {
const text = String(props.text);
const classes = useStyles();
const parts = [];
@ -70,7 +71,7 @@ export const ANSIITypography = React.memo((props: IProps): React.ReactElement =>
index: 0,
groups: { code: null },
};
const matches = [INITIAL, ...props.text.matchAll(ANSI_ESCAPE), null];
const matches = [INITIAL, ...text.matchAll(ANSI_ESCAPE), null];
if (matches.length > 2) {
matches.slice(0, -1).forEach((m, i) => {
const n = matches[i + 1];
@ -78,8 +79,8 @@ export const ANSIITypography = React.memo((props: IProps): React.ReactElement =>
return;
}
const startIndex = m.index + m[0].length;
const stopIndex = n ? n.index : props.text.length;
const partText = props.text.slice(startIndex, stopIndex);
const stopIndex = n ? n.index : text.length;
const partText = text.slice(startIndex, stopIndex);
if (startIndex !== stopIndex) {
// Don't generate "empty" spans
parts.push({ code: m.groups.code, text: partText });
@ -88,7 +89,7 @@ export const ANSIITypography = React.memo((props: IProps): React.ReactElement =>
}
if (parts.length === 0) {
// For example, if the string was empty or there were no escape sequence matches
parts.push({ code: null, text: props.text });
parts.push({ code: null, text: text });
}
return (
<Typography classes={{ root: lineClass(classes, props.color) }} paragraph={false}>

@ -326,7 +326,6 @@ function LogWindow(props: IProps): React.ReactElement {
(line: string, i: number): JSX.Element => (
<React.Fragment key={i}>
<ANSIITypography text={line} color={lineColor(line)} />
<br />
</React.Fragment>
),
)}