work on making sure all the functions are accounted for

This commit is contained in:
Olivier Gagnon 2021-11-03 18:16:10 -04:00
parent 2578ea51c3
commit c5fb5155f3
124 changed files with 2775 additions and 2204 deletions

401
dist/bitburner.d.ts vendored

File diff suppressed because it is too large Load Diff

BIN
electron/icon.icns Normal file

Binary file not shown.

BIN
electron/icon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

@ -5,7 +5,7 @@ function createWindow() {
const win = new BrowserWindow({
show: false,
webPreferences: {
devTools: true,
// devTools: true,
},
});
@ -13,7 +13,7 @@ function createWindow() {
win.maximize();
win.loadFile("index.html");
win.show();
win.webContents.openDevTools();
// win.webContents.openDevTools();
globalShortcut.register("f5", function () {
win.loadFile("index.html");
});

@ -3,5 +3,22 @@
"version": "1.0.0",
"description": "A cyberpunk-themed programming incremental game",
"main": "main.js",
"author": "Daniel Xie"
"author": "Daniel Xie & Olivier Gagnon",
"mac": {
"icon": "./public/icons/mac/icon.icns",
"category": "public.app-category.games"
},
"win": {
"icon": "./public/icons/png/256x256.png"
},
"files": [
"./build/**/*",
"./dist/**/*",
"./node_modules/**/*",
"./public/**/*",
"*.js"
],
"directories": {
"buildResources": "public"
}
}

File diff suppressed because it is too large Load Diff

@ -9,7 +9,7 @@ Data representing the internal values of an Augmentation.
<b>Signature:</b>
```typescript
interface AugmentationStats
export interface AugmentationStats
```
## Properties

@ -9,7 +9,7 @@ Return value of [getSleevePurchasableAugs](./bitburner.sleeve.getsleevepurchasab
<b>Signature:</b>
```typescript
interface AugmentPair
export interface AugmentPair
```
## Properties

@ -9,7 +9,7 @@ Options to affect the behavior of [hack](./bitburner.ns.hack.md)<!-- -->, [grow]
<b>Signature:</b>
```typescript
interface BasicHGWOptions
export interface BasicHGWOptions
```
## Properties

@ -9,7 +9,7 @@ All multipliers affecting the difficulty of the current challenge.
<b>Signature:</b>
```typescript
interface BitNodeMultipliers
export interface BitNodeMultipliers
```
## Properties

@ -9,7 +9,7 @@ Bladeburner current action.
<b>Signature:</b>
```typescript
interface BladeburnerCurAction
export interface BladeburnerCurAction
```
## Properties

@ -8,7 +8,7 @@
<b>Signature:</b>
```typescript
interface CharacterInfo
export interface CharacterInfo
```
## Properties

@ -8,7 +8,7 @@
<b>Signature:</b>
```typescript
interface CharacterMult
export interface CharacterMult
```
## Properties

@ -9,7 +9,7 @@ Options to affect the behavior of [CodingContract](./bitburner.codingcontract.md
<b>Signature:</b>
```typescript
interface CodingAttemptOptions
export interface CodingAttemptOptions
```
## Properties

@ -9,7 +9,7 @@ Coding Contact API
<b>Signature:</b>
```typescript
interface CodingContract
export interface CodingContract
```
## Methods

@ -9,7 +9,7 @@ Data representing the internal values of a crime.
<b>Signature:</b>
```typescript
interface CrimeStats
export interface CrimeStats
```
## Properties

@ -9,7 +9,7 @@ Object representing data representing a gang member equipment.
<b>Signature:</b>
```typescript
interface EquipmentStats
export interface EquipmentStats
```
## Properties

@ -0,0 +1,32 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [Gang](./bitburner.gang.md) &gt; [createGang](./bitburner.gang.creategang.md)
## Gang.createGang() method
Create a gang.
<b>Signature:</b>
```typescript
createGang(faction: string): boolean;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| faction | string | |
<b>Returns:</b>
boolean
True if the gang was created, false otherwise.
## Remarks
RAM cost: 1GB
Create a gang with the specified faction.

@ -0,0 +1,23 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [Gang](./bitburner.gang.md) &gt; [inGang](./bitburner.gang.ingang.md)
## Gang.inGang() method
Check if you're in a gang.
<b>Signature:</b>
```typescript
inGang(): boolean;
```
<b>Returns:</b>
boolean
True if you're in a gang, false otherwise.
## Remarks
RAM cost: 1GB

@ -9,7 +9,7 @@ Gang API
<b>Signature:</b>
```typescript
interface Gang
export interface Gang
```
## Remarks
@ -22,6 +22,7 @@ If you are not in BitNode-2, then you must have Source-File 2 in order to use th
| --- | --- |
| [ascendMember(memberName)](./bitburner.gang.ascendmember.md) | Ascend a gang member. |
| [canRecruitMember()](./bitburner.gang.canrecruitmember.md) | Check if you can recruit a new gang member. |
| [createGang(faction)](./bitburner.gang.creategang.md) | Create a gang. |
| [getBonusTime()](./bitburner.gang.getbonustime.md) | Get bonus time. |
| [getChanceToWinClash(gangName)](./bitburner.gang.getchancetowinclash.md) | Get chance to win clash with other gang. |
| [getEquipmentCost(equipName)](./bitburner.gang.getequipmentcost.md) | Get cost of equipment. |
@ -34,6 +35,7 @@ If you are not in BitNode-2, then you must have Source-File 2 in order to use th
| [getOtherGangInformation()](./bitburner.gang.getotherganginformation.md) | Get information about the other gangs. |
| [getTaskNames()](./bitburner.gang.gettasknames.md) | List member task names. |
| [getTaskStats(name)](./bitburner.gang.gettaskstats.md) | Get stats of a task. |
| [inGang()](./bitburner.gang.ingang.md) | Check if you're in a gang. |
| [purchaseEquipment(memberName, equipName)](./bitburner.gang.purchaseequipment.md) | Purchase an equipment for a gang member. |
| [recruitMember(name)](./bitburner.gang.recruitmember.md) | Recruit a new gang member. |
| [setMemberTask(memberName, taskName)](./bitburner.gang.setmembertask.md) | Set gang member to task. |

@ -9,7 +9,7 @@ Gang general info.
<b>Signature:</b>
```typescript
interface GangGenInfo
export interface GangGenInfo
```
## Properties

@ -8,7 +8,7 @@
<b>Signature:</b>
```typescript
interface GangMemberAscension
export interface GangMemberAscension
```
## Properties

@ -8,7 +8,7 @@
<b>Signature:</b>
```typescript
interface GangMemberInfo
export interface GangMemberInfo
```
## Properties

@ -8,5 +8,5 @@
<b>Signature:</b>
```typescript
interface GangOtherInfo
export interface GangOtherInfo
```

@ -8,7 +8,7 @@
<b>Signature:</b>
```typescript
interface GangOtherInfoObject
export interface GangOtherInfoObject
```
## Properties

@ -9,7 +9,7 @@ Object representing data representing a gang member task.
<b>Signature:</b>
```typescript
interface GangTaskStats
export interface GangTaskStats
```
## Properties

@ -8,7 +8,7 @@
<b>Signature:</b>
```typescript
interface GangTerritory
export interface GangTerritory
```
## Properties

@ -9,7 +9,7 @@ Hack related multipliers.
<b>Signature:</b>
```typescript
interface HackingMultipliers
export interface HackingMultipliers
```
## Properties

@ -9,7 +9,7 @@ Hacknet API
<b>Signature:</b>
```typescript
interface Hacknet
export interface Hacknet
```
## Remarks

@ -9,7 +9,7 @@ Hacknet related multipliers.
<b>Signature:</b>
```typescript
interface HacknetMultipliers
export interface HacknetMultipliers
```
## Properties

@ -9,7 +9,7 @@ Object representing all the values related to a hacknet node.
<b>Signature:</b>
```typescript
interface NodeStats
export interface NodeStats
```
## Properties

@ -14,7 +14,9 @@ readonly args: (string | number)[];
## Remarks
RAM cost: 0 GB Arguments passed into a script can be accessed using a normal array using the \[\] operator (args\[0\], args\[1\], etc…).
RAM cost: 0 GB
Arguments passed into a script can be accessed using a normal array using the \[\] operator (args\[0\], args\[1\], etc…).
It is also possible to get the number of arguments that was passed into a script using: 'args.length' WARNING: Do not try to modify the args array. This will break the game.

@ -4,7 +4,7 @@
## NS.brutessh() method
Runs the BruteSSH.exe program on the target server. BruteSSH.exe must exist on your home computer.
Runs BruteSSH.exe on a server.
<b>Signature:</b>
@ -26,6 +26,8 @@ void
RAM cost: 0.05 GB
Runs the BruteSSH.exe program on the target server. BruteSSH.exe must exist on your home computer.
## Example

@ -4,11 +4,7 @@
## NS.clear() method
This function is used to clear data in a Netscript Ports or a text file.
If the port/fn argument is a number between 1 and 20, then it specifies a port and will clear it (deleting all data from the underlying queue).
If the port/fn argument is a string, then it specifies the name of a text file (.txt) and will delete all data from that text file.
Clear data from a port.
<b>Signature:</b>
@ -28,5 +24,11 @@ void
## Remarks
RAM cost: 1 GB
RAM cost: 0 GB
This function is used to clear data in a Netscript Ports or a text file.
If the port/fn argument is a number between 1 and 20, then it specifies a port and will clear it (deleting all data from the underlying queue).
If the port/fn argument is a string, then it specifies the name of a text file (.txt) and will delete all data from that text file.

@ -4,9 +4,7 @@
## NS.deleteServer() method
Deletes one of your purchased servers, which is specified by its hostname.
The hostname argument can be any data type, but it will be converted to a string. Whitespace is automatically removed from the string. This function will not delete a server that still has scripts running on it.
Delete a purchased server.
<b>Signature:</b>
@ -30,3 +28,7 @@ True if successful, and false otherwise.
2.25 GB
Deletes one of your purchased servers, which is specified by its hostname.
The hostname argument can be any data type, but it will be converted to a string. Whitespace is automatically removed from the string. This function will not delete a server that still has scripts running on it.

@ -24,7 +24,9 @@ void
## Remarks
RAM cost: 0 GB Logging can be disabled for all functions by passing `ALL` as the argument.
RAM cost: 0 GB
Logging can be disabled for all functions by passing `ALL` as the argument.
Note that this does not completely remove all logging functionality. This only stops a function from logging when the function is successful. If the function fails, it will still log the reason for failure.

@ -4,7 +4,7 @@
## NS.enableLog() method
Re-enables logging for the given function. If `ALL` is passed into this function as an argument, then it will revert the effects of disableLog(`ALL`<!-- -->).
Enable logging for a certain function.
<b>Signature:</b>
@ -26,3 +26,5 @@ void
RAM cost: 0 GB
Re-enables logging for the given function. If `ALL` is passed into this function as an argument, then it will revert the effects of disableLog(`ALL`<!-- -->).

@ -4,13 +4,7 @@
## NS.exec() method
Run a script as a separate process on a specified server. This is similar to the run function except that it can be used to run a script on any server, instead of just the current server.
If the script was successfully started, then this functions returns the PID of that script. Otherwise, it returns 0.
PID stands for Process ID. The PID is a unique identifier for each script. The PID will always be a positive integer.
Running this function with a numThreads argument of 0 will return 0 without running the script. However, running this function with a negative numThreads argument will cause a runtime error.
Start another script on any server.
<b>Signature:</b>
@ -37,6 +31,14 @@ Returns the PID of a successfully started script, and 0 otherwise.
RAM cost: 1.3 GB
Run a script as a separate process on a specified server. This is similar to the run function except that it can be used to run a script on any server, instead of just the current server.
If the script was successfully started, then this functions returns the PID of that script. Otherwise, it returns 0.
PID stands for Process ID. The PID is a unique identifier for each script. The PID will always be a positive integer.
Running this function with a numThreads argument of 0 will return 0 without running the script. However, running this function with a negative numThreads argument will cause a runtime error.
## Example 1

@ -4,9 +4,7 @@
## NS.fileExists() method
Returns a boolean indicating whether the specified file exists on the target server. The filename for scripts is case-sensitive, but for other types of files it is not. For example, fileExists(“brutessh.exe”) will work fine, even though the actual program is named 'BruteSSH.exe'.
If the hostname/ip argument is omitted, then the function will search through the current server (the server running the script that calls this function) for the file.
Check if a file exists.
<b>Signature:</b>
@ -31,6 +29,10 @@ True if specified file exists, and false otherwise.
RAM cost: 0.1 GB
Returns a boolean indicating whether the specified file exists on the target server. The filename for scripts is case-sensitive, but for other types of files it is not. For example, fileExists(“brutessh.exe”) will work fine, even though the actual program is named 'BruteSSH.exe'.
If the hostname/ip argument is omitted, then the function will search through the current server (the server running the script that calls this function) for the file.
## Example 1

@ -4,7 +4,7 @@
## NS.ftpcrack() method
Runs the FTPCrack.exe program on the target server. FTPCrack.exe must exist on your home computer.
Runs FTPCrack.exe on a server.
<b>Signature:</b>
@ -26,6 +26,8 @@ void
RAM cost: 0.05 GB
Runs the FTPCrack.exe program on the target server. FTPCrack.exe must exist on your home computer.
## Example

@ -4,9 +4,7 @@
## NS.getBitNodeMultipliers() method
Returns an object containing the current BitNode multipliers. This function requires Source-File 5 in order to run. The multipliers are returned in decimal forms (e.g. 1.5 instead of 150%). The multipliers represent the difference between the current BitNode and the original BitNode (BitNode-1).
For example, if the CrimeMoney multiplier has a value of 0.1, then that means that committing crimes in the current BitNode will only give 10% of the money you would have received in BitNode-1.
Get the current Bitnode multipliers.
<b>Signature:</b>
@ -23,6 +21,10 @@ Object containing the current BitNode multipliers.
RAM cost: 4 GB
Returns an object containing the current BitNode multipliers. This function requires Source-File 5 in order to run. The multipliers are returned in decimal forms (e.g. 1.5 instead of 150%). The multipliers represent the difference between the current BitNode and the original BitNode (BitNode-1).
For example, if the CrimeMoney multiplier has a value of 0.1, then that means that committing crimes in the current BitNode will only give 10% of the money you would have received in BitNode-1.
## Example

@ -4,12 +4,12 @@
## NS.getGrowTime() method
Returns the amount of time in seconds 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.
Get the execution time of a grow() call.
<b>Signature:</b>
```typescript
getGrowTime(host: string, hackLvl?: number, intLvl?: number): number;
getGrowTime(host: string): number;
```
## Parameters
@ -17,8 +17,6 @@ getGrowTime(host: string, hackLvl?: number, intLvl?: number): number;
| Parameter | Type | Description |
| --- | --- | --- |
| host | string | Host of target server. |
| hackLvl | number | Optional hacking level for the calculation. Defaults to players current hacking level. |
| intLvl | number | Optional intelligence level for the calculation. Defaults to players current intelligence level. (Intelligence is unlocked after obtaining Source-File 5). |
<b>Returns:</b>
@ -30,3 +28,5 @@ Returns the amount of time in seconds it takes to execute the grow Netscript fun
RAM cost: 0.05 GB
Returns the amount of time in seconds 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.

@ -4,7 +4,7 @@
## NS.getHackingMultipliers() method
Returns an object containing the Players hacking related multipliers. These multipliers are returned in fractional forms, not percentages (e.g. 1.5 instead of 150%).
Get hacking related multipliers.
<b>Signature:</b>
@ -21,6 +21,8 @@ Object containing the Players hacking related multipliers.
RAM cost: 4 GB
Returns an object containing the Players hacking related multipliers. These multipliers are returned in fractional forms, not percentages (e.g. 1.5 instead of 150%).
## Example

@ -4,7 +4,7 @@
## NS.getHacknetMultipliers() method
Returns an object containing the Players hacknet related multipliers. These multipliers are returned in fractional forms, not percentages (e.g. 1.5 instead of 150%).
Get hacknet related multipliers.
<b>Signature:</b>
@ -21,6 +21,8 @@ Object containing the Players hacknet related multipliers.
RAM cost: 4 GB
Returns an object containing the Players hacknet related multipliers. These multipliers are returned in fractional forms, not percentages (e.g. 1.5 instead of 150%).
## Example

@ -4,12 +4,12 @@
## NS.getHackTime() method
Returns the amount of time in seconds 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.
Get the execution time of a hack() call.
<b>Signature:</b>
```typescript
getHackTime(host: string, hackLvl?: number, intLvl?: number): number;
getHackTime(host: string): number;
```
## Parameters
@ -17,16 +17,16 @@ getHackTime(host: string, hackLvl?: number, intLvl?: number): number;
| Parameter | Type | Description |
| --- | --- | --- |
| host | string | Host of target server. |
| hackLvl | number | Optional hacking level for the calculation. Defaults to players current hacking level. |
| intLvl | number | Optional intelligence level for the calculation. Defaults to players current intelligence level. (Intelligence is unlocked after obtaining Source-File 5). |
<b>Returns:</b>
number
Returns the amount of time in seconds 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. Returns Infinity if called on a Hacknet Server.
## Remarks
RAM cost: 0.05 GB
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.

@ -4,9 +4,7 @@
## NS.getPortHandle() method
Get a handle to a Netscript Port.
WARNING: Port Handles only work in NetscriptJS (Netscript 2.0). They will not work in Netscript 1.0.
Get all data on a port.
<b>Signature:</b>
@ -28,5 +26,9 @@ Data in the specified port.
## Remarks
RAM cost: 10 GB
RAM cost: 0 GB
Get a handle to a Netscript Port.
WARNING: Port Handles only work in NetscriptJS (Netscript 2.0). They will not work in Netscript 1.0.

@ -4,7 +4,7 @@
## NS.getPurchasedServerCost() method
Returns the cost to purchase a server with the specified amount of ram.
Get cost of purchasing a server.
<b>Signature:</b>
@ -28,6 +28,8 @@ The cost to purchase a server with the specified amount of ram.
RAM cost: 0.25 GB
Returns the cost to purchase a server with the specified amount of ram.
## Example

@ -16,7 +16,7 @@ getPurchasedServers(hostnameMode?: boolean): string[];
| Parameter | Type | Description |
| --- | --- | --- |
| hostnameMode | boolean | \] Optional. Defaults to true. Returns hostnames if true, and IPs if false. |
| hostnameMode | boolean | Optional. Defaults to true. Returns hostnames if true, and IPs if false. |
<b>Returns:</b>

@ -4,9 +4,7 @@
## NS.getScriptExpGain() method
Returns the amount of hacking experience the specified script generates while online (when the game is open, does not apply for offline experience gains). Remember that a script is uniquely identified by both its name and its arguments.
This function can also return the total experience gain rate of all of your active scripts by running the function with no arguments.
Get the exp gain of a script.
<b>Signature:</b>
@ -32,3 +30,7 @@ Amount of hacking experience the specified script generates while online.
RAM cost: 0.1 GB
Returns the amount of hacking experience the specified script generates while online (when the game is open, does not apply for offline experience gains). Remember that a script is uniquely identified by both its name and its arguments.
This function can also return the total experience gain rate of all of your active scripts by running the function with no arguments.

@ -4,9 +4,7 @@
## NS.getScriptIncome() method
Returns the amount of income the specified script generates while online (when the game is open, does not apply for offline income). Remember that a script is uniquely identified by both its name and its arguments. So for example if you ran a script with the arguments “foodnstuff” and “5” then in order to use this function to get that scripts income you must specify those same arguments in the same order in this function call.
This function can also be called with no arguments. If called with no arguments, then this function will return an array of two values. The first value is the total income (dollar / second) of all of your active scripts (scripts that are currently running on any server). The second value is the total income (dollar / second) that youve earned from scripts since you last installed Augmentations.
Get the income of a script.
<b>Signature:</b>
@ -32,3 +30,7 @@ Amount of income the specified script generates while online.
RAM cost: 0.1 GB
Returns the amount of income the specified script generates while online (when the game is open, does not apply for offline income). Remember that a script is uniquely identified by both its name and its arguments. So for example if you ran a script with the arguments “foodnstuff” and “5” then in order to use this function to get that scripts income you must specify those same arguments in the same order in this function call.
This function can also be called with no arguments. If called with no arguments, then this function will return an array of two values. The first value is the total income (dollar / second) of all of your active scripts (scripts that are currently running on any server). The second value is the total income (dollar / second) that youve earned from scripts since you last installed Augmentations.

@ -4,9 +4,7 @@
## NS.getScriptLogs() method
Returns a scripts logs. The logs are returned as an array, where each line is an element in the array. The most recently logged line is at the end of the array. Note that there is a maximum number of lines that a script stores in its logs. This is configurable in the games options. If the function is called with no arguments, it will return the current scripts logs.
Otherwise, the fn, hostname/ip, and args… arguments can be used to get the logs from another script. Remember that scripts are uniquely identified by both their names and arguments.
Get all the logs of a script.
<b>Signature:</b>
@ -32,6 +30,10 @@ Returns an string array, where each line is an element in the array. The most re
RAM cost: 0 GB
Returns a scripts logs. The logs are returned as an array, where each line is an element in the array. The most recently logged line is at the end of the array. Note that there is a maximum number of lines that a script stores in its logs. This is configurable in the games options. If the function is called with no arguments, it will return the current scripts logs.
Otherwise, the fn, hostname/ip, and args… arguments can be used to get the logs from another script. Remember that scripts are uniquely identified by both their names and arguments.
## Example 1

@ -4,7 +4,7 @@
## NS.getScriptRam() method
Returns the amount of RAM required to run the specified script on the target server. Returns 0 if the script does not exist.
Get the ram cost of a script.
<b>Signature:</b>
@ -29,3 +29,5 @@ Amount of RAM required to run the specified script on the target server, and 0 i
RAM cost: 0.1 GB
Returns the amount of RAM required to run the specified script on the target server. Returns 0 if the script does not exist.

@ -1,30 +0,0 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [NS](./bitburner.ns.md) &gt; [getServerBaseSecurityLevel](./bitburner.ns.getserverbasesecuritylevel.md)
## NS.getServerBaseSecurityLevel() method
Returns the base security level of the target server. This is the security level that the server starts out with. This is different than getServerSecurityLevel because getServerSecurityLevel returns the current security level of a server, which can constantly change due to hack, grow, and weaken, calls on that server. The base security level will stay the same until you reset by installing an Augmentation(s).
<b>Signature:</b>
```typescript
getServerBaseSecurityLevel(host: string): number;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| host | string | Host of target server. |
<b>Returns:</b>
number
Base security level of the target server.
## Remarks
RAM cost: 0.1 GB

@ -4,7 +4,7 @@
## NS.getServerGrowth() method
Returns the servers instrinsic “growth parameter”. This growth parameter is a number between 1 and 100 that represents how quickly the servers money grows. This parameter affects the percentage by which the servers money is increased when using the grow function. A higher growth parameter will result in a higher percentage increase from grow.
Get a server growth parameter.
<b>Signature:</b>
@ -28,3 +28,5 @@ Parameter that affects the percentage by which the servers money is increased
RAM cost: 0.1 GB
Returns the servers instrinsic “growth parameter”. This growth parameter is a number between 1 and 100 that represents how quickly the servers money grows. This parameter affects the percentage by which the servers money is increased when using the grow function. A higher growth parameter will result in a higher percentage increase from grow.

@ -4,7 +4,7 @@
## NS.getServerMaxMoney() method
Returns the maximum amount of money that can be available on a server.
Get maximum money available on a server.
<b>Signature:</b>
@ -28,3 +28,5 @@ Maximum amount of money available on the server.
RAM cost: 0.1 GB
Returns the maximum amount of money that can be available on a server.

@ -4,7 +4,7 @@
## NS.getServerMoneyAvailable() method
Returns the amount of money available on a server. Running this function on the home computer will return the players money.
Get money available on a server.
<b>Signature:</b>
@ -28,6 +28,8 @@ Amount of money available on the server.
RAM cost: 0.1 GB
Returns the amount of money available on a server. Running this function on the home computer will return the players money.
## Example

@ -1,39 +0,0 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [NS](./bitburner.ns.md) &gt; [getServerRam](./bitburner.ns.getserverram.md)
## NS.getServerRam() method
Returns an array with two elements that gives information about a servers memory (RAM). The first element in the array is the amount of RAM that the server has total (in GB). The second element in the array is the amount of RAM that is currently being used on the server (in GB).
<b>Signature:</b>
```typescript
getServerRam(host: string): [number, number];
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| host | string | Host of target server. |
<b>Returns:</b>
\[number, number\]
Array with total and used memory on the specified server.
## Remarks
RAM cost: 0.1 GB
## Example
```ts
res = getServerRam("helios");
totalRam = res[0];
ramUsed = res[1];
```

@ -4,7 +4,7 @@
## NS.getServerSecurityLevel() method
Returns the security level of the target server. A servers security level is denoted by a number, typically between 1 and 100 (but it can go above 100).
Get server security level.
<b>Signature:</b>
@ -28,3 +28,5 @@ Security level of the target server.
RAM cost: 0.1 GB
Returns the security level of the target server. A servers security level is denoted by a number, typically between 1 and 100 (but it can go above 100).

@ -4,12 +4,12 @@
## NS.getWeakenTime() method
Returns the amount of time in seconds 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.
Get the execution time of a weaken() call.
<b>Signature:</b>
```typescript
getWeakenTime(host: string, hackLvl?: number, intLvl?: number): number;
getWeakenTime(host: string): number;
```
## Parameters
@ -17,8 +17,6 @@ getWeakenTime(host: string, hackLvl?: number, intLvl?: number): number;
| Parameter | Type | Description |
| --- | --- | --- |
| host | string | Host of target server. |
| hackLvl | number | Optional hacking level for the calculation. Defaults to players current hacking level. |
| intLvl | number | Optional intelligence level for the calculation. Defaults to players current intelligence level. (Intelligence is unlocked after obtaining Source-File 5). |
<b>Returns:</b>
@ -30,3 +28,5 @@ Returns the amount of time in seconds it takes to execute the grow Netscript fun
RAM cost: 0.05 GB
Returns the amount of time in seconds 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.

@ -27,7 +27,9 @@ The number by which the money on the server was multiplied for the growth.
## Remarks
RAM cost: 0.15 GB Use your hacking skills to increase the amount of money available on a server. The runtime for this command depends on your hacking level and the target servers security level. When `grow` completes, the money available on a target server will be increased by a certain, fixed percentage. This percentage is determined by the target servers growth rate (which varies between servers) and security level. Generally, higher-level servers have higher growth rates. The getServerGrowth() function can be used to obtain a servers growth rate.
RAM cost: 0.15 GB
Use your hacking skills to increase the amount of money available on a server. The runtime for this command depends on your hacking level and the target servers security level. When `grow` completes, the money available on a target server will be increased by a certain, fixed percentage. This percentage is determined by the target servers growth rate (which varies between servers) and security level. Generally, higher-level servers have higher growth rates. The getServerGrowth() function can be used to obtain a servers growth rate.
Like hack, `grow` can be called on any server, regardless of where the script is running. The grow() command requires root access to the target server, but there is no required hacking level to run the command. It also raises the security level of the target server by 0.004.

@ -4,9 +4,7 @@
## NS.growthAnalyze() method
This function returns the number of “growths” needed in order to increase the amount of money available on the specified server by the specified amount. The specified amount is multiplicative and is in decimal form, not percentage.
Warning: The value returned by this function isnt necessarily a whole number.
Calculate the number of grow thread needed to grow a server by a certain multiplier.
<b>Signature:</b>
@ -31,6 +29,10 @@ The amount of grow calls needed to grow the specified server by the specified am
RAM cost: 1 GB
This function returns the number of “growths” needed in order to increase the amount of money available on the specified server by the specified amount. The specified amount is multiplicative and is in decimal form, not percentage.
Warning: The value returned by this function isnt necessarily a whole number.
## Example

@ -4,7 +4,7 @@
## NS.growthAnalyzeSecurity() method
Returns the security increase that would occur if a grow with this many threads happened.
Calculate the security increase for a number of thread.
<b>Signature:</b>
@ -28,3 +28,5 @@ The security increase.
RAM cost: 1 GB
Returns the security increase that would occur if a grow with this many threads happened.

@ -27,7 +27,9 @@ The amount of money stolen if the hack is successful, and zero otherwise.
## Remarks
RAM cost: 0.1 GB Function that is used to try and hack servers to steal money and gain hacking experience. The runtime for this command depends on your hacking level and the target servers security level. In order to hack a server you must first gain root access to that server and also have the required hacking level.
RAM cost: 0.1 GB
Function that is used to try and hack servers to steal money and gain hacking experience. The runtime for this command depends on your hacking level and the target servers security level. In order to hack a server you must first gain root access to that server and also have the required hacking level.
A script can hack a server from anywhere. It does not need to be running on the same server to hack that server. For example, you can create a script that hacks the `foodnstuff` server and run that script on any server in the game.

@ -4,7 +4,7 @@
## NS.hackAnalyzePercent() method
Returns the percentage of the specified servers money you will steal with a single hack. This value is returned in percentage form, not decimal (Netscript functions typically return in decimal form, but not this one).
Get the percent of money stolen with a single thread.
<b>Signature:</b>
@ -28,6 +28,8 @@ The percentage of money you will steal from the target server with a single hack
RAM cost: 1 GB
Returns the percentage of the specified servers money you will steal with a single hack. This value is returned in percentage form, not decimal (Netscript functions typically return in decimal form, but not this one).
## Example

@ -4,7 +4,7 @@
## NS.hackAnalyzeSecurity() method
Returns the security increase that would occur if a hack with this many threads happened.
Get the security increase for a number of thread.
<b>Signature:</b>
@ -28,3 +28,5 @@ The security increase.
RAM cost: 1 GB
Returns the security increase that would occur if a hack with this many threads happened.

@ -27,7 +27,9 @@ The number of threads needed to hack the server for hackAmount money.
## Remarks
RAM cost: 1 GB This function returns the number of script threads you need when running the hack command to steal the specified amount of money from the target server. If hackAmount is less than zero or greater than the amount of money available on the server, then this function returns -1.
RAM cost: 1 GB
This function returns the number of script threads you need when running the hack command to steal the specified amount of money from the target server. If hackAmount is less than zero or greater than the amount of money available on the server, then this function returns -1.
Warning: The value returned by this function isnt necessarily a whole number.

@ -4,9 +4,7 @@
## NS.hackChance() method
Returns the chance you have of successfully hacking the specified server.
This returned value is in decimal form, not percentage.
Get the chance of successfully hacking a server.
<b>Signature:</b>
@ -30,3 +28,7 @@ The chance you have of successfully hacking the target server.
RAM cost: 1 GB
Returns the chance you have of successfully hacking the specified server.
This returned value is in decimal form, not percentage.

@ -4,7 +4,7 @@
## NS.hasRootAccess() method
Returns a boolean indicating whether or not the player has root access to the specified target server.
Check if your have root access on a server.
<b>Signature:</b>
@ -28,6 +28,8 @@ True if player has root access to the specified target server, and false otherwi
RAM cost: 0.05 GB
Returns a boolean indicating whether or not the player has root access to the specified target server.
## Example

@ -4,7 +4,7 @@
## NS.httpworm() method
Runs the HTTPWorm.exe program on the target server. HTTPWorm.exe must exist on your home computer.
Runs HTTPWorm.exe on a server.
<b>Signature:</b>
@ -26,6 +26,8 @@ void
RAM cost: 0.05 GB
Runs the HTTPWorm.exe program on the target server. HTTPWorm.exe must exist on your home computer.
## Example

@ -4,7 +4,7 @@
## NS.isRunning() method
Returns a boolean indicating whether the specified script is running on the target server. Remember that a script is uniquely identified by both its name and its arguments.
Check if a script is running.
<b>Signature:</b>
@ -30,6 +30,8 @@ True if specified script is running on the target server, and false otherwise.
RAM cost: 0.1 GB
Returns a boolean indicating whether the specified script is running on the target server. Remember that a script is uniquely identified by both its name and its arguments.
## Example 1

@ -4,7 +4,7 @@
## NS.kill() method
Kills the script on the target server specified by the scripts name and arguments. Remember that scripts are uniquely identified by both their name and arguments. For example, if `foo.script` is run with the argument 1, then this is not the same as `foo.script` run with the argument 2, even though they have the same code.
Terminate another script.
<b>Signature:</b>
@ -30,6 +30,8 @@ True if the script is successfully killed, and false otherwise.
RAM cost: 0.5 GB
Kills the script on the target server specified by the scripts name and arguments. Remember that scripts are uniquely identified by both their name and arguments. For example, if `foo.script` is run with the argument 1, then this is not the same as `foo.script` run with the argument 2, even though they have the same code.
## Example 1

@ -4,7 +4,7 @@
## NS.kill() method
Kills the script with the specified PID. Killing a script by its PID will typically have better performance, especially if you have many scripts running. If this function successfully kills the specified script, then it will return true. Otherwise, it will return false.
Terminate another script.
<b>Signature:</b>
@ -28,6 +28,8 @@ True if the script is successfully killed, and false otherwise.
RAM cost: 0.5 GB
Kills the script with the specified PID. Killing a script by its PID will typically have better performance, especially if you have many scripts running. If this function successfully kills the specified script, then it will return true. Otherwise, it will return false.
## Example

@ -4,7 +4,7 @@
## NS.killall() method
Kills all running scripts on the specified server. This function returns true if any scripts were killed, and false otherwise. In other words, it will return true if there are any scripts running on the target server.
Terminate all scripts on a server.
<b>Signature:</b>
@ -28,3 +28,5 @@ True if any scripts were killed, and false otherwise.
RAM cost: 0.5 GB
Kills all running scripts on the specified server. This function returns true if any scripts were killed, and false otherwise. In other words, it will return true if there are any scripts running on the target server.

@ -4,7 +4,7 @@
## NS.ls() method
Returns an array with the filenames of all files on the specified server (as strings). The returned array is sorted in alphabetic order.
List files on a server.
<b>Signature:</b>
@ -29,3 +29,5 @@ Array with the filenames of all files on the specified server.
RAM cost: 0.2 GB
Returns an array with the filenames of all files on the specified server (as strings). The returned array is sorted in alphabetic order.

@ -29,89 +29,87 @@ export interface NS extends Singularity
| Method | Description |
| --- | --- |
| [brutessh(host)](./bitburner.ns.brutessh.md) | Runs the BruteSSH.exe program on the target server. BruteSSH.exe must exist on your home computer. |
| [clear(handle)](./bitburner.ns.clear.md) | This function is used to clear data in a Netscript Ports or a text file.<!-- -->If the port/fn argument is a number between 1 and 20, then it specifies a port and will clear it (deleting all data from the underlying queue).<!-- -->If the port/fn argument is a string, then it specifies the name of a text file (.txt) and will delete all data from that text file. |
| [brutessh(host)](./bitburner.ns.brutessh.md) | Runs BruteSSH.exe on a server. |
| [clear(handle)](./bitburner.ns.clear.md) | Clear data from a port. |
| [clearLog()](./bitburner.ns.clearlog.md) | Clears the scripts logs. |
| [deleteServer(host)](./bitburner.ns.deleteserver.md) | Deletes one of your purchased servers, which is specified by its hostname.<!-- -->The hostname argument can be any data type, but it will be converted to a string. Whitespace is automatically removed from the string. This function will not delete a server that still has scripts running on it. |
| [deleteServer(host)](./bitburner.ns.deleteserver.md) | Delete a purchased server. |
| [disableLog(fn)](./bitburner.ns.disablelog.md) | Disables logging for the given function. |
| [enableLog(fn)](./bitburner.ns.enablelog.md) | Re-enables logging for the given function. If <code>ALL</code> is passed into this function as an argument, then it will revert the effects of disableLog(<code>ALL</code>). |
| [exec(script, host, numThreads, args)](./bitburner.ns.exec.md) | Run a script as a separate process on a specified server. This is similar to the run function except that it can be used to run a script on any server, instead of just the current server.<!-- -->If the script was successfully started, then this functions returns the PID of that script. Otherwise, it returns 0.<!-- -->PID stands for Process ID. The PID is a unique identifier for each script. The PID will always be a positive integer.<!-- -->Running this function with a numThreads argument of 0 will return 0 without running the script. However, running this function with a negative numThreads argument will cause a runtime error. |
| [enableLog(fn)](./bitburner.ns.enablelog.md) | Enable logging for a certain function. |
| [exec(script, host, numThreads, args)](./bitburner.ns.exec.md) | Start another script on any server. |
| [exit()](./bitburner.ns.exit.md) | Terminates the current script immediately. |
| [fileExists(filename, host)](./bitburner.ns.fileexists.md) | Returns a boolean indicating whether the specified file exists on the target server. The filename for scripts is case-sensitive, but for other types of files it is not. For example, fileExists(“brutessh.exe”) will work fine, even though the actual program is named 'BruteSSH.exe'.<!-- -->If the hostname/ip argument is omitted, then the function will search through the current server (the server running the script that calls this function) for the file. |
| [ftpcrack(host)](./bitburner.ns.ftpcrack.md) | Runs the FTPCrack.exe program on the target server. FTPCrack.exe must exist on your home computer. |
| [getBitNodeMultipliers()](./bitburner.ns.getbitnodemultipliers.md) | Returns an object containing the current BitNode multipliers. This function requires Source-File 5 in order to run. The multipliers are returned in decimal forms (e.g. 1.5 instead of 150%). The multipliers represent the difference between the current BitNode and the original BitNode (BitNode-1).<!-- -->For example, if the CrimeMoney multiplier has a value of 0.1, then that means that committing crimes in the current BitNode will only give 10% of the money you would have received in BitNode-1. |
| [fileExists(filename, host)](./bitburner.ns.fileexists.md) | Check if a file exists. |
| [ftpcrack(host)](./bitburner.ns.ftpcrack.md) | Runs FTPCrack.exe on a server. |
| [getBitNodeMultipliers()](./bitburner.ns.getbitnodemultipliers.md) | Get the current Bitnode multipliers. |
| [getFavorToDonate()](./bitburner.ns.getfavortodonate.md) | Returns the amount of Faction favor required to be able to donate to a faction. |
| [getGrowTime(host, hackLvl, intLvl)](./bitburner.ns.getgrowtime.md) | Returns the amount of time in seconds 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. |
| [getGrowTime(host)](./bitburner.ns.getgrowtime.md) | Get the execution time of a grow() call. |
| [getHackingLevel()](./bitburner.ns.gethackinglevel.md) | Returns the players current hacking level. |
| [getHackingMultipliers()](./bitburner.ns.gethackingmultipliers.md) | Returns an object containing the Players hacking related multipliers. These multipliers are returned in fractional forms, not percentages (e.g. 1.5 instead of 150%). |
| [getHacknetMultipliers()](./bitburner.ns.gethacknetmultipliers.md) | Returns an object containing the Players hacknet related multipliers. These multipliers are returned in fractional forms, not percentages (e.g. 1.5 instead of 150%). |
| [getHackTime(host, hackLvl, intLvl)](./bitburner.ns.gethacktime.md) | Returns the amount of time in seconds 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. |
| [getHackingMultipliers()](./bitburner.ns.gethackingmultipliers.md) | Get hacking related multipliers. |
| [getHacknetMultipliers()](./bitburner.ns.gethacknetmultipliers.md) | Get hacknet related multipliers. |
| [getHackTime(host)](./bitburner.ns.gethacktime.md) | Get the execution time of a hack() call. |
| [getHostname()](./bitburner.ns.gethostname.md) | Returns a string with the hostname of the server that the script is running on. |
| [getPortHandle(port)](./bitburner.ns.getporthandle.md) | Get a handle to a Netscript Port.<!-- -->WARNING: Port Handles only work in NetscriptJS (Netscript 2.0). They will not work in Netscript 1.0. |
| [getPurchasedServerCost(ram)](./bitburner.ns.getpurchasedservercost.md) | Returns the cost to purchase a server with the specified amount of ram. |
| [getPortHandle(port)](./bitburner.ns.getporthandle.md) | Get all data on a port. |
| [getPurchasedServerCost(ram)](./bitburner.ns.getpurchasedservercost.md) | Get cost of purchasing a server. |
| [getPurchasedServerLimit()](./bitburner.ns.getpurchasedserverlimit.md) | Returns the maximum number of servers you can purchase. |
| [getPurchasedServerMaxRam()](./bitburner.ns.getpurchasedservermaxram.md) | Returns the maximum RAM that a purchased server can have. |
| [getPurchasedServers(hostnameMode)](./bitburner.ns.getpurchasedservers.md) | Returns an array with either the hostnames or IPs of all of the servers you have purchased. |
| [getScriptExpGain(script, host, args)](./bitburner.ns.getscriptexpgain.md) | Returns the amount of hacking experience the specified script generates while online (when the game is open, does not apply for offline experience gains). Remember that a script is uniquely identified by both its name and its arguments.<!-- -->This function can also return the total experience gain rate of all of your active scripts by running the function with no arguments. |
| [getScriptIncome(script, host, args)](./bitburner.ns.getscriptincome.md) | Returns the amount of income the specified script generates while online (when the game is open, does not apply for offline income). Remember that a script is uniquely identified by both its name and its arguments. So for example if you ran a script with the arguments “foodnstuff” and “5” then in order to use this function to get that scripts income you must specify those same arguments in the same order in this function call.<!-- -->This function can also be called with no arguments. If called with no arguments, then this function will return an array of two values. The first value is the total income (dollar / second) of all of your active scripts (scripts that are currently running on any server). The second value is the total income (dollar / second) that youve earned from scripts since you last installed Augmentations. |
| [getScriptLogs(fn, host, args)](./bitburner.ns.getscriptlogs.md) | Returns a scripts logs. The logs are returned as an array, where each line is an element in the array. The most recently logged line is at the end of the array. Note that there is a maximum number of lines that a script stores in its logs. This is configurable in the games options. If the function is called with no arguments, it will return the current scripts logs.<!-- -->Otherwise, the fn, hostname/ip, and args… arguments can be used to get the logs from another script. Remember that scripts are uniquely identified by both their names and arguments. |
| [getScriptExpGain(script, host, args)](./bitburner.ns.getscriptexpgain.md) | Get the exp gain of a script. |
| [getScriptIncome(script, host, args)](./bitburner.ns.getscriptincome.md) | Get the income of a script. |
| [getScriptLogs(fn, host, args)](./bitburner.ns.getscriptlogs.md) | Get all the logs of a script. |
| [getScriptName()](./bitburner.ns.getscriptname.md) | Returns the current script name. |
| [getScriptRam(script, host)](./bitburner.ns.getscriptram.md) | Returns the amount of RAM required to run the specified script on the target server. Returns 0 if the script does not exist. |
| [getScriptRam(script, host)](./bitburner.ns.getscriptram.md) | Get the ram cost of a script. |
| [getServer(host)](./bitburner.ns.getserver.md) | Returns a server object for the given server. Defaults to the running script's server if host is not specified. |
| [getServerBaseSecurityLevel(host)](./bitburner.ns.getserverbasesecuritylevel.md) | Returns the base security level of the target server. This is the security level that the server starts out with. This is different than getServerSecurityLevel because getServerSecurityLevel returns the current security level of a server, which can constantly change due to hack, grow, and weaken, calls on that server. The base security level will stay the same until you reset by installing an Augmentation(s). |
| [getServerGrowth(host)](./bitburner.ns.getservergrowth.md) | Returns the servers instrinsic “growth parameter”. This growth parameter is a number between 1 and 100 that represents how quickly the servers money grows. This parameter affects the percentage by which the servers money is increased when using the grow function. A higher growth parameter will result in a higher percentage increase from grow. |
| [getServerMaxMoney(host)](./bitburner.ns.getservermaxmoney.md) | Returns the maximum amount of money that can be available on a server. |
| [getServerGrowth(host)](./bitburner.ns.getservergrowth.md) | Get a server growth parameter. |
| [getServerMaxMoney(host)](./bitburner.ns.getservermaxmoney.md) | Get maximum money available on a server. |
| [getServerMinSecurityLevel(host)](./bitburner.ns.getserverminsecuritylevel.md) | Returns the minimum security level of the target server. |
| [getServerMoneyAvailable(host)](./bitburner.ns.getservermoneyavailable.md) | Returns the amount of money available on a server. Running this function on the home computer will return the players money. |
| [getServerMoneyAvailable(host)](./bitburner.ns.getservermoneyavailable.md) | Get money available on a server. |
| [getServerNumPortsRequired(host)](./bitburner.ns.getservernumportsrequired.md) | Returns the number of open ports required to successfully run NUKE.exe on the specified server. |
| [getServerRam(host)](./bitburner.ns.getserverram.md) | Returns an array with two elements that gives information about a servers memory (RAM). The first element in the array is the amount of RAM that the server has total (in GB). The second element in the array is the amount of RAM that is currently being used on the server (in GB). |
| [getServerRequiredHackingLevel(host)](./bitburner.ns.getserverrequiredhackinglevel.md) | Returns the required hacking level of the target server. |
| [getServerSecurityLevel(host)](./bitburner.ns.getserversecuritylevel.md) | Returns the security level of the target server. A servers security level is denoted by a number, typically between 1 and 100 (but it can go above 100). |
| [getServerSecurityLevel(host)](./bitburner.ns.getserversecuritylevel.md) | Get server security level. |
| [getTimeSinceLastAug()](./bitburner.ns.gettimesincelastaug.md) | Returns the amount of time in milliseconds that have passed since you last installed Augmentations. |
| [getWeakenTime(host, hackLvl, intLvl)](./bitburner.ns.getweakentime.md) | Returns the amount of time in seconds 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. |
| [getWeakenTime(host)](./bitburner.ns.getweakentime.md) | Get the execution time of a weaken() call. |
| [grow(host, opts)](./bitburner.ns.grow.md) | Spoof money in a servers bank account, increasing the amount available. |
| [growthAnalyze(host, growthAmount)](./bitburner.ns.growthanalyze.md) | This function returns the number of “growths” needed in order to increase the amount of money available on the specified server by the specified amount. The specified amount is multiplicative and is in decimal form, not percentage.<!-- -->Warning: The value returned by this function isnt necessarily a whole number. |
| [growthAnalyzeSecurity(threads)](./bitburner.ns.growthanalyzesecurity.md) | Returns the security increase that would occur if a grow with this many threads happened. |
| [growthAnalyze(host, growthAmount)](./bitburner.ns.growthanalyze.md) | Calculate the number of grow thread needed to grow a server by a certain multiplier. |
| [growthAnalyzeSecurity(threads)](./bitburner.ns.growthanalyzesecurity.md) | Calculate the security increase for a number of thread. |
| [hack(host, opts)](./bitburner.ns.hack.md) | Steal a servers money. |
| [hackAnalyzePercent(host)](./bitburner.ns.hackanalyzepercent.md) | Returns the percentage of the specified servers money you will steal with a single hack. This value is returned in percentage form, not decimal (Netscript functions typically return in decimal form, but not this one). |
| [hackAnalyzeSecurity(threads)](./bitburner.ns.hackanalyzesecurity.md) | Returns the security increase that would occur if a hack with this many threads happened. |
| [hackAnalyzePercent(host)](./bitburner.ns.hackanalyzepercent.md) | Get the percent of money stolen with a single thread. |
| [hackAnalyzeSecurity(threads)](./bitburner.ns.hackanalyzesecurity.md) | Get the security increase for a number of thread. |
| [hackAnalyzeThreads(host, hackAmount)](./bitburner.ns.hackanalyzethreads.md) | Predict the effect of hack. |
| [hackChance(host)](./bitburner.ns.hackchance.md) | Returns the chance you have of successfully hacking the specified server.<!-- -->This returned value is in decimal form, not percentage. |
| [hasRootAccess(host)](./bitburner.ns.hasrootaccess.md) | Returns a boolean indicating whether or not the player has root access to the specified target server. |
| [httpworm(host)](./bitburner.ns.httpworm.md) | Runs the HTTPWorm.exe program on the target server. HTTPWorm.exe must exist on your home computer. |
| [hackChance(host)](./bitburner.ns.hackchance.md) | Get the chance of successfully hacking a server. |
| [hasRootAccess(host)](./bitburner.ns.hasrootaccess.md) | Check if your have root access on a server. |
| [httpworm(host)](./bitburner.ns.httpworm.md) | Runs HTTPWorm.exe on a server. |
| [isLogEnabled(fn)](./bitburner.ns.islogenabled.md) | Checks the status of the logging for the given function. |
| [isRunning(script, host, args)](./bitburner.ns.isrunning.md) | Returns a boolean indicating whether the specified script is running on the target server. Remember that a script is uniquely identified by both its name and its arguments. |
| [kill(script, host, args)](./bitburner.ns.kill.md) | Kills the script on the target server specified by the scripts name and arguments. Remember that scripts are uniquely identified by both their name and arguments. For example, if <code>foo.script</code> is run with the argument 1, then this is not the same as <code>foo.script</code> run with the argument 2, even though they have the same code. |
| [kill(scriptPid)](./bitburner.ns.kill_1.md) | Kills the script with the specified PID. Killing a script by its PID will typically have better performance, especially if you have many scripts running. If this function successfully kills the specified script, then it will return true. Otherwise, it will return false. |
| [killall(host)](./bitburner.ns.killall.md) | Kills all running scripts on the specified server. This function returns true if any scripts were killed, and false otherwise. In other words, it will return true if there are any scripts running on the target server. |
| [ls(host, grep)](./bitburner.ns.ls.md) | Returns an array with the filenames of all files on the specified server (as strings). The returned array is sorted in alphabetic order. |
| [nFormat(n, format)](./bitburner.ns.nformat.md) | Converts a number into a string with the specified formatter. This uses the numeraljs library, so the formatters must be compatible with that. This is the same function that the game itself uses to display numbers. |
| [nuke(host)](./bitburner.ns.nuke.md) | Runs the NUKE.exe program on the target server. NUKE.exe must exist on your home computer. |
| [peek(port)](./bitburner.ns.peek.md) | This function is used to peek at the data from a port. It returns the first element in the specified port without removing that element. If the port is empty, the string “NULL PORT DATA” will be returned. |
| [isRunning(script, host, args)](./bitburner.ns.isrunning.md) | Check if a script is running. |
| [kill(script, host, args)](./bitburner.ns.kill.md) | Terminate another script. |
| [kill(scriptPid)](./bitburner.ns.kill_1.md) | Terminate another script. |
| [killall(host)](./bitburner.ns.killall.md) | Terminate all scripts on a server. |
| [ls(host, grep)](./bitburner.ns.ls.md) | List files on a server. |
| [nFormat(n, format)](./bitburner.ns.nformat.md) | Format a number |
| [nuke(host)](./bitburner.ns.nuke.md) | Runs NUKE.exe on a server. |
| [peek(port)](./bitburner.ns.peek.md) | Get a copy of the data from a port without popping it. |
| [print(msg)](./bitburner.ns.print.md) | Prints a value or a variable to the scripts logs. |
| [prompt(txt)](./bitburner.ns.prompt.md) | Prompts the player with a dialog box with two options: “Yes” and “No”. This function will return true if the player click “Yes” and false if the player clicks “No”. The scripts execution is halted until the player selects one of the options. |
| [ps(host)](./bitburner.ns.ps.md) | Returns an array with general information about all scripts running on the specified target server. |
| [purchaseServer(hostname, ram)](./bitburner.ns.purchaseserver.md) | Purchased a server with the specified hostname and amount of RAM.<!-- -->The hostname argument can be any data type, but it will be converted to a string and have whitespace removed. Anything that resolves to an empty string will cause the function to fail. If there is already a server with the specified hostname, then the function will automatically append a number at the end of the hostname argument value until it finds a unique hostname. For example, if the script calls <code>purchaseServer(“foo”, 4)</code> but a server named “foo” already exists, the it will automatically change the hostname to <code>foo-0</code>. If there is already a server with the hostname <code>foo-0</code>, then it will change the hostname to <code>foo-1</code>, and so on.<!-- -->Note that there is a maximum limit to the amount of servers you can purchase.<!-- -->Returns the hostname of the newly purchased server as a string. If the function fails to purchase a server, then it will return an empty string. The function will fail if the arguments passed in are invalid, if the player does not have enough money to purchase the specified server, or if the player has exceeded the maximum amount of servers. |
| [read(handle)](./bitburner.ns.read.md) | This function is used to read data from a port or from a text file (.txt).<!-- -->If the argument port/fn is a number between 1 and 20, then it specifies a port and it will read data from that port. A port is a serialized queue. This function will remove the first element from that queue and return it. If the queue is empty, then the string “NULL PORT DATA” will be returned.<!-- -->If the argument port/fn is a string, then it specifies the name of a text file (.txt) and this function will return the data in the specified text file. If the text file does not exist, an empty string will be returned. |
| [relaysmtp(host)](./bitburner.ns.relaysmtp.md) | Runs the relaySMTP.exe program on the target server. relaySMTP.exe must exist on your home computer. |
| [rm(name, host)](./bitburner.ns.rm.md) | Removes the specified file from the current server. This function works for every file type except message (.msg) files. |
| [run(script, numThreads, args)](./bitburner.ns.run.md) | Run a script as a separate process. This function can only be used to run scripts located on the current server (the server running the script that calls this function). Requires a significant amount of RAM to run this command.<!-- -->If the script was successfully started, then this functions returns the PID of that script. Otherwise, it returns 0.<!-- -->PID stands for Process ID. The PID is a unique identifier for each script. The PID will always be a positive integer.<!-- -->Running this function with a numThreads argument of 0 will return 0 without running the script. However, running this function with a negative numThreads argument will cause a runtime error. |
| [scan(host, hostnames)](./bitburner.ns.scan.md) | Returns an array containing the hostnames or IPs of all servers that are one node way from the specified target server. The hostnames/IPs in the returned array are strings. |
| [scp(files, destination)](./bitburner.ns.scp.md) | Copies a script or literature (.lit) file(s) to another server. The files argument can be either a string specifying a single file to copy, or an array of strings specifying multiple files to copy. |
| [scp(files, source, destination)](./bitburner.ns.scp_1.md) | Copies a script or literature (.lit) file(s) to another server. The files argument can be either a string specifying a single file to copy, or an array of strings specifying multiple files to copy. |
| [scriptKill(script, host)](./bitburner.ns.scriptkill.md) | Kills all scripts with the specified filename on the target server specified by hostname, regardless of arguments. |
| [scriptRunning(script, host)](./bitburner.ns.scriptrunning.md) | Returns a boolean indicating whether any instance of the specified script is running on the target server, regardless of its arguments.<!-- -->This is different than the isRunning function because it does not try to identify a specific instance of a running script by its arguments. |
| [prompt(txt)](./bitburner.ns.prompt.md) | Prompt the player with a Yes/No modal. |
| [ps(host)](./bitburner.ns.ps.md) | List running scripts on a server. |
| [purchaseServer(hostname, ram)](./bitburner.ns.purchaseserver.md) | Purchase a server. |
| [read(handle)](./bitburner.ns.read.md) | Read content of a file. |
| [relaysmtp(host)](./bitburner.ns.relaysmtp.md) | Runs relaySMTP.exe on a server. |
| [rm(name, host)](./bitburner.ns.rm.md) | Delete a file. |
| [run(script, numThreads, args)](./bitburner.ns.run.md) | Start another script on the current server. |
| [scan(host, hostnames)](./bitburner.ns.scan.md) | Get the list servers connected to a server. |
| [scp(files, destination)](./bitburner.ns.scp.md) | Copy file between servers. |
| [scp(files, source, destination)](./bitburner.ns.scp_1.md) | Copy file between servers. |
| [scriptKill(script, host)](./bitburner.ns.scriptkill.md) | Kill all scripts with a filename. |
| [scriptRunning(script, host)](./bitburner.ns.scriptrunning.md) | Check if any script with a filename is running. |
| [serverExists(host)](./bitburner.ns.serverexists.md) | Returns a boolean denoting whether or not the specified server exists. |
| [sleep(millis)](./bitburner.ns.sleep.md) | Suspends the script for n milliseconds. |
| [spawn(script, numThreads, args)](./bitburner.ns.spawn.md) | Terminates the current script, and then after a delay of about 10 seconds it will execute the newly-specified script. The purpose of this function is to execute a new script without being constrained by the RAM usage of the current one. This function can only be used to run scripts on the local server.<!-- -->Because this function immediately terminates the script, it does not have a return value. |
| [sprintf(format, args)](./bitburner.ns.sprintf.md) | Complete open source JavaScript sprintf implementation |
| [sqlinject(host)](./bitburner.ns.sqlinject.md) | Runs the SQLInject.exe program on the target server. SQLInject.exe must exist on your home computer. |
| [tail(fn, host, args)](./bitburner.ns.tail.md) | Opens a scripts logs. This is functionally the same as the tail Terminal command.<!-- -->If the function is called with no arguments, it will open the current scripts logs.<!-- -->Otherwise, the fn, hostname/ip, and args… arguments can be used to get the logs from another script. Remember that scripts are uniquely identified by both their names and arguments. |
| [spawn(script, numThreads, args)](./bitburner.ns.spawn.md) | Terminate current script and start another in 10s. |
| [sprintf(format, args)](./bitburner.ns.sprintf.md) | Format a string. |
| [sqlinject(host)](./bitburner.ns.sqlinject.md) | Runs SQLInject.exe on a server. |
| [tail(fn, host, args)](./bitburner.ns.tail.md) | Open the tail window of a script. |
| [tprint(msg)](./bitburner.ns.tprint.md) | Prints a value or a variable to the Terminal. |
| [tryWrite(port, data)](./bitburner.ns.trywrite.md) | Attempts to write data to the specified Netscript Port. If the port is full, the data will not be written. Otherwise, the data will be written normally. |
| [vsprintf(format, args)](./bitburner.ns.vsprintf.md) | Complete open source JavaScript sprintf implementation |
| [tryWrite(port, data)](./bitburner.ns.trywrite.md) | Attempt to write to a port. |
| [vsprintf(format, args)](./bitburner.ns.vsprintf.md) | Format a string with an array of arguments. |
| [weaken(host, opts)](./bitburner.ns.weaken.md) | Reduce a server security level. |
| [weakenAnalyze(threads, cores)](./bitburner.ns.weakenanalyze.md) | Predict the effect of weaken. |
| [wget(url, target, host)](./bitburner.ns.wget.md) | Retrieves data from a URL and downloads it to a file on the specified server. The data can only be downloaded to a script (.script, .ns, .js) or a text file (.txt). If the file already exists, it will be overwritten by this command. Note that it will not be possible to download data from many websites because they do not allow cross-origin resource sharing (CORS).<!-- -->IMPORTANT: This is an asynchronous function that returns a Promise. The Promises resolved value will be a boolean indicating whether or not the data was successfully retrieved from the URL. Because the function is async and returns a Promise, it is recommended you use wget in NetscriptJS (Netscript 2.0).<!-- -->In NetscriptJS, you must preface any call to wget with the await keyword (like you would hack or sleep). wget will still work in Netscript 1.0, but the functions execution will not be synchronous (i.e. it may not execute when you expect/want it to). Furthermore, since Promises are not supported in ES5, you will not be able to process the returned value of wget in Netscript 1.0. |
| [write(handle, data, mode)](./bitburner.ns.write.md) | This function can be used to either write data to a port or to a text file (.txt).<!-- -->If the first argument is a number between 1 and 20, then it specifies a port and this function will write data to that port. The third argument, mode, is not used when writing to a port.<!-- -->If the first argument is a string, then it specifies the name of a text file (.txt) and this function will write data to that text file. If the specified text file does not exist, then it will be created. The third argument mode, defines how the data will be written to the text file. If \*mode is set to “w”, then the data is written in “write” mode which means that it will overwrite all existing data on the text file. If mode is set to any other value then the data will be written in “append” mode which means that the data will be added at the end of the text file. |
| [wget(url, target, host)](./bitburner.ns.wget.md) | Download a file from the internet. |
| [write(handle, data, mode)](./bitburner.ns.write.md) | Write data to a file. |

@ -4,7 +4,7 @@
## NS.nFormat() method
Converts a number into a string with the specified formatter. This uses the numeraljs library, so the formatters must be compatible with that. This is the same function that the game itself uses to display numbers.
Format a number
<b>Signature:</b>
@ -29,3 +29,7 @@ Formated number.
RAM cost: 0 GB
Converts a number into a string with the specified formatter. This uses the numeraljs library, so the formatters must be compatible with that. This is the same function that the game itself uses to display numbers.
see: http://numeraljs.com/

@ -4,7 +4,7 @@
## NS.nuke() method
Runs the NUKE.exe program on the target server. NUKE.exe must exist on your home computer.
Runs NUKE.exe on a server.
<b>Signature:</b>
@ -26,6 +26,8 @@ void
RAM cost: 0.05 GB
Runs the NUKE.exe program on the target server. NUKE.exe must exist on your home computer.
## Example

@ -4,7 +4,7 @@
## NS.peek() method
This function is used to peek at the data from a port. It returns the first element in the specified port without removing that element. If the port is empty, the string “NULL PORT DATA” will be returned.
Get a copy of the data from a port without popping it.
<b>Signature:</b>
@ -28,3 +28,5 @@ Data in the specified port.
RAM cost: 1 GB
This function is used to peek at the data from a port. It returns the first element in the specified port without removing that element. If the port is empty, the string “NULL PORT DATA” will be returned.

@ -4,7 +4,7 @@
## NS.prompt() method
Prompts the player with a dialog box with two options: “Yes” and “No”. This function will return true if the player click “Yes” and false if the player clicks “No”. The scripts execution is halted until the player selects one of the options.
Prompt the player with a Yes/No modal.
<b>Signature:</b>
@ -28,3 +28,5 @@ True if the player click “Yes” and false if the player clicks “No”.
RAM cost: 0 GB
Prompts the player with a dialog box with two options: “Yes” and “No”. This function will return true if the player click “Yes” and false if the player clicks “No”. The scripts execution is halted until the player selects one of the options.

@ -4,7 +4,7 @@
## NS.ps() method
Returns an array with general information about all scripts running on the specified target server.
List running scripts on a server.
<b>Signature:</b>
@ -28,6 +28,8 @@ Array with general information about all scripts running on the specified target
RAM cost: 0.2 GB
Returns an array with general information about all scripts running on the specified target server.
## Example

@ -4,13 +4,7 @@
## NS.purchaseServer() method
Purchased a server with the specified hostname and amount of RAM.
The hostname argument can be any data type, but it will be converted to a string and have whitespace removed. Anything that resolves to an empty string will cause the function to fail. If there is already a server with the specified hostname, then the function will automatically append a number at the end of the hostname argument value until it finds a unique hostname. For example, if the script calls `purchaseServer(“foo”, 4)` but a server named “foo” already exists, the it will automatically change the hostname to `foo-0`<!-- -->. If there is already a server with the hostname `foo-0`<!-- -->, then it will change the hostname to `foo-1`<!-- -->, and so on.
Note that there is a maximum limit to the amount of servers you can purchase.
Returns the hostname of the newly purchased server as a string. If the function fails to purchase a server, then it will return an empty string. The function will fail if the arguments passed in are invalid, if the player does not have enough money to purchase the specified server, or if the player has exceeded the maximum amount of servers.
Purchase a server.
<b>Signature:</b>
@ -35,6 +29,14 @@ The hostname of the newly purchased server.
2.25 GB
Purchased a server with the specified hostname and amount of RAM.
The hostname argument can be any data type, but it will be converted to a string and have whitespace removed. Anything that resolves to an empty string will cause the function to fail. If there is already a server with the specified hostname, then the function will automatically append a number at the end of the hostname argument value until it finds a unique hostname. For example, if the script calls `purchaseServer(“foo”, 4)` but a server named “foo” already exists, the it will automatically change the hostname to `foo-0`<!-- -->. If there is already a server with the hostname `foo-0`<!-- -->, then it will change the hostname to `foo-1`<!-- -->, and so on.
Note that there is a maximum limit to the amount of servers you can purchase.
Returns the hostname of the newly purchased server as a string. If the function fails to purchase a server, then it will return an empty string. The function will fail if the arguments passed in are invalid, if the player does not have enough money to purchase the specified server, or if the player has exceeded the maximum amount of servers.
## Example

@ -4,11 +4,7 @@
## NS.read() method
This function is used to read data from a port or from a text file (.txt).
If the argument port/fn is a number between 1 and 20, then it specifies a port and it will read data from that port. A port is a serialized queue. This function will remove the first element from that queue and return it. If the queue is empty, then the string “NULL PORT DATA” will be returned.
If the argument port/fn is a string, then it specifies the name of a text file (.txt) and this function will return the data in the specified text file. If the text file does not exist, an empty string will be returned.
Read content of a file.
<b>Signature:</b>
@ -32,3 +28,9 @@ Data in the specified text file or port.
RAM cost: 1 GB
This function is used to read data from a port or from a text file (.txt).
If the argument port/fn is a number between 1 and 20, then it specifies a port and it will read data from that port. A port is a serialized queue. This function will remove the first element from that queue and return it. If the queue is empty, then the string “NULL PORT DATA” will be returned.
If the argument port/fn is a string, then it specifies the name of a text file (.txt) and this function will return the data in the specified text file. If the text file does not exist, an empty string will be returned.

@ -4,7 +4,7 @@
## NS.relaysmtp() method
Runs the relaySMTP.exe program on the target server. relaySMTP.exe must exist on your home computer.
Runs relaySMTP.exe on a server.
<b>Signature:</b>
@ -26,6 +26,8 @@ void
RAM cost: 0.05 GB
Runs the relaySMTP.exe program on the target server. relaySMTP.exe must exist on your home computer.
## Example

@ -4,7 +4,7 @@
## NS.rm() method
Removes the specified file from the current server. This function works for every file type except message (.msg) files.
Delete a file.
<b>Signature:</b>
@ -29,3 +29,5 @@ True if it successfully deletes the file, and false otherwise.
RAM cost: 1 GB
Removes the specified file from the current server. This function works for every file type except message (.msg) files.

@ -4,13 +4,7 @@
## NS.run() method
Run a script as a separate process. This function can only be used to run scripts located on the current server (the server running the script that calls this function). Requires a significant amount of RAM to run this command.
If the script was successfully started, then this functions returns the PID of that script. Otherwise, it returns 0.
PID stands for Process ID. The PID is a unique identifier for each script. The PID will always be a positive integer.
Running this function with a numThreads argument of 0 will return 0 without running the script. However, running this function with a negative numThreads argument will cause a runtime error.
Start another script on the current server.
<b>Signature:</b>
@ -36,6 +30,14 @@ Returns the PID of a successfully started script, and 0 otherwise.
RAM cost: 1 GB
Run a script as a separate process. This function can only be used to run scripts located on the current server (the server running the script that calls this function). Requires a significant amount of RAM to run this command.
If the script was successfully started, then this functions returns the PID of that script. Otherwise, it returns 0.
PID stands for Process ID. The PID is a unique identifier for each script. The PID will always be a positive integer.
Running this function with a numThreads argument of 0 will return 0 without running the script. However, running this function with a negative numThreads argument will cause a runtime error.
## Example 1

@ -4,7 +4,7 @@
## NS.scan() method
Returns an array containing the hostnames or IPs of all servers that are one node way from the specified target server. The hostnames/IPs in the returned array are strings.
Get the list servers connected to a server.
<b>Signature:</b>
@ -29,3 +29,5 @@ Returns an string of hostnames or IP.
RAM cost: 0.2 GB
Returns an array containing the hostnames or IPs of all servers that are one node way from the specified target server. The hostnames/IPs in the returned array are strings.

@ -4,7 +4,7 @@
## NS.scp() method
Copies a script or literature (.lit) file(s) to another server. The files argument can be either a string specifying a single file to copy, or an array of strings specifying multiple files to copy.
Copy file between servers.
<b>Signature:</b>
@ -29,6 +29,8 @@ True if the script/literature file is successfully copied over and false otherwi
RAM cost: 0.6 GB
Copies a script or literature (.lit) file(s) to another server. The files argument can be either a string specifying a single file to copy, or an array of strings specifying multiple files to copy.
## Example

@ -4,7 +4,7 @@
## NS.scp() method
Copies a script or literature (.lit) file(s) to another server. The files argument can be either a string specifying a single file to copy, or an array of strings specifying multiple files to copy.
Copy file between servers.
<b>Signature:</b>
@ -35,6 +35,8 @@ True if the script/literature file is successfully copied over and false otherwi
RAM cost: 0.6 GB
Copies a script or literature (.lit) file(s) to another server. The files argument can be either a string specifying a single file to copy, or an array of strings specifying multiple files to copy.
## Example 1

@ -4,7 +4,7 @@
## NS.scriptKill() method
Kills all scripts with the specified filename on the target server specified by hostname, regardless of arguments.
Kill all scripts with a filename.
<b>Signature:</b>
@ -29,3 +29,5 @@ true if one or more scripts were successfully killed, and false if none were.
RAM cost: 1 GB
Kills all scripts with the specified filename on the target server specified by hostname, regardless of arguments.

@ -4,9 +4,7 @@
## NS.scriptRunning() method
Returns a boolean indicating whether any instance of the specified script is running on the target server, regardless of its arguments.
This is different than the isRunning function because it does not try to identify a specific instance of a running script by its arguments.
Check if any script with a filename is running.
<b>Signature:</b>
@ -31,6 +29,10 @@ True if the specified script is running, and false otherwise.
RAM cost: 1 GB
Returns a boolean indicating whether any instance of the specified script is running on the target server, regardless of its arguments.
This is different than the isRunning function because it does not try to identify a specific instance of a running script by its arguments.
## Example 1

@ -4,9 +4,7 @@
## NS.spawn() method
Terminates the current script, and then after a delay of about 10 seconds it will execute the newly-specified script. The purpose of this function is to execute a new script without being constrained by the RAM usage of the current one. This function can only be used to run scripts on the local server.
Because this function immediately terminates the script, it does not have a return value.
Terminate current script and start another in 10s.
<b>Signature:</b>
@ -30,6 +28,10 @@ void
RAM cost: 2 GB
Terminates the current script, and then after a delay of about 10 seconds it will execute the newly-specified script. The purpose of this function is to execute a new script without being constrained by the RAM usage of the current one. This function can only be used to run scripts on the local server.
Because this function immediately terminates the script, it does not have a return value.
## Example

@ -4,7 +4,7 @@
## NS.sprintf() method
Complete open source JavaScript sprintf implementation
Format a string.
<b>Signature:</b>
@ -29,3 +29,5 @@ Formated text.
RAM cost: 0 GB
see: https://github.com/alexei/sprintf.js

@ -4,7 +4,7 @@
## NS.sqlinject() method
Runs the SQLInject.exe program on the target server. SQLInject.exe must exist on your home computer.
Runs SQLInject.exe on a server.
<b>Signature:</b>

@ -4,11 +4,7 @@
## NS.tail() method
Opens a scripts logs. This is functionally the same as the tail Terminal command.
If the function is called with no arguments, it will open the current scripts logs.
Otherwise, the fn, hostname/ip, and args… arguments can be used to get the logs from another script. Remember that scripts are uniquely identified by both their names and arguments.
Open the tail window of a script.
<b>Signature:</b>
@ -32,6 +28,12 @@ void
RAM cost: 0 GB
Opens a scripts logs. This is functionally the same as the tail Terminal command.
If the function is called with no arguments, it will open the current scripts logs.
Otherwise, the fn, hostname/ip, and args… arguments can be used to get the logs from another script. Remember that scripts are uniquely identified by both their names and arguments.
## Example 1

@ -4,7 +4,7 @@
## NS.tryWrite() method
Attempts to write data to the specified Netscript Port. If the port is full, the data will not be written. Otherwise, the data will be written normally.
Attempt to write to a port.
<b>Signature:</b>
@ -29,3 +29,5 @@ True if the data is successfully written to the port, and false otherwise.
RAM cost: 1 GB
Attempts to write data to the specified Netscript Port. If the port is full, the data will not be written. Otherwise, the data will be written normally.

@ -4,7 +4,7 @@
## NS.vsprintf() method
Complete open source JavaScript sprintf implementation
Format a string with an array of arguments.
<b>Signature:</b>
@ -29,3 +29,5 @@ Formated text.
RAM cost: 0 GB
see: https://github.com/alexei/sprintf.js

@ -27,7 +27,9 @@ The amount by which the target servers security level was decreased. This is
## Remarks
RAM cost: 0.15 GB Use your hacking skills to attack a servers security, lowering the servers security level. The runtime for this command depends on your hacking level and the target servers security level. This function lowers the security level of the target server by 0.05.
RAM cost: 0.15 GB
Use your hacking skills to attack a servers security, lowering the servers security level. The runtime for this command depends on your hacking level and the target servers security level. This function lowers the security level of the target server by 0.05.
Like hack and grow, `weaken` can be called on any server, regardless of where the script is running. This command requires root access to the target server, but there is no required hacking level to run the command.

@ -27,5 +27,7 @@ The security decrease.
## Remarks
RAM cost: 1 GB Returns the security decrease that would occur if a weaken with this many threads happened.
RAM cost: 1 GB
Returns the security decrease that would occur if a weaken with this many threads happened.

@ -4,11 +4,7 @@
## NS.wget() method
Retrieves data from a URL and downloads it to a file on the specified server. The data can only be downloaded to a script (.script, .ns, .js) or a text file (.txt). If the file already exists, it will be overwritten by this command. Note that it will not be possible to download data from many websites because they do not allow cross-origin resource sharing (CORS).
IMPORTANT: This is an asynchronous function that returns a Promise. The Promises resolved value will be a boolean indicating whether or not the data was successfully retrieved from the URL. Because the function is async and returns a Promise, it is recommended you use wget in NetscriptJS (Netscript 2.0).
In NetscriptJS, you must preface any call to wget with the await keyword (like you would hack or sleep). wget will still work in Netscript 1.0, but the functions execution will not be synchronous (i.e. it may not execute when you expect/want it to). Furthermore, since Promises are not supported in ES5, you will not be able to process the returned value of wget in Netscript 1.0.
Download a file from the internet.
<b>Signature:</b>
@ -34,6 +30,12 @@ True if the data was successfully retrieved from the URL, false otherwise.
RAM cost: 0 GB
Retrieves data from a URL and downloads it to a file on the specified server. The data can only be downloaded to a script (.script, .ns, .js) or a text file (.txt). If the file already exists, it will be overwritten by this command. Note that it will not be possible to download data from many websites because they do not allow cross-origin resource sharing (CORS).
IMPORTANT: This is an asynchronous function that returns a Promise. The Promises resolved value will be a boolean indicating whether or not the data was successfully retrieved from the URL. Because the function is async and returns a Promise, it is recommended you use wget in NetscriptJS (Netscript 2.0).
In NetscriptJS, you must preface any call to wget with the await keyword (like you would hack or sleep). wget will still work in Netscript 1.0, but the functions execution will not be synchronous (i.e. it may not execute when you expect/want it to). Furthermore, since Promises are not supported in ES5, you will not be able to process the returned value of wget in Netscript 1.0.
## Example

@ -4,11 +4,7 @@
## NS.write() method
This function can be used to either write data to a port or to a text file (.txt).
If the first argument is a number between 1 and 20, then it specifies a port and this function will write data to that port. The third argument, mode, is not used when writing to a port.
If the first argument is a string, then it specifies the name of a text file (.txt) and this function will write data to that text file. If the specified text file does not exist, then it will be created. The third argument mode, defines how the data will be written to the text file. If \*mode is set to “w”, then the data is written in “write” mode which means that it will overwrite all existing data on the text file. If mode is set to any other value then the data will be written in “append” mode which means that the data will be added at the end of the text file.
Write data to a file.
<b>Signature:</b>
@ -32,3 +28,9 @@ void
RAM cost: 1 GB
This function can be used to either write data to a port or to a text file (.txt).
If the first argument is a number between 1 and 20, then it specifies a port and this function will write data to that port. The third argument, mode, is not used when writing to a port.
If the first argument is a string, then it specifies the name of a text file (.txt) and this function will write data to that text file. If the specified text file does not exist, then it will be created. The third argument mode, defines how the data will be written to the text file. If \*mode is set to “w”, then the data is written in “write” mode which means that it will overwrite all existing data on the text file. If mode is set to any other value then the data will be written in “append” mode which means that the data will be added at the end of the text file.

Some files were not shown because too many files have changed in this diff Show More