Merge pull request #2652 from danielyxie/dev

Merge bunch of PRs.
This commit is contained in:
hydroflame 2022-01-15 18:40:05 -05:00 committed by GitHub
commit ca0ad1267c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
223 changed files with 5340 additions and 1631 deletions

2
.gitattributes vendored

@ -1 +1 @@
* text=auto
* text=auto eol=lf

8
.github/ISSUE_TEMPLATE vendored Normal file

@ -0,0 +1,8 @@
# DELETE THIS AFTER READING
# include (where relevant)
- [ ] Save file
- [ ] Minimal scripts to reproduce the issue
- [ ] Steps to reproduce
- [ ] Version of the game, e.g. Bitburner v1.3.0 (216bf616)

11
.github/PULL_REQUEST_TEMPLATE vendored Normal file

@ -0,0 +1,11 @@
# DELETE THIS AFTER READING
# Documentation
- DO NOT CHANGE any markdown/\*.md, these files are autogenerated from NetscriptDefinitions.d.ts and will be overwritten
- DO NOT re-generate the documentation, makes it harder to review.
# Bug fix
- Include how it was tested
- Include screenshot / gif (if possible)

@ -2,3 +2,14 @@ node_modules
package.json
dist
doc/build/
doc/source
.build
.package
editor.main.js
main.bundle.js
index.html
markdown
package.json
package.lock.json

@ -1,5 +1,6 @@
{
"trailingComma": "all",
"endOfLine": "lf",
"tabWidth": 2,
"printWidth": 120
}

503
dist/bitburner.d.ts vendored

File diff suppressed because it is too large Load Diff

36
dist/vendor.bundle.js vendored

File diff suppressed because one or more lines are too long

@ -39,8 +39,7 @@ There are two methods of obtaining Duplicate Sleeves:
1. Destroy BitNode-10. Each completion give you one additional Duplicate Sleeve
2. Purchase Duplicate Sleeves from :ref:`the faction The Covenant <gameplay_factions>`.
This is only available in BitNodes-10 and above, and is only available after defeating
BitNode-10 at least once. Sleeves purchased this way are **permanent** (they persist
This is only available in BitNodes-10. Sleeves purchased this way are **permanent** (they persist
through BitNodes). You can purchase up to 5 Duplicate Sleeves from The Covenant.
Synchronization

@ -113,7 +113,7 @@ The list contains the name of (i.e. the value returned by
| | | to any position from i to i+n. |
| | | |
| | | Assuming you are initially positioned at the start of the array, determine |
| | | whether you are able to reach the last index of the array EXACTLY. |
| | | whether you are able to reach the last index of the array. |
+------------------------------------+------------------------------------------------------------------------------------------+
| Merge Overlapping Intervals | | Given an array of intervals, merge all overlapping intervals. An interval |
| | | is an array with two numbers, where the first number is always less than |

@ -17,9 +17,16 @@ says 'Infiltrate Company'.
When infiltrating a company you will be presented with short active challenges.
None of the challenges use the mouse.
The difficulty at the top lowers with better combat stats. It is not recommended
The difficulty at the top lowers with better combat stats and charisma. It is not recommended
to attempt infiltrations above mid-normal.
The "maximum level" is the number of challenges you will need to pass to receive
the infiltration reward.
Every time you fail an infiltration challenge, you will take damage based on the
difficulty of the infiltration. If you are reduced to 0 hp or below, the
infiltration will immediately end.
* Most use spacebar as "action"
* Some use WASD or arrows interchangeably.
* A few others use the rest of the keyboard.
@ -60,4 +67,4 @@ Then move the cursor and press space to mark the mines on the board.
** Cut the wires **
Follow the instructions and press the numbers 1 through 9 to cut the appropriate
wires.
wires.

@ -16,7 +16,6 @@ Affects:
* Chance to successfully hack a server
* Percent money stolen when hacking a server
* Success rate of certain crimes
* Success rate of Hacking option during Infiltration
* Time it takes to create a program
* Faction reputation gain when carrying out Hacking Contracts or Field Work
* Company reputation gain for certain jobs
@ -26,7 +25,6 @@ Gain experience by:
* Manually hacking servers through Terminal
* Executing hack(), grow(), or weaken() through a script
* Committing certain crimes
* Infiltration
* Carrying out Hacking Contracts or doing Field work for Factions
* Working certain jobs at a company
* Studying at a university
@ -38,14 +36,12 @@ Represents the player's physical offensive power
Affects:
* Success rate of certain crimes
* Success rate of Combat options during Infiltration
* Faction reputation gain for Security and Field Work
* Company reputation gain for certain jobs
Gain experience by:
* Committing certain crimes
* Infiltration
* Working out at a gym
* Doing Security/Field Work for a faction
* Working certain jobs at a company
@ -58,15 +54,12 @@ Affects:
* Success rate of certain crimes
* The player's HP
* Success rate of Combat options during Infiltration
* How much damage the player takes during Infiltration
* Faction reputation gain for Security and Field Work
* Company reputation gain for certain jobs
Gain experience by:
* Committing certain crimes
* Infiltration
* Working out at a gym
* Doing Security/Field Work for a faction
* Working certain jobs at a company
@ -78,14 +71,12 @@ Represents the player's skill and adeptness in performing certain tasks
Affects:
* Success rate of certain crimes
* Success rate of Combat, Lockpick, and Escape options during Infiltration
* Faction reputation gain for Security and Field Work
* Company reputation gain for certain jobs
Gain experience by:
* Committing certain crimes
* Infiltration
* Working out at a gym
* Doing Security/Field Work for a faction
* Working certain jobs at a company
@ -97,14 +88,12 @@ Represents the player's speed and ability to move
Affects:
* Success rate of certain crimes
* Success rate of Combat, Sneak, and Escape options during Infiltration
* Faction reputation gain for Security and Field Work
* Company reputation gain for certain jobs
Gain experience by:
* Committing certain crimes
* Infiltration
* Working out at a gym
* Doing Security/Field Work for a faction
* Working certain jobs at a company
@ -116,14 +105,12 @@ Represents the player's social abilities
Affects:
* Success rate of certain crimes
* Success rate of Bribe option during Infiltration
* Faction reputation gain for Field Work
* Company reputation gain for most jobs
Gain experience by:
* Committing certain crimes
* Infiltration
* Studying at a university
* Working a relevant job at a company
* Doing Field work for a Faction

@ -200,52 +200,52 @@ Here's what mine showed at the time I made this::
--Root Access: YES, Required hacking skill: 1
--Number of open ports required to NUKE: 0
--RAM: 4.00GB
----zer0
------Root Access: NO, Required hacking skill: 75
------Number of open ports required to NUKE: 1
------RAM: 32.00GB
foodnstuff
--Root Access: NO, Required hacking skill: 1
--Number of open ports required to NUKE: 0
--RAM: 16.00GB
sigma-cosmetics
--Root Access: NO, Required hacking skill: 5
--Number of open ports required to NUKE: 0
--RAM: 16.00GB
joesguns
--Root Access: NO, Required hacking skill: 10
--Number of open ports required to NUKE: 0
--RAM: 16.00GB
----max-hardware
------Root Access: NO, Required hacking skill: 80
------Number of open ports required to NUKE: 1
------RAM: 32.00GB
----CSEC
------Root Access: NO, Required hacking skill: 54
------Number of open ports required to NUKE: 1
------RAM: 8.00GB
hong-fang-tea
--Root Access: NO, Required hacking skill: 30
--Number of open ports required to NUKE: 0
--RAM: 16.00GB
----nectar-net
------Root Access: NO, Required hacking skill: 20
------Number of open ports required to NUKE: 0
------RAM: 16.00GB
harakiri-sushi
--Root Access: NO, Required hacking skill: 40
--Number of open ports required to NUKE: 0
--RAM: 16.00GB
iron-gym
--Root Access: NO, Required hacking skill: 100
--Number of open ports required to NUKE: 1
@ -253,7 +253,6 @@ Here's what mine showed at the time I made this::
Take note of the following servers:
* |n00dles|
* |sigma-cosmetics|
* |joesguns|
* |nectar-net|
@ -807,8 +806,7 @@ startup script. Feel free to adjust it to your liking.
// Array of all servers that don't need any ports opened
// to gain root access. These have 16 GB of RAM
var servers0Port = ["n00dles",
"sigma-cosmetics",
var servers0Port = ["sigma-cosmetics",
"joesguns",
"nectar-net",
"hong-fang-tea",

@ -59,15 +59,14 @@ And the data in port 1 will look like::
.. warning:: In :ref:`netscriptjs`, do not trying writing base
`Promises <https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise>`_
to a port.
to a port.
**Port Handles**
WARNING: Port Handles only work in :ref:`netscriptjs`. They do not work in :ref:`netscript1`
The :js:func:`getPortHandle` Netscript function can be used to get a handle to a Netscript Port.
This handle allows you to access several new port-related functions and the
port's underlying data structure, which is just a JavaScript array. The functions are:
This handle allows you to access several new port-related functions. The functions are:
.. js:method:: NetscriptPort.writePort(data)
@ -111,22 +110,11 @@ port's underlying data structure, which is just a JavaScript array. The function
Clears all data from the port. Works the same as the Netscript function `clear`
.. js:attribute:: NetscriptPort.data
The Netscript port underlying data structure, which is just a Javascript array. All
valid Javascript Array methods can be called on this.
Port Handle Example::
port = getPortHandle(5);
back = port.data.pop(); //Get and remove last element in port
//Remove an element from the port
i = port.data.findIndex("foo");
if (i != -1) {
port.data.slice(i, 1);
}
//Wait for port data before reading
while(port.empty()) {
sleep(10000);

@ -2,16 +2,25 @@
const greenworks = require("./greenworks");
const log = require("electron-log");
function enableAchievementsInterval(window) {
async function enableAchievementsInterval(window) {
// If the Steam API could not be initialized on game start, we'll abort this.
if (global.greenworksError) return;
// This is backward but the game fills in an array called `document.achievements` and we retrieve it from
// here. Hey if it works it works.
const steamAchievements = greenworks.getAchievementNames();
log.debug(`All Steam achievements ${JSON.stringify(steamAchievements)}`);
const playerAchieved = (await Promise.all(steamAchievements.map(checkSteamAchievement))).filter(name => !!name);
log.debug(`Player has Steam achievements ${JSON.stringify(playerAchieved)}`);
const intervalID = setInterval(async () => {
try {
const playerAchievements = await window.webContents.executeJavaScript("document.achievements");
for (const ach of playerAchievements) {
if (!steamAchievements.includes(ach)) continue;
if (!steamAchievements.includes(ach)) continue; // Don't try activating achievements that don't exist Steam-side
if (playerAchieved.includes(ach)) continue; // Don't spam achievements that have already been recorded
log.info(`Granting Steam achievement ${ach}`);
greenworks.activateAchievement(ach, () => undefined);
playerAchieved.push(ach);
}
} catch (error) {
log.error(error);
@ -25,6 +34,15 @@ function enableAchievementsInterval(window) {
window.achievementsIntervalID = intervalID;
}
function checkSteamAchievement(name) {
return new Promise((resolve) => {
greenworks.getAchievement(name, playerHas => resolve(playerHas ? name : ""), err => {
log.warn(`Failed to get Steam achievement ${name} status: ${err}`);
resolve("");
});
});
}
function disableAchievementsInterval(window) {
if (window.achievementsIntervalID) {
clearInterval(window.achievementsIntervalID);

@ -6,6 +6,9 @@ const achievements = require("./achievements");
const menu = require("./menu");
const api = require("./api-server");
const cp = require("child_process");
const path = require("path");
const fs = require("fs");
const { fileURLToPath } = require("url");
const debug = process.argv.includes("--debug");
@ -24,15 +27,54 @@ async function createWindow(killall) {
window.show();
if (debug) window.webContents.openDevTools();
window.webContents.on("new-window", function (e, url) {
if (process.platform === "win32") {
cp.spawn("explorer", [url], { detached: true, stdio: "ignore" });
} else {
// make sure local urls stay in electron perimeter
if (url.substr(0, "file://".length) === "file://") {
return;
window.webContents.on("new-window", async function (e, url) {
// Let's make sure sure we have a proper url
let parsedUrl
try {
parsedUrl = new URL(url);
} catch (_) {
// This is an invalid url, let's just do nothing
log.warn(`Invalid url found: ${url}`)
e.preventDefault();
return;
}
// make sure local urls stay in electron perimeter
if (url.substr(0, "file://".length) === "file://") {
const requestedPath = fileURLToPath(url);
const appPath = path.parse(app.getAppPath());
const filePath = path.parse(requestedPath);
const isChild = filePath.dir.startsWith(appPath.dir);
// eslint-disable-next-line no-sync
const fileExists = fs.existsSync(requestedPath);
if (!isChild) {
// If we're not relative to our app's path let's abort
log.warn(`Requested path ${filePath.dir}${path.sep}${filePath.base} is not relative to the app: ${appPath.dir}${path.sep}${appPath.base}`)
e.preventDefault();
} else if (!fileExists) {
// If the file does not exist let's abort
log.warn(`Requested path ${filePath.dir}${path.sep}${filePath.base} does not exist`)
e.preventDefault();
}
return;
}
if (process.platform === "win32") {
// If we have parameters in the URL, explorer.exe won't register the URL and will open the file explorer instead.
let urlToOpen = parsedUrl.toString();
if (parsedUrl.search) {
log.log(`Cannot open a path with parameters: ${parsedUrl.search}`);
urlToOpen = urlToOpen.replace(parsedUrl.search, '');
// It would be possible to launch an URL with parameter using this, but it would mess up the process again...
// const escapedUri = parsedUrl.href.replace('&', '^&');
// cp.spawn("cmd.exe", ["/c", "start", escapedUri], { detached: true, stdio: "ignore" });
}
cp.spawn("explorer", [urlToOpen], { detached: true, stdio: "ignore" });
} else {
// and open every other protocols on the browser
utils.openExternal(url);
}

@ -16,10 +16,18 @@ process.on('uncaughtException', function () {
process.exit(1);
});
if (greenworks.init()) {
log.info("Steam API has been initialized.");
} else {
log.warn("Steam API has failed to initialize.");
// We want to fail gracefully if we cannot connect to Steam
try {
if (greenworks.init()) {
log.info("Steam API has been initialized.");
} else {
const error = "Steam API has failed to initialize.";
log.warn(error);
global.greenworksError = error;
}
} catch (ex) {
log.warn(ex.message);
global.greenworksError = ex.message;
}
function setStopProcessHandler(app, window, enabled) {
@ -113,4 +121,13 @@ app.whenReady().then(async () => {
} else {
startWindow(process.argv.includes("--no-scripts"));
}
if (global.greenworksError) {
dialog.showMessageBox({
title: 'Bitburner',
message: 'Could not connect to Steam',
detail: `${global.greenworksError}\n\nYou won't be able to receive achievements until this is resolved and you restart the game.`,
type: 'warning', buttons: ['OK']
});
}
});

@ -48,6 +48,11 @@
</script>
<style>
html, body {
margin: 0;
padding: 0;
height: 100%;
}
body {
background-color: black;
}

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [BitNodeMultipliers](./bitburner.bitnodemultipliers.md) &gt; [GangSoftcap](./bitburner.bitnodemultipliers.gangsoftcap.md)
## BitNodeMultipliers.GangSoftcap property
Influences the respect gain and money gain of your gang.
<b>Signature:</b>
```typescript
GangSoftcap: number;
```

@ -37,6 +37,7 @@ export interface BitNodeMultipliers
| [FactionWorkRepGain](./bitburner.bitnodemultipliers.factionworkrepgain.md) | number | Influences how much rep the player gains when performing work for a faction. |
| [FourSigmaMarketDataApiCost](./bitburner.bitnodemultipliers.foursigmamarketdataapicost.md) | number | Influences how much it costs to unlock the stock market's 4S Market Data API |
| [FourSigmaMarketDataCost](./bitburner.bitnodemultipliers.foursigmamarketdatacost.md) | number | Influences how much it costs to unlock the stock market's 4S Market Data (NOT API) |
| [GangSoftcap](./bitburner.bitnodemultipliers.gangsoftcap.md) | number | Influences the respect gain and money gain of your gang. |
| [HackExpGain](./bitburner.bitnodemultipliers.hackexpgain.md) | number | Influences the experienced gained when hacking a server. |
| [HackingLevelMultiplier](./bitburner.bitnodemultipliers.hackinglevelmultiplier.md) | number | Influences how quickly the player's hacking level (not experience) scales |
| [HacknetNodeMoney](./bitburner.bitnodemultipliers.hacknetnodemoney.md) | number | Influences how much money is produced by Hacknet Nodes and the hash rate of Hacknet Servers (unlocked in BitNode-9) |
@ -47,12 +48,17 @@ export interface BitNodeMultipliers
| [PurchasedServerCost](./bitburner.bitnodemultipliers.purchasedservercost.md) | number | Influence how much it costs to purchase a server |
| [PurchasedServerLimit](./bitburner.bitnodemultipliers.purchasedserverlimit.md) | number | Influences the maximum number of purchased servers you can have |
| [PurchasedServerMaxRam](./bitburner.bitnodemultipliers.purchasedservermaxram.md) | number | Influences the maximum allowed RAM for a purchased server |
| [PurchasedServerSoftCap](./bitburner.bitnodemultipliers.purchasedserversoftcap.md) | number | Influences cost of any purchased server at or above 128GB |
| [RepToDonateToFaction](./bitburner.bitnodemultipliers.reptodonatetofaction.md) | number | Influences the minimum favor the player must have with a faction before they can donate to gain rep. |
| [ScriptHackMoney](./bitburner.bitnodemultipliers.scripthackmoney.md) | number | Influences how much money can be stolen from a server when a script performs a hack against it. |
| [ScriptHackMoney](./bitburner.bitnodemultipliers.scripthackmoney.md) | number | Influences how much the money on a server can be reduced when a script performs a hack against it. |
| [ScriptHackMoneyGain](./bitburner.bitnodemultipliers.scripthackmoneygain.md) | number | Influences how much of the money stolen by a scripted hack will be added to the player's money. |
| [ServerGrowthRate](./bitburner.bitnodemultipliers.servergrowthrate.md) | number | Influences the growth percentage per cycle against a server. |
| [ServerMaxMoney](./bitburner.bitnodemultipliers.servermaxmoney.md) | number | Influences the maxmimum money that a server can grow to. |
| [ServerStartingMoney](./bitburner.bitnodemultipliers.serverstartingmoney.md) | number | Influences the initial money that a server starts with. |
| [ServerStartingSecurity](./bitburner.bitnodemultipliers.serverstartingsecurity.md) | number | Influences the initial security level (hackDifficulty) of a server. |
| [ServerWeakenRate](./bitburner.bitnodemultipliers.serverweakenrate.md) | number | Influences the weaken amount per invocation against a server. |
| [StaneksGiftExtraSize](./bitburner.bitnodemultipliers.staneksgiftextrasize.md) | number | Influences the size of the gift |
| [StaneksGiftPowerMultiplier](./bitburner.bitnodemultipliers.staneksgiftpowermultiplier.md) | number | Influences the power of the gift |
| [StrengthLevelMultiplier](./bitburner.bitnodemultipliers.strengthlevelmultiplier.md) | number | Influences how quickly the player's strength level (not exp) scales |
| [WorldDaemonDifficulty](./bitburner.bitnodemultipliers.worlddaemondifficulty.md) | number | Influences the hacking skill required to backdoor the world daemon. |

@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [BitNodeMultipliers](./bitburner.bitnodemultipliers.md) &gt; [PurchasedServerSoftCap](./bitburner.bitnodemultipliers.purchasedserversoftcap.md)
## BitNodeMultipliers.PurchasedServerSoftCap property
Influences cost of any purchased server at or above 128GB
<b>Signature:</b>
```typescript
PurchasedServerSoftCap: number;
```

@ -4,7 +4,7 @@
## BitNodeMultipliers.ScriptHackMoney property
Influences how much money can be stolen from a server when a script performs a hack against it.
Influences how much the money on a server can be reduced when a script performs a hack against it.
<b>Signature:</b>

@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [BitNodeMultipliers](./bitburner.bitnodemultipliers.md) &gt; [ScriptHackMoneyGain](./bitburner.bitnodemultipliers.scripthackmoneygain.md)
## BitNodeMultipliers.ScriptHackMoneyGain property
Influences how much of the money stolen by a scripted hack will be added to the player's money.
<b>Signature:</b>
```typescript
ScriptHackMoneyGain: number;
```

@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [BitNodeMultipliers](./bitburner.bitnodemultipliers.md) &gt; [StaneksGiftExtraSize](./bitburner.bitnodemultipliers.staneksgiftextrasize.md)
## BitNodeMultipliers.StaneksGiftExtraSize property
Influences the size of the gift
<b>Signature:</b>
```typescript
StaneksGiftExtraSize: number;
```

@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [BitNodeMultipliers](./bitburner.bitnodemultipliers.md) &gt; [StaneksGiftPowerMultiplier](./bitburner.bitnodemultipliers.staneksgiftpowermultiplier.md)
## BitNodeMultipliers.StaneksGiftPowerMultiplier property
Influences the power of the gift
<b>Signature:</b>
```typescript
StaneksGiftPowerMultiplier: number;
```

@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [BitNodeMultipliers](./bitburner.bitnodemultipliers.md) &gt; [WorldDaemonDifficulty](./bitburner.bitnodemultipliers.worlddaemondifficulty.md)
## BitNodeMultipliers.WorldDaemonDifficulty property
Influences the hacking skill required to backdoor the world daemon.
<b>Signature:</b>
```typescript
WorldDaemonDifficulty: number;
```

@ -0,0 +1,12 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [FilenameOrPID](./bitburner.filenameorpid.md)
## FilenameOrPID type
<b>Signature:</b>
```typescript
type FilenameOrPID = number | string;
```

@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [HacknetNodeConstants](./bitburner.hacknetnodeconstants.md) &gt; [BaseCost](./bitburner.hacknetnodeconstants.basecost.md)
## HacknetNodeConstants.BaseCost property
Base cost for a new node
<b>Signature:</b>
```typescript
BaseCost: number;
```

@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [HacknetNodeConstants](./bitburner.hacknetnodeconstants.md) &gt; [CoreBaseCost](./bitburner.hacknetnodeconstants.corebasecost.md)
## HacknetNodeConstants.CoreBaseCost property
Base cost to increase cores
<b>Signature:</b>
```typescript
CoreBaseCost: number;
```

@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [HacknetNodeConstants](./bitburner.hacknetnodeconstants.md) &gt; [LevelBaseCost](./bitburner.hacknetnodeconstants.levelbasecost.md)
## HacknetNodeConstants.LevelBaseCost property
Base cost per level
<b>Signature:</b>
```typescript
LevelBaseCost: number;
```

@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [HacknetNodeConstants](./bitburner.hacknetnodeconstants.md) &gt; [MaxCores](./bitburner.hacknetnodeconstants.maxcores.md)
## HacknetNodeConstants.MaxCores property
Max number of cores
<b>Signature:</b>
```typescript
MaxCores: number;
```

@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [HacknetNodeConstants](./bitburner.hacknetnodeconstants.md) &gt; [MaxLevel](./bitburner.hacknetnodeconstants.maxlevel.md)
## HacknetNodeConstants.MaxLevel property
Max node level
<b>Signature:</b>
```typescript
MaxLevel: number;
```

@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [HacknetNodeConstants](./bitburner.hacknetnodeconstants.md) &gt; [MaxRam](./bitburner.hacknetnodeconstants.maxram.md)
## HacknetNodeConstants.MaxRam property
Max amount of RAM in GB
<b>Signature:</b>
```typescript
MaxRam: number;
```

@ -0,0 +1,31 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [HacknetNodeConstants](./bitburner.hacknetnodeconstants.md)
## HacknetNodeConstants interface
Hacknet node related constants
<b>Signature:</b>
```typescript
export interface HacknetNodeConstants
```
## Properties
| Property | Type | Description |
| --- | --- | --- |
| [BaseCost](./bitburner.hacknetnodeconstants.basecost.md) | number | Base cost for a new node |
| [CoreBaseCost](./bitburner.hacknetnodeconstants.corebasecost.md) | number | Base cost to increase cores |
| [LevelBaseCost](./bitburner.hacknetnodeconstants.levelbasecost.md) | number | Base cost per level |
| [MaxCores](./bitburner.hacknetnodeconstants.maxcores.md) | number | Max number of cores |
| [MaxLevel](./bitburner.hacknetnodeconstants.maxlevel.md) | number | Max node level |
| [MaxRam](./bitburner.hacknetnodeconstants.maxram.md) | number | Max amount of RAM in GB |
| [MoneyGainPerLevel](./bitburner.hacknetnodeconstants.moneygainperlevel.md) | number | Amount of money gained per level |
| [PurchaseNextMult](./bitburner.hacknetnodeconstants.purchasenextmult.md) | number | Multiplier to purchase new node |
| [RamBaseCost](./bitburner.hacknetnodeconstants.rambasecost.md) | number | Base cost to incrase RAM |
| [UpgradeCoreMult](./bitburner.hacknetnodeconstants.upgradecoremult.md) | number | Multiplier to increase cores |
| [UpgradeLevelMult](./bitburner.hacknetnodeconstants.upgradelevelmult.md) | number | Multiplier to increase node level |
| [UpgradeRamMult](./bitburner.hacknetnodeconstants.upgraderammult.md) | number | Multiplier to increase RAM |

@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [HacknetNodeConstants](./bitburner.hacknetnodeconstants.md) &gt; [MoneyGainPerLevel](./bitburner.hacknetnodeconstants.moneygainperlevel.md)
## HacknetNodeConstants.MoneyGainPerLevel property
Amount of money gained per level
<b>Signature:</b>
```typescript
MoneyGainPerLevel: number;
```

@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [HacknetNodeConstants](./bitburner.hacknetnodeconstants.md) &gt; [PurchaseNextMult](./bitburner.hacknetnodeconstants.purchasenextmult.md)
## HacknetNodeConstants.PurchaseNextMult property
Multiplier to purchase new node
<b>Signature:</b>
```typescript
PurchaseNextMult: number;
```

@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [HacknetNodeConstants](./bitburner.hacknetnodeconstants.md) &gt; [RamBaseCost](./bitburner.hacknetnodeconstants.rambasecost.md)
## HacknetNodeConstants.RamBaseCost property
Base cost to incrase RAM
<b>Signature:</b>
```typescript
RamBaseCost: number;
```

@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [HacknetNodeConstants](./bitburner.hacknetnodeconstants.md) &gt; [UpgradeCoreMult](./bitburner.hacknetnodeconstants.upgradecoremult.md)
## HacknetNodeConstants.UpgradeCoreMult property
Multiplier to increase cores
<b>Signature:</b>
```typescript
UpgradeCoreMult: number;
```

@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [HacknetNodeConstants](./bitburner.hacknetnodeconstants.md) &gt; [UpgradeLevelMult](./bitburner.hacknetnodeconstants.upgradelevelmult.md)
## HacknetNodeConstants.UpgradeLevelMult property
Multiplier to increase node level
<b>Signature:</b>
```typescript
UpgradeLevelMult: number;
```

@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [HacknetNodeConstants](./bitburner.hacknetnodeconstants.md) &gt; [UpgradeRamMult](./bitburner.hacknetnodeconstants.upgraderammult.md)
## HacknetNodeConstants.UpgradeRamMult property
Multiplier to increase RAM
<b>Signature:</b>
```typescript
UpgradeRamMult: number;
```

@ -9,11 +9,11 @@ All constants used by the game.
<b>Signature:</b>
```typescript
constants(): number;
constants(): HacknetNodeConstants;
```
<b>Returns:</b>
number
[HacknetNodeConstants](./bitburner.hacknetnodeconstants.md)
An object with all hacknet node constants used by the game.

@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [HacknetServerConstants](./bitburner.hacknetserverconstants.md) &gt; [BaseCost](./bitburner.hacknetserverconstants.basecost.md)
## HacknetServerConstants.BaseCost property
Base cost for a new server
<b>Signature:</b>
```typescript
BaseCost: number;
```

@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [HacknetServerConstants](./bitburner.hacknetserverconstants.md) &gt; [CacheBaseCost](./bitburner.hacknetserverconstants.cachebasecost.md)
## HacknetServerConstants.CacheBaseCost property
Base cost to upgrade cache
<b>Signature:</b>
```typescript
CacheBaseCost: number;
```

@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [HacknetServerConstants](./bitburner.hacknetserverconstants.md) &gt; [CoreBaseCost](./bitburner.hacknetserverconstants.corebasecost.md)
## HacknetServerConstants.CoreBaseCost property
Base cost to increase cores
<b>Signature:</b>
```typescript
CoreBaseCost: number;
```

@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [HacknetServerConstants](./bitburner.hacknetserverconstants.md) &gt; [HashesPerLevel](./bitburner.hacknetserverconstants.hashesperlevel.md)
## HacknetServerConstants.HashesPerLevel property
Number of hashes calculated per level
<b>Signature:</b>
```typescript
HashesPerLevel: number;
```

@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [HacknetServerConstants](./bitburner.hacknetserverconstants.md) &gt; [MaxCache](./bitburner.hacknetserverconstants.maxcache.md)
## HacknetServerConstants.MaxCache property
Max cache size
<b>Signature:</b>
```typescript
MaxCache: number;
```

@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [HacknetServerConstants](./bitburner.hacknetserverconstants.md) &gt; [MaxCores](./bitburner.hacknetserverconstants.maxcores.md)
## HacknetServerConstants.MaxCores property
Max number of cores
<b>Signature:</b>
```typescript
MaxCores: number;
```

@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [HacknetServerConstants](./bitburner.hacknetserverconstants.md) &gt; [MaxLevel](./bitburner.hacknetserverconstants.maxlevel.md)
## HacknetServerConstants.MaxLevel property
Max level for a server
<b>Signature:</b>
```typescript
MaxLevel: number;
```

@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [HacknetServerConstants](./bitburner.hacknetserverconstants.md) &gt; [MaxRam](./bitburner.hacknetserverconstants.maxram.md)
## HacknetServerConstants.MaxRam property
Max amount of RAM in GB
<b>Signature:</b>
```typescript
MaxRam: number;
```

@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [HacknetServerConstants](./bitburner.hacknetserverconstants.md) &gt; [MaxServers](./bitburner.hacknetserverconstants.maxservers.md)
## HacknetServerConstants.MaxServers property
Max number of servers
<b>Signature:</b>
```typescript
MaxServers: number;
```

@ -0,0 +1,34 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [HacknetServerConstants](./bitburner.hacknetserverconstants.md)
## HacknetServerConstants interface
Hacknet server related constants
<b>Signature:</b>
```typescript
export interface HacknetServerConstants
```
## Properties
| Property | Type | Description |
| --- | --- | --- |
| [BaseCost](./bitburner.hacknetserverconstants.basecost.md) | number | Base cost for a new server |
| [CacheBaseCost](./bitburner.hacknetserverconstants.cachebasecost.md) | number | Base cost to upgrade cache |
| [CoreBaseCost](./bitburner.hacknetserverconstants.corebasecost.md) | number | Base cost to increase cores |
| [HashesPerLevel](./bitburner.hacknetserverconstants.hashesperlevel.md) | number | Number of hashes calculated per level |
| [MaxCache](./bitburner.hacknetserverconstants.maxcache.md) | number | Max cache size |
| [MaxCores](./bitburner.hacknetserverconstants.maxcores.md) | number | Max number of cores |
| [MaxLevel](./bitburner.hacknetserverconstants.maxlevel.md) | number | Max level for a server |
| [MaxRam](./bitburner.hacknetserverconstants.maxram.md) | number | Max amount of RAM in GB |
| [MaxServers](./bitburner.hacknetserverconstants.maxservers.md) | number | Max number of servers |
| [PurchaseMult](./bitburner.hacknetserverconstants.purchasemult.md) | number | Multiplier to purchase a new server |
| [RamBaseCost](./bitburner.hacknetserverconstants.rambasecost.md) | number | Base cost to increase RAM |
| [UpgradeCacheMult](./bitburner.hacknetserverconstants.upgradecachemult.md) | number | Multiplier to upgrade cache |
| [UpgradeCoreMult](./bitburner.hacknetserverconstants.upgradecoremult.md) | number | Multiplier to increase cores |
| [UpgradeLevelMult](./bitburner.hacknetserverconstants.upgradelevelmult.md) | number | Multiplier to increase server level |
| [UpgradeRamMult](./bitburner.hacknetserverconstants.upgraderammult.md) | number | Multiplier to increase RAM |

@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [HacknetServerConstants](./bitburner.hacknetserverconstants.md) &gt; [PurchaseMult](./bitburner.hacknetserverconstants.purchasemult.md)
## HacknetServerConstants.PurchaseMult property
Multiplier to purchase a new server
<b>Signature:</b>
```typescript
PurchaseMult: number;
```

@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [HacknetServerConstants](./bitburner.hacknetserverconstants.md) &gt; [RamBaseCost](./bitburner.hacknetserverconstants.rambasecost.md)
## HacknetServerConstants.RamBaseCost property
Base cost to increase RAM
<b>Signature:</b>
```typescript
RamBaseCost: number;
```

@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [HacknetServerConstants](./bitburner.hacknetserverconstants.md) &gt; [UpgradeCacheMult](./bitburner.hacknetserverconstants.upgradecachemult.md)
## HacknetServerConstants.UpgradeCacheMult property
Multiplier to upgrade cache
<b>Signature:</b>
```typescript
UpgradeCacheMult: number;
```

@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [HacknetServerConstants](./bitburner.hacknetserverconstants.md) &gt; [UpgradeCoreMult](./bitburner.hacknetserverconstants.upgradecoremult.md)
## HacknetServerConstants.UpgradeCoreMult property
Multiplier to increase cores
<b>Signature:</b>
```typescript
UpgradeCoreMult: number;
```

@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [HacknetServerConstants](./bitburner.hacknetserverconstants.md) &gt; [UpgradeLevelMult](./bitburner.hacknetserverconstants.upgradelevelmult.md)
## HacknetServerConstants.UpgradeLevelMult property
Multiplier to increase server level
<b>Signature:</b>
```typescript
UpgradeLevelMult: number;
```

@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [HacknetServerConstants](./bitburner.hacknetserverconstants.md) &gt; [UpgradeRamMult](./bitburner.hacknetserverconstants.upgraderammult.md)
## HacknetServerConstants.UpgradeRamMult property
Multiplier to increase RAM
<b>Signature:</b>
```typescript
UpgradeRamMult: number;
```

@ -9,11 +9,11 @@ All constants used by the game.
<b>Signature:</b>
```typescript
constants(): any;
constants(): HacknetServerConstants;
```
<b>Returns:</b>
any
[HacknetServerConstants](./bitburner.hacknetserverconstants.md)
An object with all hacknet server constants used by the game.

@ -4,6 +4,13 @@
## bitburner package
## Enumerations
| Enumeration | Description |
| --- | --- |
| [OrderTypes](./bitburner.ordertypes.md) | |
| [PositionTypes](./bitburner.positiontypes.md) | |
## Interfaces
| Interface | Description |
@ -41,9 +48,12 @@
| [HackingMultipliers](./bitburner.hackingmultipliers.md) | Hack related multipliers. |
| [Hacknet](./bitburner.hacknet.md) | Hacknet API |
| [HacknetMultipliers](./bitburner.hacknetmultipliers.md) | Hacknet related multipliers. |
| [HacknetNodeConstants](./bitburner.hacknetnodeconstants.md) | Hacknet node related constants |
| [HacknetNodesFormulas](./bitburner.hacknetnodesformulas.md) | Hacknet Node formulas |
| [HacknetServerConstants](./bitburner.hacknetserverconstants.md) | Hacknet server related constants |
| [HacknetServersFormulas](./bitburner.hacknetserversformulas.md) | Hacknet Server formulas |
| [Material](./bitburner.material.md) | Material in a warehouse |
| [NetscriptPort](./bitburner.netscriptport.md) | Object representing a port. A port is a serialized queue. |
| [NodeStats](./bitburner.nodestats.md) | Object representing all the values related to a hacknet node. |
| [NS](./bitburner.ns.md) | Collection of all functions passed to scripts |
| [Office](./bitburner.office.md) | Office for a division in a city. |
@ -63,10 +73,16 @@
| [SleeveWorkGains](./bitburner.sleeveworkgains.md) | |
| [SourceFileLvl](./bitburner.sourcefilelvl.md) | |
| [Stanek](./bitburner.stanek.md) | Stanek's Gift API. |
| [StockOrder](./bitburner.stockorder.md) | Return value of [getOrders](./bitburner.tix.getorders.md) |
| [StockOrder](./bitburner.stockorder.md) | Return value of [getOrders](./bitburner.tix.getorders.md)<!-- -->Keys are stock symbols, properties are arrays of [StockOrderObject](./bitburner.stockorderobject.md) |
| [StockOrderObject](./bitburner.stockorderobject.md) | Value in map of [StockOrder](./bitburner.stockorder.md) |
| [TIX](./bitburner.tix.md) | Stock market API |
| [UserInterface](./bitburner.userinterface.md) | User Interface API. |
| [Warehouse](./bitburner.warehouse.md) | Warehouse for a division in a city |
| [WarehouseAPI](./bitburner.warehouseapi.md) | Corporation Warehouse API |
## Type Aliases
| Type Alias | Description |
| --- | --- |
| [FilenameOrPID](./bitburner.filenameorpid.md) | |

@ -0,0 +1,21 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [NetscriptPort](./bitburner.netscriptport.md) &gt; [clear](./bitburner.netscriptport.clear.md)
## NetscriptPort.clear() method
Empties all data from the port.
<b>Signature:</b>
```typescript
clear(): void;
```
<b>Returns:</b>
void
## Remarks
RAM cost: 0 GB

@ -0,0 +1,23 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [NetscriptPort](./bitburner.netscriptport.md) &gt; [empty](./bitburner.netscriptport.empty.md)
## NetscriptPort.empty() method
Check if the port is empty.
<b>Signature:</b>
```typescript
empty(): boolean;
```
<b>Returns:</b>
boolean
true if the port is empty, otherwise false
## Remarks
RAM cost: 0 GB

@ -0,0 +1,23 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [NetscriptPort](./bitburner.netscriptport.md) &gt; [full](./bitburner.netscriptport.full.md)
## NetscriptPort.full() method
Check if the port is full.
<b>Signature:</b>
```typescript
full(): boolean;
```
<b>Returns:</b>
boolean
true if the port is full, otherwise false
## Remarks
RAM cost: 0 GB

@ -0,0 +1,26 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [NetscriptPort](./bitburner.netscriptport.md)
## NetscriptPort interface
Object representing a port. A port is a serialized queue.
<b>Signature:</b>
```typescript
export interface NetscriptPort
```
## Methods
| Method | Description |
| --- | --- |
| [clear()](./bitburner.netscriptport.clear.md) | Empties all data from the port. |
| [empty()](./bitburner.netscriptport.empty.md) | Check if the port is empty. |
| [full()](./bitburner.netscriptport.full.md) | Check if the port is full. |
| [peek()](./bitburner.netscriptport.peek.md) | Retrieve the first element from the port without removing it. |
| [read()](./bitburner.netscriptport.read.md) | Shift an element out of the port. |
| [tryWrite(value)](./bitburner.netscriptport.trywrite.md) | Attempt to write data to the port. |
| [write(value)](./bitburner.netscriptport.write.md) | Write data to a port. |

@ -0,0 +1,25 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [NetscriptPort](./bitburner.netscriptport.md) &gt; [peek](./bitburner.netscriptport.peek.md)
## NetscriptPort.peek() method
Retrieve the first element from the port without removing it.
<b>Signature:</b>
```typescript
peek(): string | number;
```
<b>Returns:</b>
string \| number
the data read
## Remarks
RAM cost: 0 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.

@ -0,0 +1,25 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [NetscriptPort](./bitburner.netscriptport.md) &gt; [read](./bitburner.netscriptport.read.md)
## NetscriptPort.read() method
Shift an element out of the port.
<b>Signature:</b>
```typescript
read(): string | number;
```
<b>Returns:</b>
string \| number
the data read.
## Remarks
RAM cost: 0 GB
This function will remove the first element from the port and return it. If the port is empty, then the string “NULL PORT DATA” will be returned.

@ -0,0 +1,30 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [NetscriptPort](./bitburner.netscriptport.md) &gt; [tryWrite](./bitburner.netscriptport.trywrite.md)
## NetscriptPort.tryWrite() method
Attempt to write data to the port.
<b>Signature:</b>
```typescript
tryWrite(value: string | number): boolean;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| value | string \| number | |
<b>Returns:</b>
boolean
True if the data was added to the port, false if the port was full
## Remarks
RAM cost: 0 GB

@ -0,0 +1,30 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [NetscriptPort](./bitburner.netscriptport.md) &gt; [write](./bitburner.netscriptport.write.md)
## NetscriptPort.write() method
Write data to a port.
<b>Signature:</b>
```typescript
write(value: string | number): null | string | number;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| value | string \| number | |
<b>Returns:</b>
null \| string \| number
The data popped off the queue if it was full.
## Remarks
RAM cost: 0 GB

@ -22,8 +22,8 @@ export interface NodeStats
| [level](./bitburner.nodestats.level.md) | number | Node's level |
| [name](./bitburner.nodestats.name.md) | string | Node's name |
| [production](./bitburner.nodestats.production.md) | number | Node's production per second |
| [ram](./bitburner.nodestats.ram.md) | number | Node's RAM |
| [ramUsed](./bitburner.nodestats.ramused.md) | number | Node's used RAM |
| [ram](./bitburner.nodestats.ram.md) | number | Node's RAM (GB) |
| [ramUsed](./bitburner.nodestats.ramused.md) | number | Node's used RAM (GB) |
| [timeOnline](./bitburner.nodestats.timeonline.md) | number | Number of seconds since Node has been purchased |
| [totalProduction](./bitburner.nodestats.totalproduction.md) | number | Total number of money Node has produced |

@ -4,7 +4,7 @@
## NodeStats.ram property
Node's RAM
Node's RAM (GB)
<b>Signature:</b>

@ -4,7 +4,7 @@
## NodeStats.ramUsed property
Node's used RAM
Node's used RAM (GB)
<b>Signature:</b>

@ -9,7 +9,7 @@ Get all data on a port.
<b>Signature:</b>
```typescript
getPortHandle(port: number): any[];
getPortHandle(port: number): NetscriptPort;
```
## Parameters
@ -20,9 +20,7 @@ getPortHandle(port: number): any[];
<b>Returns:</b>
any\[\]
Data in the specified port.
[NetscriptPort](./bitburner.netscriptport.md)
## Remarks

@ -16,7 +16,7 @@ getPurchasedServerCost(ram: number): number;
| Parameter | Type | Description |
| --- | --- | --- |
| ram | number | Amount of RAM of a potential purchased server. Must be a power of 2 (2, 4, 8, 16, etc.). Maximum value of 1048576 (2^20). |
| ram | number | Amount of RAM of a potential purchased server, in GB. Must be a power of 2 (2, 4, 8, 16, etc.). Maximum value of 1048576 (2^20). |
<b>Returns:</b>

@ -15,7 +15,7 @@ getPurchasedServerMaxRam(): number;
number
Returns the maximum RAM that a purchased server can have.
Returns the maximum RAM (in GB) that a purchased server can have.
## Remarks

@ -9,16 +9,16 @@ Get general info about a running script.
<b>Signature:</b>
```typescript
getRunningScript(filename?: string | number, hostname?: string, ...args: (string | number)[]): RunningScript;
getRunningScript(filename?: FilenameOrPID, hostname?: string, ...args: (string | number)[]): RunningScript;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| filename | string \| number | |
| hostname | string | |
| args | (string \| number)\[\] | |
| 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 |
<b>Returns:</b>
@ -30,5 +30,5 @@ info about a running script
RAM cost: 0.3 GB
Running with no args returns curent script.
Running with no args returns curent script. If you use a PID as the first parameter, the hostname and args parameters are unnecessary.

@ -23,7 +23,7 @@ getScriptRam(script: string, host?: string): number;
number
Amount of RAM required to run the specified script on the target server, and 0 if the script does not exist.
Amount of RAM (in GB) required to run the specified script on the target server, and 0 if the script does not exist.
## Remarks

@ -22,7 +22,7 @@ getServerMaxRam(host: string): number;
number
max ram
max ram (GB)
## Remarks

@ -25,7 +25,7 @@ getServerRam(host: string): [number, number];
\[number, number\]
Array with total and used memory on the specified server.
Array with total and used memory on the specified server, in GB.
## Remarks

@ -22,7 +22,7 @@ getServerUsedRam(host: string): number;
number
used ram
used ram (GB)
## Remarks

@ -9,14 +9,14 @@ Check if a script is running.
<b>Signature:</b>
```typescript
isRunning(script: string, host: string, ...args: string[]): boolean;
isRunning(script: FilenameOrPID, host: string, ...args: string[]): boolean;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| script | string | Filename of script to check. This is case-sensitive. |
| 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. |
@ -30,7 +30,7 @@ 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.
Returns a boolean indicating whether the specified script is running on the target server. If you use a PID instead of a filename, the hostname and args parameters are unnecessary. Remember that a script is uniquely identified by both its name and its arguments.
## Example 1

@ -125,6 +125,7 @@ export async function main(ns) {
| [kill(script, host, args)](./bitburner.ns.kill_1.md) | |
| [killall(host)](./bitburner.ns.killall.md) | Terminate all scripts on a server. |
| [ls(host, grep)](./bitburner.ns.ls.md) | List files on a server. |
| [mv(host, source, destination)](./bitburner.ns.mv.md) | Move a file on the target 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. |
@ -138,7 +139,8 @@ export async function main(ns) {
| [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)](./bitburner.ns.scan.md) | Get the list of servers connected to a server. |
| [scp(files, source, destination)](./bitburner.ns.scp.md) | Copy file between servers. |
| [scp(files, destination)](./bitburner.ns.scp.md) | Copy file between servers. |
| [scp(files, source, destination)](./bitburner.ns.scp_1.md) | |
| [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. |

@ -0,0 +1,38 @@
<!-- 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; [mv](./bitburner.ns.mv.md)
## NS.mv() method
Move a file on the target server.
<b>Signature:</b>
```typescript
mv(host: string, source: string, destination: string): void;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| host | string | Host of target server. |
| source | string | Filename of the source file. |
| destination | string | Filename of the destination file. |
<b>Returns:</b>
void
## Remarks
RAM cost: 0 GB
NS2 exclusive
Move the source file to the specified destination on the target server.
This command only works for scripts and text files (.txt). It cannot, however, be used to convert from script to text file, or vice versa.
This function can also be used to rename files.

@ -17,7 +17,7 @@ purchaseServer(hostname: string, ram: number): string;
| Parameter | Type | Description |
| --- | --- | --- |
| hostname | string | Host of the purchased server. |
| ram | number | Amount of RAM of the purchased server. Must be a power of 2 (2, 4, 8, 16, etc.). Maximum value of 1048576 (2^20). |
| ram | number | Amount of RAM of the purchased server, in GB. Must be a power of 2 (2, 4, 8, 16, etc.). Maximum value of 1048576 (2^20). |
<b>Returns:</b>

@ -16,19 +16,19 @@ read(handle: string): any;
| Parameter | Type | Description |
| --- | --- | --- |
| handle | string | Port or text file to read from. |
| handle | string | Filename to read from. |
<b>Returns:</b>
any
Data in the specified text file or port.
Data in the specified text file.
## Remarks
RAM cost: 0 GB
This function is used to read data from a port or from a text file (.txt).
This function is used to read data from a text file (.txt).
This function will return the data in the specified text file. If the text file does not exist, an empty string will be returned.

@ -9,7 +9,7 @@ Copy file between servers.
<b>Signature:</b>
```typescript
scp(files: string | string[], source: string, destination: string): Promise<boolean>;
scp(files: string | string[], destination: string): Promise<boolean>;
```
## Parameters
@ -17,7 +17,6 @@ scp(files: string | string[], source: string, destination: string): Promise<bool
| Parameter | Type | Description |
| --- | --- | --- |
| files | string \| string\[\] | Filename or an array of filenames of script/literature files to copy. |
| source | string | Host of the source server, which is the server from which the file will be copied. This argument is optional and if its omitted the source will be the current server. |
| destination | string | Host of the destination server, which is the server to which the file will be copied. |
<b>Returns:</b>

@ -0,0 +1,24 @@
<!-- 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; [scp](./bitburner.ns.scp_1.md)
## NS.scp() method
<b>Signature:</b>
```typescript
scp(files: string | string[], source: string, destination: string): Promise<boolean>;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| files | string \| string\[\] | |
| source | string | |
| destination | string | |
<b>Returns:</b>
Promise&lt;boolean&gt;

@ -9,7 +9,7 @@ Format a string.
<b>Signature:</b>
```typescript
sprintf(format: string, ...args: string[]): string;
sprintf(format: string, ...args: any[]): string;
```
## Parameters
@ -17,7 +17,7 @@ sprintf(format: string, ...args: string[]): string;
| Parameter | Type | Description |
| --- | --- | --- |
| format | string | String to format. |
| args | string\[\] | Formating arguments. |
| args | any\[\] | Formating arguments. |
<b>Returns:</b>

@ -9,14 +9,14 @@ Open the tail window of a script.
<b>Signature:</b>
```typescript
tail(fn?: string, host?: string, ...args: any[]): void;
tail(fn?: FilenameOrPID, host?: string, ...args: any[]): void;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| fn | string | Optional. Filename of the script being tailed. If omitted, the current script is tailed. |
| 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. |

@ -9,7 +9,7 @@ Queue a toast (bottom-right notification).
<b>Signature:</b>
```typescript
toast(msg: any, variant?: string, duration?: number): void;
toast(msg: any, variant?: string, duration?: number | null): void;
```
## Parameters
@ -18,7 +18,7 @@ toast(msg: any, variant?: string, duration?: number): void;
| --- | --- | --- |
| msg | any | Message in the toast. |
| variant | string | Type of toast, must be one of success, info, warning, error. Defaults to success. |
| duration | number | Duration of toast in ms, defaults to 2000 |
| duration | number \| null | Duration of toast in ms. Can also be <code>null</code> to create a persistent toast. Defaults to 2000 |
<b>Returns:</b>

@ -9,7 +9,7 @@ Format a string with an array of arguments.
<b>Signature:</b>
```typescript
vsprintf(format: string, args: string[]): string;
vsprintf(format: string, args: any[]): string;
```
## Parameters
@ -17,7 +17,7 @@ vsprintf(format: string, args: string[]): string;
| Parameter | Type | Description |
| --- | --- | --- |
| format | string | String to format. |
| args | string\[\] | Formating arguments. |
| args | any\[\] | Formating arguments. |
<b>Returns:</b>

@ -16,7 +16,7 @@ write(handle: string, data?: string[] | number | string, mode?: "w" | "a"): Prom
| Parameter | Type | Description |
| --- | --- | --- |
| handle | string | Port or text file that will be written to. |
| handle | string | Filename of the text file that will be written to. |
| data | string\[\] \| number \| string | Data to write. |
| mode | "w" \| "a" | Defines the write mode. Only valid when writing to text files. |
@ -28,7 +28,7 @@ Promise&lt;void&gt;
RAM cost: 0 GB
This function can be used to either write data to a text file (.txt).
This function can be used to write data to a text file (.txt).
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.

@ -0,0 +1,22 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [OrderTypes](./bitburner.ordertypes.md)
## OrderTypes enum
<b>Signature:</b>
```typescript
export enum OrderTypes
```
## Enumeration Members
| Member | Value | Description |
| --- | --- | --- |
| LimitBuy | <code>&quot;Limit Buy Order&quot;</code> | |
| LimitSell | <code>&quot;Limit Sell Order&quot;</code> | |
| StopBuy | <code>&quot;Stop Buy Order&quot;</code> | |
| StopSell | <code>&quot;Stop Sell Order&quot;</code> | |

@ -0,0 +1,20 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [PositionTypes](./bitburner.positiontypes.md)
## PositionTypes enum
<b>Signature:</b>
```typescript
export enum PositionTypes
```
## Enumeration Members
| Member | Value | Description |
| --- | --- | --- |
| Long | <code>&quot;L&quot;</code> | |
| Short | <code>&quot;S&quot;</code> | |

@ -4,7 +4,7 @@
## Singularity.applyToCompany() method
SF4.2 - Apply for a job at a company.
Apply for a job at a company.
<b>Signature:</b>
@ -27,7 +27,7 @@ True if the player successfully get a job/promotion, and false otherwise.
## Remarks
RAM cost: 3 GB
RAM cost: 3 GB \* 16/4/1
This function will automatically try to apply to the specified company for a position in the specified field. This function can also be used to apply for promotions by specifying the company and field you are already employed at.

@ -4,7 +4,7 @@
## Singularity.checkFactionInvitations() method
SF4.2 - List all current faction invitations.
List all current faction invitations.
<b>Signature:</b>
@ -19,7 +19,7 @@ Array with the name of all Factions you currently have oustanding invitations fr
## Remarks
RAM cost: 3 GB
RAM cost: 3 GB \* 16/4/1
Returns an array with the name of all Factions you currently have oustanding invitations from.

@ -4,7 +4,7 @@
## Singularity.commitCrime() method
SF4.3 - Commit a crime.
Commit a crime.
<b>Signature:</b>
@ -22,11 +22,11 @@ commitCrime(crime: string): number;
number
True if you successfully start working on the specified program, and false otherwise.
The number of milliseconds it takes to attempt the specified crime.
## Remarks
RAM cost: 5 GB
RAM cost: 5 GB \* 16/4/1
This function is used to automatically attempt to commit crimes. If you are already in the middle of some working action (such as working for a company or training at a gym), then running this function will automatically cancel that action and give you your earnings.

@ -4,7 +4,7 @@
## Singularity.connect() method
SF4.1 - Connect to a server.
Connect to a server.
<b>Signature:</b>
@ -26,7 +26,7 @@ True if the connect command was successful, false otherwise.
## Remarks
RAM cost: 2 GB
RAM cost: 2 GB \* 16/4/1
Run the connect HOSTNAME command in the terminal. Can only connect to neighbors.

@ -4,12 +4,12 @@
## Singularity.createProgram() method
SF4.3 - Create a program.
Create a program.
<b>Signature:</b>
```typescript
createProgram(program: string): boolean;
createProgram(program: string, focus?: boolean): boolean;
```
## Parameters
@ -17,6 +17,7 @@ createProgram(program: string): boolean;
| Parameter | Type | Description |
| --- | --- | --- |
| program | string | Name of program to create. |
| focus | boolean | Acquire player focus on this program creation. Optional. Defaults to true. |
<b>Returns:</b>
@ -26,7 +27,7 @@ True if you successfully start working on the specified program, and false other
## Remarks
RAM cost: 5 GB
RAM cost: 5 GB \* 16/4/1
This function will automatically set you to start working on creating the specified program. If you are already in the middle of some “working” action (such as working for a company, training at a gym, or taking a course), then running this function will automatically cancel that action and give you your earnings.

@ -4,7 +4,7 @@
## Singularity.donateToFaction() method
SF4.3 - Donate to a faction.
Donate to a faction.
<b>Signature:</b>
@ -27,7 +27,7 @@ True if the money was donated, and false otherwise.
## Remarks
RAM cost: 5 GB
RAM cost: 5 GB \* 16/4/1
Attempts to donate money to the specified faction in exchange for reputation. Returns true if you successfully donate the money, and false otherwise.

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