mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-16 14:28:36 +02:00
Compare commits
89 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5c738919fc | ||
|
|
223d9b9cdb | ||
|
|
6a63f8a02c | ||
|
|
ad6f919d64 | ||
|
|
c5e2f65cb0 | ||
|
|
7fad6e0778 | ||
|
|
6d3495d05f | ||
|
|
875bddbbdb | ||
|
|
648c180952 | ||
|
|
3ae3f947ac | ||
|
|
f6e1c171ae | ||
|
|
1b81fe8766 | ||
|
|
e1d2e12747 | ||
|
|
b9d13063ac | ||
|
|
47176b7809 | ||
|
|
d914040ae7 | ||
|
|
cb93f4d108 | ||
|
|
fe0f8cad4d | ||
|
|
b6eafce563 | ||
|
|
99e5c5e6b0 | ||
|
|
bf5e638891 | ||
|
|
d2b3659512 | ||
|
|
a6ff0d3e14 | ||
|
|
c4482a70f9 | ||
|
|
3c42880185 | ||
|
|
7b2e8e5312 | ||
|
|
b844593e22 | ||
|
|
624a0a5b02 | ||
|
|
bba2ccd83a | ||
|
|
25dae7ec8b | ||
|
|
f95ca64e01 | ||
|
|
0ed88a4317 | ||
|
|
8d3f2bd750 | ||
|
|
bec737a253 | ||
|
|
66ac31ee99 | ||
|
|
52769706d2 | ||
|
|
ae87851889 | ||
|
|
7c82221a13 | ||
|
|
b7fdcdf35d | ||
|
|
ad9bde40e0 | ||
|
|
8c86e1e07a | ||
|
|
1ea555f572 | ||
|
|
bc7482b0a2 | ||
|
|
12de5505b5 | ||
|
|
62058a7f78 | ||
|
|
9a0d688909 | ||
|
|
b4f33fe655 | ||
|
|
4b627cde1e | ||
|
|
101fb21c58 | ||
|
|
79b677973b | ||
|
|
93235570d0 | ||
|
|
51b03003f6 | ||
|
|
281e22c90c | ||
|
|
de5ebc993b | ||
|
|
aaaa980d10 | ||
|
|
7b05bed0d4 | ||
|
|
42d70506cc | ||
|
|
d5525f39bc | ||
|
|
86b0bd5ac7 | ||
|
|
7ea0725a39 | ||
|
|
fbdd8aee58 | ||
|
|
633f3ef07e | ||
|
|
b7ad3395ae | ||
|
|
7500ef0da2 | ||
|
|
cef452d35e | ||
|
|
4ca598defb | ||
|
|
d637828759 | ||
|
|
5c7b30ef15 | ||
|
|
647b78c9f7 | ||
|
|
c4fe88e0c7 | ||
|
|
931d7e588a | ||
|
|
aed01b0979 | ||
|
|
9e55d00b4f | ||
|
|
6b7cab6ac4 | ||
|
|
2e84512881 | ||
|
|
2c0f7f1eda | ||
|
|
e5b1fd6b58 | ||
|
|
3ced0575a4 | ||
|
|
75579a2ff1 | ||
|
|
83b7c380ff | ||
|
|
e624db5238 | ||
|
|
1c6369ffa4 | ||
|
|
a85efbc4da | ||
|
|
e9bbe57902 | ||
|
|
888e5f9c8a | ||
|
|
e7312d97e6 | ||
|
|
fc86895c30 | ||
|
|
1e0d3a7747 | ||
|
|
b4836e5329 |
@@ -35,4 +35,9 @@ module.exports = {
|
||||
"@typescript-eslint/no-explicit-any": "off",
|
||||
"react/no-unescaped-entities": "off",
|
||||
},
|
||||
settings: {
|
||||
react: {
|
||||
version: "detect",
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
@@ -6,15 +6,14 @@
|
||||
|
||||
Bitburner is a programming-based [incremental game](https://en.wikipedia.org/wiki/Incremental_game)
|
||||
that revolves around hacking and cyberpunk themes.
|
||||
The game can be played at https://danielyxie.github.io/bitburner/ (release build), https://bitburner-official.github.io/bitburner-src/ (development build), or installed through [Steam](https://store.steampowered.com/app/1812820/Bitburner/).
|
||||
The game can be played at https://bitburner-official.github.io/ (release build), https://bitburner-official.github.io/bitburner-src/ (development build), or installed through [Steam](https://store.steampowered.com/app/1812820/Bitburner/).
|
||||
The location of the release build may change in the near future.
|
||||
|
||||
See the [frequently asked questions](./doc/FAQ.md) for more information . To discuss the game or get help, join the [official Discord server](https://discord.gg/TFc3hKD).
|
||||
|
||||
# Documentation
|
||||
|
||||
The game's official documentation can be found on [Read The
|
||||
Docs](http://bitburner-official.readthedocs.io/). Please note that this is still a work-in-progress.
|
||||
The game's official documentation can be found in-game.
|
||||
|
||||
The [in-game documentation](./markdown/bitburner.md) is generated from the [TypeScript definitions](./src/ScriptEditor/NetscriptDefinitions.d.ts).
|
||||
|
||||
|
||||
@@ -60,12 +60,8 @@ called `npm` is installed as well.
|
||||
|
||||
Not all code contributions will be accepted. The safest way to ensure
|
||||
that you don't waste time working on something that gets rejected is to
|
||||
run your idea(s)/plan(s) past [danielyxie](https://github.com/danielyxie) first.
|
||||
You can contact him through:
|
||||
|
||||
- Github
|
||||
- Discord
|
||||
- [Reddit](https://www.reddit.com/user/chapt3r/)
|
||||
run your idea(s)/plan(s) past the developpers first.
|
||||
You can contact him through Discord.
|
||||
|
||||
Otherwise, here are some general guidelines for determining what types of
|
||||
changes are okay to contribute:
|
||||
@@ -217,9 +213,8 @@ the following rules:
|
||||
|
||||
## As a Documenter
|
||||
|
||||
To contribute to and view your changes to the BitBurner documentation on [Read The
|
||||
Docs](http://bitburner.readthedocs.io/), you will
|
||||
need to have Python installed, along with [Sphinx](http://www.sphinx-doc.org).
|
||||
To contribute to and view your changes to the BitBurner documentation in-game, you will
|
||||
need to edit the files in [this folder](https://github.com/bitburner-official/bitburner-src/tree/dev/src/Documentation/doc)
|
||||
|
||||
To make change to the [in-game documentation](../markdown/bitburner.md), you will need to modify the [TypeScript definitions](../src/ScriptEditor/NetscriptDefinitions.d.ts), not the Markdown files.
|
||||
|
||||
@@ -234,8 +229,6 @@ rules:
|
||||
- Rebase your branch if necessary.
|
||||
- When submitting the pull request, make sure that the base fork is
|
||||
_bitburner-official/bitburner-src_ and the base is _dev_.
|
||||
- Do not check in any generated files under `doc\`. The documentation is built
|
||||
automatically by ReadTheDocs.
|
||||
|
||||
## Deploying a new version
|
||||
|
||||
|
||||
4
electron/package-lock.json
generated
4
electron/package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "bitburner",
|
||||
"version": "2.3.2dev",
|
||||
"version": "2.5.0",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "bitburner",
|
||||
"version": "2.3.2dev",
|
||||
"version": "2.5.0",
|
||||
"dependencies": {
|
||||
"electron-config": "^2.0.0",
|
||||
"electron-log": "^4.4.8",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "bitburner",
|
||||
"version": "2.3.2dev",
|
||||
"version": "2.5.0",
|
||||
"description": "A cyberpunk-themed programming incremental game",
|
||||
"main": "main.js",
|
||||
"author": "Daniel Xie, Olivier Gagnon, et al.",
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [bitburner](./bitburner.md) > [BitNodeMultipliers](./bitburner.bitnodemultipliers.md) > [CorporationDivisions](./bitburner.bitnodemultipliers.corporationdivisions.md)
|
||||
|
||||
## BitNodeMultipliers.CorporationDivisions property
|
||||
|
||||
Influences the amount of divisions a corporation can have have at the same time
|
||||
|
||||
**Signature:**
|
||||
|
||||
```typescript
|
||||
CorporationDivisions: number;
|
||||
```
|
||||
@@ -26,6 +26,7 @@ interface BitNodeMultipliers
|
||||
| [CodingContractMoney](./bitburner.bitnodemultipliers.codingcontractmoney.md) | | number | Influences the amount of money gained from completing Coding Contracts |
|
||||
| [CompanyWorkExpGain](./bitburner.bitnodemultipliers.companyworkexpgain.md) | | number | Influences the experience gained for each ability when the player completes working their job. |
|
||||
| [CompanyWorkMoney](./bitburner.bitnodemultipliers.companyworkmoney.md) | | number | Influences how much money the player earns when completing working their job. |
|
||||
| [CorporationDivisions](./bitburner.bitnodemultipliers.corporationdivisions.md) | | number | Influences the amount of divisions a corporation can have have at the same time |
|
||||
| [CorporationSoftcap](./bitburner.bitnodemultipliers.corporationsoftcap.md) | | number | Influences the money gain from dividends of corporations created by the player. |
|
||||
| [CorporationValuation](./bitburner.bitnodemultipliers.corporationvaluation.md) | | number | Influences the valuation of corporations created by the player. |
|
||||
| [CrimeExpGain](./bitburner.bitnodemultipliers.crimeexpgain.md) | | number | Influences the base experience gained for each ability when the player commits a crime. |
|
||||
|
||||
@@ -18,7 +18,7 @@ getActionRepGain(type: string, name: string, level: number): number;
|
||||
| --- | --- | --- |
|
||||
| type | string | Type of action. |
|
||||
| name | string | Name of action. Must be an exact match. |
|
||||
| level | number | Optional action level at which to calculate the gain |
|
||||
| level | number | Optional number. Action level at which to calculate the gain. Will be the action's current level if not given. |
|
||||
|
||||
**Returns:**
|
||||
|
||||
|
||||
57
markdown/bitburner.companyname.md
Normal file
57
markdown/bitburner.companyname.md
Normal file
@@ -0,0 +1,57 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [bitburner](./bitburner.md) > [CompanyName](./bitburner.companyname.md)
|
||||
|
||||
## CompanyName enum
|
||||
|
||||
Names of all companies
|
||||
|
||||
**Signature:**
|
||||
|
||||
```typescript
|
||||
declare enum CompanyName
|
||||
```
|
||||
|
||||
## Enumeration Members
|
||||
|
||||
| Member | Value | Description |
|
||||
| --- | --- | --- |
|
||||
| AeroCorp | <code>"AeroCorp"</code> | |
|
||||
| AlphaEnterprises | <code>"Alpha Enterprises"</code> | |
|
||||
| BachmanAndAssociates | <code>"Bachman & Associates"</code> | |
|
||||
| BladeIndustries | <code>"Blade Industries"</code> | |
|
||||
| CarmichaelSecurity | <code>"Carmichael Security"</code> | |
|
||||
| CIA | <code>"Central Intelligence Agency"</code> | |
|
||||
| ClarkeIncorporated | <code>"Clarke Incorporated"</code> | |
|
||||
| CompuTek | <code>"CompuTek"</code> | |
|
||||
| DefComm | <code>"DefComm"</code> | |
|
||||
| DeltaOne | <code>"DeltaOne"</code> | |
|
||||
| ECorp | <code>"ECorp"</code> | |
|
||||
| FoodNStuff | <code>"FoodNStuff"</code> | |
|
||||
| FourSigma | <code>"Four Sigma"</code> | |
|
||||
| FulcrumTechnologies | <code>"Fulcrum Technologies"</code> | |
|
||||
| GalacticCybersystems | <code>"Galactic Cybersystems"</code> | |
|
||||
| GlobalPharmaceuticals | <code>"Global Pharmaceuticals"</code> | |
|
||||
| HeliosLabs | <code>"Helios Labs"</code> | |
|
||||
| IcarusMicrosystems | <code>"Icarus Microsystems"</code> | |
|
||||
| JoesGuns | <code>"Joe's Guns"</code> | |
|
||||
| KuaiGongInternational | <code>"KuaiGong International"</code> | |
|
||||
| LexoCorp | <code>"LexoCorp"</code> | |
|
||||
| MegaCorp | <code>"MegaCorp"</code> | |
|
||||
| NetLinkTechnologies | <code>"NetLink Technologies"</code> | |
|
||||
| NoodleBar | <code>"Noodle Bar"</code> | |
|
||||
| NovaMedical | <code>"Nova Medical"</code> | |
|
||||
| NSA | <code>"National Security Agency"</code> | |
|
||||
| NWO | <code>"NWO"</code> | |
|
||||
| OmegaSoftware | <code>"Omega Software"</code> | |
|
||||
| OmniaCybersystems | <code>"Omnia Cybersystems"</code> | |
|
||||
| OmniTekIncorporated | <code>"OmniTek Incorporated"</code> | |
|
||||
| Police | <code>"Aevum Police Headquarters"</code> | |
|
||||
| RhoConstruction | <code>"Rho Construction"</code> | |
|
||||
| SolarisSpaceSystems | <code>"Solaris Space Systems"</code> | |
|
||||
| StormTechnologies | <code>"Storm Technologies"</code> | |
|
||||
| SysCoreSecurities | <code>"SysCore Securities"</code> | |
|
||||
| UniversalEnergy | <code>"Universal Energy"</code> | |
|
||||
| VitaLife | <code>"VitaLife"</code> | |
|
||||
| WatchdogSecurity | <code>"Watchdog Security"</code> | |
|
||||
|
||||
13
markdown/bitburner.corpindustrydata.makesmaterials.md
Normal file
13
markdown/bitburner.corpindustrydata.makesmaterials.md
Normal file
@@ -0,0 +1,13 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [bitburner](./bitburner.md) > [CorpIndustryData](./bitburner.corpindustrydata.md) > [makesMaterials](./bitburner.corpindustrydata.makesmaterials.md)
|
||||
|
||||
## CorpIndustryData.makesMaterials property
|
||||
|
||||
Whether the industry of this division is capable of producing materials
|
||||
|
||||
**Signature:**
|
||||
|
||||
```typescript
|
||||
makesMaterials: boolean;
|
||||
```
|
||||
13
markdown/bitburner.corpindustrydata.makesproducts.md
Normal file
13
markdown/bitburner.corpindustrydata.makesproducts.md
Normal file
@@ -0,0 +1,13 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [bitburner](./bitburner.md) > [CorpIndustryData](./bitburner.corpindustrydata.md) > [makesProducts](./bitburner.corpindustrydata.makesproducts.md)
|
||||
|
||||
## CorpIndustryData.makesProducts property
|
||||
|
||||
Whether the industry of this division is capable of developing and producing products
|
||||
|
||||
**Signature:**
|
||||
|
||||
```typescript
|
||||
makesProducts: boolean;
|
||||
```
|
||||
@@ -20,7 +20,9 @@ interface CorpIndustryData
|
||||
| [aiCoreFactor?](./bitburner.corpindustrydata.aicorefactor.md) | | number | _(Optional)_ AI Cores factor |
|
||||
| [description](./bitburner.corpindustrydata.description.md) | | string | |
|
||||
| [hardwareFactor?](./bitburner.corpindustrydata.hardwarefactor.md) | | number | _(Optional)_ Hardware factor |
|
||||
| [producedMaterials?](./bitburner.corpindustrydata.producedmaterials.md) | | [CorpMaterialName](./bitburner.corpmaterialname.md)<!-- -->\[\] | _(Optional)_ |
|
||||
| [makesMaterials](./bitburner.corpindustrydata.makesmaterials.md) | | boolean | Whether the industry of this division is capable of producing materials |
|
||||
| [makesProducts](./bitburner.corpindustrydata.makesproducts.md) | | boolean | Whether the industry of this division is capable of developing and producing products |
|
||||
| [producedMaterials?](./bitburner.corpindustrydata.producedmaterials.md) | | [CorpMaterialName](./bitburner.corpmaterialname.md)<!-- -->\[\] | _(Optional)_ Array of Materials produced |
|
||||
| [product?](./bitburner.corpindustrydata.product.md) | | [CorpProductData](./bitburner.corpproductdata.md) | _(Optional)_ |
|
||||
| [realEstateFactor?](./bitburner.corpindustrydata.realestatefactor.md) | | number | _(Optional)_ Real estate factor |
|
||||
| [recommendStarting](./bitburner.corpindustrydata.recommendstarting.md) | | boolean | |
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
|
||||
## CorpIndustryData.producedMaterials property
|
||||
|
||||
Array of Materials produced
|
||||
|
||||
**Signature:**
|
||||
|
||||
```typescript
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
## Corporation.buyBackShares() method
|
||||
|
||||
Buyback Shares
|
||||
Buyback Shares. Spend money from the player's wallet to transfer shares from public traders to the CEO.
|
||||
|
||||
**Signature:**
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ export interface Corporation extends WarehouseAPI, OfficeAPI
|
||||
| --- | --- |
|
||||
| [acceptInvestmentOffer()](./bitburner.corporation.acceptinvestmentoffer.md) | Accept investment based on you companies current valuation |
|
||||
| [bribe(factionName, amountCash)](./bitburner.corporation.bribe.md) | Bribe a faction |
|
||||
| [buyBackShares(amount)](./bitburner.corporation.buybackshares.md) | Buyback Shares |
|
||||
| [buyBackShares(amount)](./bitburner.corporation.buybackshares.md) | Buyback Shares. Spend money from the player's wallet to transfer shares from public traders to the CEO. |
|
||||
| [createCorporation(corporationName, selfFund)](./bitburner.corporation.createcorporation.md) | Create a Corporation |
|
||||
| [expandCity(divisionName, city)](./bitburner.corporation.expandcity.md) | Expand to a new city |
|
||||
| [expandIndustry(industryType, divisionName)](./bitburner.corporation.expandindustry.md) | Expand to a new industry |
|
||||
@@ -40,5 +40,5 @@ export interface Corporation extends WarehouseAPI, OfficeAPI
|
||||
| [issueNewShares(amount)](./bitburner.corporation.issuenewshares.md) | Issue new shares |
|
||||
| [levelUpgrade(upgradeName)](./bitburner.corporation.levelupgrade.md) | Level an upgrade. |
|
||||
| [purchaseUnlock(upgradeName)](./bitburner.corporation.purchaseunlock.md) | Unlock an upgrade |
|
||||
| [sellShares(amount)](./bitburner.corporation.sellshares.md) | Sell Shares |
|
||||
| [sellShares(amount)](./bitburner.corporation.sellshares.md) | Sell Shares. Transfer shares from the CEO to public traders to receive money in the player's wallet. |
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
## Corporation.sellShares() method
|
||||
|
||||
Sell Shares
|
||||
Sell Shares. Transfer shares from the CEO to public traders to receive money in the player's wallet.
|
||||
|
||||
**Signature:**
|
||||
|
||||
|
||||
13
markdown/bitburner.corporationinfo.investorshares.md
Normal file
13
markdown/bitburner.corporationinfo.investorshares.md
Normal file
@@ -0,0 +1,13 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [bitburner](./bitburner.md) > [CorporationInfo](./bitburner.corporationinfo.md) > [investorShares](./bitburner.corporationinfo.investorshares.md)
|
||||
|
||||
## CorporationInfo.investorShares property
|
||||
|
||||
Amount of shares owned by private investors. Not available for public sale or CEO buyback.
|
||||
|
||||
**Signature:**
|
||||
|
||||
```typescript
|
||||
investorShares: number;
|
||||
```
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
## CorporationInfo.issuedShares property
|
||||
|
||||
Amount of acquirable shares.
|
||||
Amount of shares owned by public traders. Available for CEO buyback.
|
||||
|
||||
**Signature:**
|
||||
|
||||
|
||||
13
markdown/bitburner.corporationinfo.issuenewsharescooldown.md
Normal file
13
markdown/bitburner.corporationinfo.issuenewsharescooldown.md
Normal file
@@ -0,0 +1,13 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [bitburner](./bitburner.md) > [CorporationInfo](./bitburner.corporationinfo.md) > [issueNewSharesCooldown](./bitburner.corporationinfo.issuenewsharescooldown.md)
|
||||
|
||||
## CorporationInfo.issueNewSharesCooldown property
|
||||
|
||||
Cooldown until new shares can be issued
|
||||
|
||||
**Signature:**
|
||||
|
||||
```typescript
|
||||
issueNewSharesCooldown: number;
|
||||
```
|
||||
@@ -22,13 +22,15 @@ interface CorporationInfo
|
||||
| [divisions](./bitburner.corporationinfo.divisions.md) | | string\[\] | Array of all division names |
|
||||
| [expenses](./bitburner.corporationinfo.expenses.md) | | number | Expenses per second this cycle |
|
||||
| [funds](./bitburner.corporationinfo.funds.md) | | number | Funds available |
|
||||
| [issuedShares](./bitburner.corporationinfo.issuedshares.md) | | number | Amount of acquirable shares. |
|
||||
| [investorShares](./bitburner.corporationinfo.investorshares.md) | | number | Amount of shares owned by private investors. Not available for public sale or CEO buyback. |
|
||||
| [issuedShares](./bitburner.corporationinfo.issuedshares.md) | | number | Amount of shares owned by public traders. Available for CEO buyback. |
|
||||
| [issueNewSharesCooldown](./bitburner.corporationinfo.issuenewsharescooldown.md) | | number | Cooldown until new shares can be issued |
|
||||
| [name](./bitburner.corporationinfo.name.md) | | string | Name of the corporation |
|
||||
| [numShares](./bitburner.corporationinfo.numshares.md) | | number | Amount of share owned |
|
||||
| [numShares](./bitburner.corporationinfo.numshares.md) | | number | Amount of shares owned by the CEO. |
|
||||
| [public](./bitburner.corporationinfo.public.md) | | boolean | Indicating if the company is public |
|
||||
| [revenue](./bitburner.corporationinfo.revenue.md) | | number | Revenue per second this cycle |
|
||||
| [sharePrice](./bitburner.corporationinfo.shareprice.md) | | number | Price of the shares |
|
||||
| [shareSaleCooldown](./bitburner.corporationinfo.sharesalecooldown.md) | | number | Cooldown until shares can be sold again |
|
||||
| [state](./bitburner.corporationinfo.state.md) | | string | State of the corporation. Possible states are START, PURCHASE, PRODUCTION, EXPORT, SALE. |
|
||||
| [totalShares](./bitburner.corporationinfo.totalshares.md) | | number | Total number of shares issues by this corporation |
|
||||
| [state](./bitburner.corporationinfo.state.md) | | string | <p>The next state to be processed.</p><p>I.e. when the state is PURCHASE, it means purchasing will occur during the next state transition.</p><p>Possible states are START, PURCHASE, PRODUCTION, EXPORT, SALE.</p> |
|
||||
| [totalShares](./bitburner.corporationinfo.totalshares.md) | | number | Total number of shares issued by this corporation. |
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
## CorporationInfo.numShares property
|
||||
|
||||
Amount of share owned
|
||||
Amount of shares owned by the CEO.
|
||||
|
||||
**Signature:**
|
||||
|
||||
|
||||
@@ -4,7 +4,11 @@
|
||||
|
||||
## CorporationInfo.state property
|
||||
|
||||
State of the corporation. Possible states are START, PURCHASE, PRODUCTION, EXPORT, SALE.
|
||||
The next state to be processed.
|
||||
|
||||
I.e. when the state is PURCHASE, it means purchasing will occur during the next state transition.
|
||||
|
||||
Possible states are START, PURCHASE, PRODUCTION, EXPORT, SALE.
|
||||
|
||||
**Signature:**
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
## CorporationInfo.totalShares property
|
||||
|
||||
Total number of shares issues by this corporation
|
||||
Total number of shares issued by this corporation.
|
||||
|
||||
**Signature:**
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
## Division.makesProducts property
|
||||
|
||||
Whether the industry this division is in is capable of making products
|
||||
Whether the industry of this division is capable of developing and producing products
|
||||
|
||||
**Signature:**
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ interface Division
|
||||
| [cities](./bitburner.division.cities.md) | | [CityName](./bitburner.cityname.md)<!-- -->\[\] | Cities in which this division has expanded |
|
||||
| [lastCycleExpenses](./bitburner.division.lastcycleexpenses.md) | | number | Expenses last cycle |
|
||||
| [lastCycleRevenue](./bitburner.division.lastcyclerevenue.md) | | number | Revenue last cycle |
|
||||
| [makesProducts](./bitburner.division.makesproducts.md) | | boolean | Whether the industry this division is in is capable of making products |
|
||||
| [makesProducts](./bitburner.division.makesproducts.md) | | boolean | Whether the industry of this division is capable of developing and producing products |
|
||||
| [maxProducts](./bitburner.division.maxproducts.md) | | number | How many products this division can support |
|
||||
| [name](./bitburner.division.name.md) | | string | Name of the division |
|
||||
| [numAdVerts](./bitburner.division.numadverts.md) | | number | Number of times AdVert has been bought |
|
||||
|
||||
23
markdown/bitburner.gang.getrecruitsavailable.md
Normal file
23
markdown/bitburner.gang.getrecruitsavailable.md
Normal file
@@ -0,0 +1,23 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [bitburner](./bitburner.md) > [Gang](./bitburner.gang.md) > [getRecruitsAvailable](./bitburner.gang.getrecruitsavailable.md)
|
||||
|
||||
## Gang.getRecruitsAvailable() method
|
||||
|
||||
Check how many gang members you can currently recruit.
|
||||
|
||||
**Signature:**
|
||||
|
||||
```typescript
|
||||
getRecruitsAvailable(): number;
|
||||
```
|
||||
**Returns:**
|
||||
|
||||
number
|
||||
|
||||
Number indicating how many members can be recruited, considering current reputation and gang size.
|
||||
|
||||
## Remarks
|
||||
|
||||
RAM cost: 1 GB
|
||||
|
||||
@@ -34,11 +34,14 @@ If you are not in BitNode-2, then you must have Source-File 2 in order to use th
|
||||
| [getMemberInformation(name)](./bitburner.gang.getmemberinformation.md) | Get information about a specific gang member. |
|
||||
| [getMemberNames()](./bitburner.gang.getmembernames.md) | List all gang members. |
|
||||
| [getOtherGangInformation()](./bitburner.gang.getotherganginformation.md) | Get information about the other gangs. |
|
||||
| [getRecruitsAvailable()](./bitburner.gang.getrecruitsavailable.md) | Check how many gang members you can currently recruit. |
|
||||
| [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. |
|
||||
| [renameMember(memberName, newName)](./bitburner.gang.renamemember.md) | Rename a Gang member to a new unique name. |
|
||||
| [respectForNextRecruit()](./bitburner.gang.respectfornextrecruit.md) | Check the amount of Respect needed for your next gang recruit. |
|
||||
| [setMemberTask(memberName, taskName)](./bitburner.gang.setmembertask.md) | Set gang member to task. |
|
||||
| [setTerritoryWarfare(engage)](./bitburner.gang.setterritorywarfare.md) | Enable/Disable territory warfare. |
|
||||
|
||||
|
||||
33
markdown/bitburner.gang.renamemember.md
Normal file
33
markdown/bitburner.gang.renamemember.md
Normal file
@@ -0,0 +1,33 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [bitburner](./bitburner.md) > [Gang](./bitburner.gang.md) > [renameMember](./bitburner.gang.renamemember.md)
|
||||
|
||||
## Gang.renameMember() method
|
||||
|
||||
Rename a Gang member to a new unique name.
|
||||
|
||||
**Signature:**
|
||||
|
||||
```typescript
|
||||
renameMember(memberName: string, newName: string): boolean;
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| memberName | string | Name of the member to change. |
|
||||
| newName | string | New name for that gang member. |
|
||||
|
||||
**Returns:**
|
||||
|
||||
boolean
|
||||
|
||||
True if successful, and false if not.
|
||||
|
||||
## Remarks
|
||||
|
||||
RAM cost: 0 GB
|
||||
|
||||
Rename a Gang Member if none already has the new name.
|
||||
|
||||
23
markdown/bitburner.gang.respectfornextrecruit.md
Normal file
23
markdown/bitburner.gang.respectfornextrecruit.md
Normal file
@@ -0,0 +1,23 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [bitburner](./bitburner.md) > [Gang](./bitburner.gang.md) > [respectForNextRecruit](./bitburner.gang.respectfornextrecruit.md)
|
||||
|
||||
## Gang.respectForNextRecruit() method
|
||||
|
||||
Check the amount of Respect needed for your next gang recruit.
|
||||
|
||||
**Signature:**
|
||||
|
||||
```typescript
|
||||
respectForNextRecruit(): number;
|
||||
```
|
||||
**Returns:**
|
||||
|
||||
number
|
||||
|
||||
The static number value of Respect needed for the next recruit, with consideration to your current gang size. Returns `Infinity` if you have reached the gang size limit.
|
||||
|
||||
## Remarks
|
||||
|
||||
RAM cost: 1 GB
|
||||
|
||||
@@ -21,6 +21,7 @@ interface GangGenInfo
|
||||
| [moneyGainRate](./bitburner.ganggeninfo.moneygainrate.md) | | number | Money earned per game cycle |
|
||||
| [power](./bitburner.ganggeninfo.power.md) | | number | Gang's power for territory warfare |
|
||||
| [respect](./bitburner.ganggeninfo.respect.md) | | number | Gang's respect |
|
||||
| [respectForNextRecruit](./bitburner.ganggeninfo.respectfornextrecruit.md) | | number | Amount of Respect needed for next gang recruit, if possible |
|
||||
| [respectGainRate](./bitburner.ganggeninfo.respectgainrate.md) | | number | Respect earned per game cycle |
|
||||
| [territory](./bitburner.ganggeninfo.territory.md) | | number | Amount of territory held |
|
||||
| [territoryClashChance](./bitburner.ganggeninfo.territoryclashchance.md) | | number | Clash chance |
|
||||
|
||||
13
markdown/bitburner.ganggeninfo.respectfornextrecruit.md
Normal file
13
markdown/bitburner.ganggeninfo.respectfornextrecruit.md
Normal file
@@ -0,0 +1,13 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [bitburner](./bitburner.md) > [GangGenInfo](./bitburner.ganggeninfo.md) > [respectForNextRecruit](./bitburner.ganggeninfo.respectfornextrecruit.md)
|
||||
|
||||
## GangGenInfo.respectForNextRecruit property
|
||||
|
||||
Amount of Respect needed for next gang recruit, if possible
|
||||
|
||||
**Signature:**
|
||||
|
||||
```typescript
|
||||
respectForNextRecruit: number;
|
||||
```
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
## GangMemberInfo.agi\_asc\_points property
|
||||
|
||||
Total earned agility experience
|
||||
Total Agility Ascension points accumulated
|
||||
|
||||
**Signature:**
|
||||
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
|
||||
## GangMemberInfo.augmentations property
|
||||
|
||||
List of all Augmentations currently installed on gang member
|
||||
|
||||
**Signature:**
|
||||
|
||||
```typescript
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
## GangMemberInfo.cha\_asc\_points property
|
||||
|
||||
Total earned charisma experience
|
||||
Total Charisma Ascension points accumulated
|
||||
|
||||
**Signature:**
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
## GangMemberInfo.def\_asc\_points property
|
||||
|
||||
Total earned defense experience
|
||||
Total Defense Ascension points accumulated
|
||||
|
||||
**Signature:**
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
## GangMemberInfo.dex\_asc\_points property
|
||||
|
||||
Total earned dexterity experience
|
||||
Total Dexterity Ascension points accumulated
|
||||
|
||||
**Signature:**
|
||||
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
|
||||
## GangMemberInfo.earnedRespect property
|
||||
|
||||
Amount of Respect earned by member since they last Ascended
|
||||
|
||||
**Signature:**
|
||||
|
||||
```typescript
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
## GangMemberInfo.hack\_asc\_points property
|
||||
|
||||
Total earned hack experience
|
||||
Total Hack Ascension points accumulated
|
||||
|
||||
**Signature:**
|
||||
|
||||
|
||||
@@ -16,41 +16,41 @@ interface GangMemberInfo
|
||||
| Property | Modifiers | Type | Description |
|
||||
| --- | --- | --- | --- |
|
||||
| [agi\_asc\_mult](./bitburner.gangmemberinfo.agi_asc_mult.md) | | number | Agility multiplier from ascensions |
|
||||
| [agi\_asc\_points](./bitburner.gangmemberinfo.agi_asc_points.md) | | number | Total earned agility experience |
|
||||
| [agi\_asc\_points](./bitburner.gangmemberinfo.agi_asc_points.md) | | number | Total Agility Ascension points accumulated |
|
||||
| [agi\_exp](./bitburner.gangmemberinfo.agi_exp.md) | | number | Current agility experience |
|
||||
| [agi\_mult](./bitburner.gangmemberinfo.agi_mult.md) | | number | Agility multiplier from equipment |
|
||||
| [agi](./bitburner.gangmemberinfo.agi.md) | | number | Agility skill level |
|
||||
| [augmentations](./bitburner.gangmemberinfo.augmentations.md) | | string\[\] | |
|
||||
| [augmentations](./bitburner.gangmemberinfo.augmentations.md) | | string\[\] | List of all Augmentations currently installed on gang member |
|
||||
| [cha\_asc\_mult](./bitburner.gangmemberinfo.cha_asc_mult.md) | | number | Charisma multiplier from ascensions |
|
||||
| [cha\_asc\_points](./bitburner.gangmemberinfo.cha_asc_points.md) | | number | Total earned charisma experience |
|
||||
| [cha\_asc\_points](./bitburner.gangmemberinfo.cha_asc_points.md) | | number | Total Charisma Ascension points accumulated |
|
||||
| [cha\_exp](./bitburner.gangmemberinfo.cha_exp.md) | | number | Current charisma experience |
|
||||
| [cha\_mult](./bitburner.gangmemberinfo.cha_mult.md) | | number | Charisma multiplier from equipment |
|
||||
| [cha](./bitburner.gangmemberinfo.cha.md) | | number | Charisma skill level |
|
||||
| [def\_asc\_mult](./bitburner.gangmemberinfo.def_asc_mult.md) | | number | Defense multiplier from ascensions |
|
||||
| [def\_asc\_points](./bitburner.gangmemberinfo.def_asc_points.md) | | number | Total earned defense experience |
|
||||
| [def\_asc\_points](./bitburner.gangmemberinfo.def_asc_points.md) | | number | Total Defense Ascension points accumulated |
|
||||
| [def\_exp](./bitburner.gangmemberinfo.def_exp.md) | | number | Current defense experience |
|
||||
| [def\_mult](./bitburner.gangmemberinfo.def_mult.md) | | number | Defense multiplier from equipment |
|
||||
| [def](./bitburner.gangmemberinfo.def.md) | | number | Defense skill level |
|
||||
| [dex\_asc\_mult](./bitburner.gangmemberinfo.dex_asc_mult.md) | | number | Dexterity multiplier from ascensions |
|
||||
| [dex\_asc\_points](./bitburner.gangmemberinfo.dex_asc_points.md) | | number | Total earned dexterity experience |
|
||||
| [dex\_asc\_points](./bitburner.gangmemberinfo.dex_asc_points.md) | | number | Total Dexterity Ascension points accumulated |
|
||||
| [dex\_exp](./bitburner.gangmemberinfo.dex_exp.md) | | number | Current dexterity experience |
|
||||
| [dex\_mult](./bitburner.gangmemberinfo.dex_mult.md) | | number | Dexterity multiplier from equipment |
|
||||
| [dex](./bitburner.gangmemberinfo.dex.md) | | number | Dexterity skill level |
|
||||
| [earnedRespect](./bitburner.gangmemberinfo.earnedrespect.md) | | number | |
|
||||
| [earnedRespect](./bitburner.gangmemberinfo.earnedrespect.md) | | number | Amount of Respect earned by member since they last Ascended |
|
||||
| [hack\_asc\_mult](./bitburner.gangmemberinfo.hack_asc_mult.md) | | number | Hack multiplier from ascensions |
|
||||
| [hack\_asc\_points](./bitburner.gangmemberinfo.hack_asc_points.md) | | number | Total earned hack experience |
|
||||
| [hack\_asc\_points](./bitburner.gangmemberinfo.hack_asc_points.md) | | number | Total Hack Ascension points accumulated |
|
||||
| [hack\_exp](./bitburner.gangmemberinfo.hack_exp.md) | | number | Current hack experience |
|
||||
| [hack\_mult](./bitburner.gangmemberinfo.hack_mult.md) | | number | Hack multiplier from equipment |
|
||||
| [hack](./bitburner.gangmemberinfo.hack.md) | | number | Hack skill level |
|
||||
| [moneyGain](./bitburner.gangmemberinfo.moneygain.md) | | number | |
|
||||
| [moneyGain](./bitburner.gangmemberinfo.moneygain.md) | | number | Per Cycle Income for this gang member |
|
||||
| [name](./bitburner.gangmemberinfo.name.md) | | string | Name of the gang member |
|
||||
| [respectGain](./bitburner.gangmemberinfo.respectgain.md) | | number | |
|
||||
| [respectGain](./bitburner.gangmemberinfo.respectgain.md) | | number | Per Cycle Rate this member is currently gaining Respect |
|
||||
| [str\_asc\_mult](./bitburner.gangmemberinfo.str_asc_mult.md) | | number | Strength multiplier from ascensions |
|
||||
| [str\_asc\_points](./bitburner.gangmemberinfo.str_asc_points.md) | | number | Total earned strength experience |
|
||||
| [str\_asc\_points](./bitburner.gangmemberinfo.str_asc_points.md) | | number | Total Strength Ascension points accumulated |
|
||||
| [str\_exp](./bitburner.gangmemberinfo.str_exp.md) | | number | Current strength experience |
|
||||
| [str\_mult](./bitburner.gangmemberinfo.str_mult.md) | | number | Strength multiplier from equipment |
|
||||
| [str](./bitburner.gangmemberinfo.str.md) | | number | Strength skill level |
|
||||
| [task](./bitburner.gangmemberinfo.task.md) | | string | Currently assigned task |
|
||||
| [upgrades](./bitburner.gangmemberinfo.upgrades.md) | | string\[\] | |
|
||||
| [wantedLevelGain](./bitburner.gangmemberinfo.wantedlevelgain.md) | | number | |
|
||||
| [upgrades](./bitburner.gangmemberinfo.upgrades.md) | | string\[\] | List of all non-Augmentation Equipment owned by gang member |
|
||||
| [wantedLevelGain](./bitburner.gangmemberinfo.wantedlevelgain.md) | | number | Per Cycle Rate by which this member is affecting your gang's Wanted Level |
|
||||
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
|
||||
## GangMemberInfo.moneyGain property
|
||||
|
||||
Per Cycle Income for this gang member
|
||||
|
||||
**Signature:**
|
||||
|
||||
```typescript
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
|
||||
## GangMemberInfo.respectGain property
|
||||
|
||||
Per Cycle Rate this member is currently gaining Respect
|
||||
|
||||
**Signature:**
|
||||
|
||||
```typescript
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
## GangMemberInfo.str\_asc\_points property
|
||||
|
||||
Total earned strength experience
|
||||
Total Strength Ascension points accumulated
|
||||
|
||||
**Signature:**
|
||||
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
|
||||
## GangMemberInfo.upgrades property
|
||||
|
||||
List of all non-Augmentation Equipment owned by gang member
|
||||
|
||||
**Signature:**
|
||||
|
||||
```typescript
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
|
||||
## GangMemberInfo.wantedLevelGain property
|
||||
|
||||
Per Cycle Rate by which this member is affecting your gang's Wanted Level
|
||||
|
||||
**Signature:**
|
||||
|
||||
```typescript
|
||||
|
||||
@@ -34,12 +34,10 @@ declare enum JobName
|
||||
| IT3 | <code>"Systems Administrator"</code> | |
|
||||
| networkEng0 | <code>"Network Engineer"</code> | |
|
||||
| networkEng1 | <code>"Network Administrator"</code> | |
|
||||
| security0 | <code>"Police Officer"</code> | |
|
||||
| security1 | <code>"Police Chief"</code> | |
|
||||
| security2 | <code>"Security Guard"</code> | |
|
||||
| security3 | <code>"Security Officer"</code> | |
|
||||
| security4 | <code>"Security Supervisor"</code> | |
|
||||
| security5 | <code>"Head of Security"</code> | |
|
||||
| security0 | <code>"Security Guard"</code> | |
|
||||
| security1 | <code>"Security Officer"</code> | |
|
||||
| security2 | <code>"Security Supervisor"</code> | |
|
||||
| security3 | <code>"Head of Security"</code> | |
|
||||
| securityEng | <code>"Security Engineer"</code> | |
|
||||
| software0 | <code>"Software Engineering Intern"</code> | |
|
||||
| software1 | <code>"Junior Software Engineer"</code> | |
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
| Enumeration | Description |
|
||||
| --- | --- |
|
||||
| [CityName](./bitburner.cityname.md) | Names of all cities |
|
||||
| [CompanyName](./bitburner.companyname.md) | Names of all companies |
|
||||
| [CrimeType](./bitburner.crimetype.md) | |
|
||||
| [FactionWorkType](./bitburner.factionworktype.md) | |
|
||||
| [GymType](./bitburner.gymtype.md) | |
|
||||
@@ -97,7 +98,9 @@
|
||||
| [Sleeve](./bitburner.sleeve.md) | Sleeve API |
|
||||
| [SleevePerson](./bitburner.sleeveperson.md) | |
|
||||
| [SourceFileLvl](./bitburner.sourcefilelvl.md) | |
|
||||
| [SpawnOptions](./bitburner.spawnoptions.md) | |
|
||||
| [Stanek](./bitburner.stanek.md) | Stanek's Gift API. |
|
||||
| [StockMarketConstants](./bitburner.stockmarketconstants.md) | Constants used for the stockmarket game mechanic. |
|
||||
| [StockOrder](./bitburner.stockorder.md) | <p>Return value of [getOrders](./bitburner.tix.getorders.md)</p><p>Keys are stock symbols, properties are arrays of [StockOrderObject](./bitburner.stockorderobject.md)</p> |
|
||||
| [StockOrderObject](./bitburner.stockorderobject.md) | Value in map of [StockOrder](./bitburner.stockorder.md) |
|
||||
| [TailProperties](./bitburner.tailproperties.md) | |
|
||||
|
||||
@@ -9,14 +9,14 @@ Clear data from a port.
|
||||
**Signature:**
|
||||
|
||||
```typescript
|
||||
clearPort(handle: number): void;
|
||||
clearPort(portNumber: number): void;
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| handle | number | Port to clear. |
|
||||
| portNumber | number | Port to clear data from. Must be a positive integer. |
|
||||
|
||||
**Returns:**
|
||||
|
||||
|
||||
@@ -31,8 +31,6 @@ RAM cost: 0.1 GB
|
||||
|
||||
Returns a boolean indicating whether the specified file exists on the target server. The filename for programs is case insensitive, other file types are case sensitive. For example, fileExists(“brutessh.exe”) will work fine, even though the actual program is named 'BruteSSH.exe'.
|
||||
|
||||
\*
|
||||
|
||||
## Example
|
||||
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ getPortHandle(portNumber: number): NetscriptPort;
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| portNumber | number | Port number. Must be an integer between 1 and 20. |
|
||||
| portNumber | number | Port number. Must be a positive integer. |
|
||||
|
||||
**Returns:**
|
||||
|
||||
|
||||
@@ -21,8 +21,8 @@ getRunningScript(
|
||||
| Parameter | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| filename | [FilenameOrPID](./bitburner.filenameorpid.md) | _(Optional)_ Optional. Filename or PID of the script. |
|
||||
| hostname | string | _(Optional)_ Optional. Name of host server the script is running on. |
|
||||
| args | (string \| number \| boolean)\[\] | Arguments to identify the script |
|
||||
| hostname | string | _(Optional)_ Hostname of target server. Optional, defaults to the server the calling script is running on. |
|
||||
| args | (string \| number \| boolean)\[\] | Arguments to specify/identify the script. Optional, when looking for scripts run without arguments. |
|
||||
|
||||
**Returns:**
|
||||
|
||||
@@ -34,5 +34,5 @@ The info about the running script if found, and null otherwise.
|
||||
|
||||
RAM cost: 0.3 GB
|
||||
|
||||
Running with no args returns current script. If you use a PID as the first parameter, the hostname and args parameters are unnecessary.
|
||||
Running with no args returns current script. If you use a PID as the first parameter, the hostname and args parameters are unnecessary. If hostname is omitted while filename is used as the first parameter, hostname defaults to the server the calling script is running on. Remember that a script is semi-uniquely identified by both its name and its arguments. (You can run multiple copies of scripts with the same arguments, but for the purposes of functions like this that check based on filename, the filename plus arguments forms the key.)
|
||||
|
||||
|
||||
@@ -9,14 +9,14 @@ Get all the logs of a script.
|
||||
**Signature:**
|
||||
|
||||
```typescript
|
||||
getScriptLogs(fn?: string, host?: string, ...args: (string | number | boolean)[]): string[];
|
||||
getScriptLogs(fn?: FilenameOrPID, host?: string, ...args: (string | number | boolean)[]): string[];
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| fn | string | _(Optional)_ Optional. Filename of script to get logs from. |
|
||||
| fn | [FilenameOrPID](./bitburner.filenameorpid.md) | _(Optional)_ Optional. Filename or PID of script to get logs from. |
|
||||
| host | string | _(Optional)_ Optional. Hostname of the server that the script is on. |
|
||||
| args | (string \| number \| boolean)\[\] | Arguments to identify which scripts to get logs for. |
|
||||
|
||||
@@ -32,7 +32,7 @@ RAM cost: 0 GB
|
||||
|
||||
Returns a script’s 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 game’s options. If the function is called with no arguments, it will return the current script’s 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.
|
||||
Otherwise, the PID or filename, hostname/ip, and args… arguments can be used to get logs from another script. Remember that scripts are uniquely identified by both their names and arguments.
|
||||
|
||||
## Example
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
## NS.getSharePower() method
|
||||
|
||||
Calculate your share power. Based on all the active share calls.
|
||||
Share Power has a multiplicative effect on rep/second while doing work for a faction. Share Power increases incrementally for every thread of share running on your server network, but at a sharply decreasing rate.
|
||||
|
||||
**Signature:**
|
||||
|
||||
|
||||
@@ -17,8 +17,8 @@ isRunning(script: FilenameOrPID, host?: string, ...args: (string | number | bool
|
||||
| Parameter | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| script | [FilenameOrPID](./bitburner.filenameorpid.md) | Filename or PID of script to check. This is case-sensitive. |
|
||||
| host | string | _(Optional)_ Hostname of target server. |
|
||||
| args | (string \| number \| boolean)\[\] | Arguments to specify/identify which scripts to search for. |
|
||||
| host | string | _(Optional)_ Hostname of target server. Optional, defaults to the server the calling script is running on. |
|
||||
| args | (string \| number \| boolean)\[\] | Arguments to specify/identify the script. Optional, when looking for scripts run without arguments. |
|
||||
|
||||
**Returns:**
|
||||
|
||||
@@ -30,7 +30,7 @@ True if the specified script is running on the target server, and false otherwis
|
||||
|
||||
RAM cost: 0.1 GB
|
||||
|
||||
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 semi-uniquely identified by both its name and its arguments. (You can run multiple copies of scripts with the same arguments, but for the purposes of functions like this that check based on filename, the filename plus arguments forms the key.)
|
||||
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. If hostname is omitted while filename is used as the first parameter, hostname defaults to the server the calling script is running on. Remember that a script is semi-uniquely identified by both its name and its arguments. (You can run multiple copies of scripts with the same arguments, but for the purposes of functions like this that check based on filename, the filename plus arguments forms the key.)
|
||||
|
||||
## Example
|
||||
|
||||
|
||||
@@ -26,7 +26,6 @@ export async function main(ns) {
|
||||
await ns.hack('n00dles');
|
||||
}
|
||||
```
|
||||
[ns2 in-game docs](https://bitburner-official.readthedocs.io/en/latest/netscript/netscriptjs.html) <hr> For (deprecated) .script usage, see: [ns1 in-game docs](https://bitburner-official.readthedocs.io/en/latest/netscript/netscript1.html) <hr>
|
||||
|
||||
## Properties
|
||||
|
||||
@@ -59,7 +58,7 @@ export async function main(ns) {
|
||||
| [brutessh(host)](./bitburner.ns.brutessh.md) | Runs BruteSSH.exe on a server. |
|
||||
| [clear(handle)](./bitburner.ns.clear.md) | Clear data from a file. |
|
||||
| [clearLog()](./bitburner.ns.clearlog.md) | Clears the script’s logs. |
|
||||
| [clearPort(handle)](./bitburner.ns.clearport.md) | Clear data from a port. |
|
||||
| [clearPort(portNumber)](./bitburner.ns.clearport.md) | Clear data from a port. |
|
||||
| [closeTail(pid)](./bitburner.ns.closetail.md) | Close the tail window of a script. |
|
||||
| [deleteServer(host)](./bitburner.ns.deleteserver.md) | Delete a purchased server. |
|
||||
| [disableLog(fn)](./bitburner.ns.disablelog.md) | Disables logging for the given function. |
|
||||
@@ -108,7 +107,7 @@ export async function main(ns) {
|
||||
| [getServerRequiredHackingLevel(host)](./bitburner.ns.getserverrequiredhackinglevel.md) | Returns the required hacking level of the target server. |
|
||||
| [getServerSecurityLevel(host)](./bitburner.ns.getserversecuritylevel.md) | Get server security level. |
|
||||
| [getServerUsedRam(host)](./bitburner.ns.getserverusedram.md) | Get the used RAM on a server. |
|
||||
| [getSharePower()](./bitburner.ns.getsharepower.md) | Calculate your share power. Based on all the active share calls. |
|
||||
| [getSharePower()](./bitburner.ns.getsharepower.md) | Share Power has a multiplicative effect on rep/second while doing work for a faction. Share Power increases incrementally for every thread of share running on your server network, but at a sharply decreasing rate. |
|
||||
| [getTimeSinceLastAug()](./bitburner.ns.gettimesincelastaug.md) | Returns the amount of time in milliseconds that have passed since you last installed Augmentations. |
|
||||
| [getTotalScriptExpGain()](./bitburner.ns.gettotalscriptexpgain.md) | Get the exp gain of all scripts. |
|
||||
| [getTotalScriptIncome()](./bitburner.ns.gettotalscriptincome.md) | Get the income of all scripts. |
|
||||
@@ -156,7 +155,7 @@ export async function main(ns) {
|
||||
| [setTitle(title, pid)](./bitburner.ns.settitle.md) | Set the title of the tail window of a script. |
|
||||
| [share()](./bitburner.ns.share.md) | Share the server's ram with your factions. |
|
||||
| [sleep(millis)](./bitburner.ns.sleep.md) | Suspends the script for n milliseconds. |
|
||||
| [spawn(script, threadOrOptions, args)](./bitburner.ns.spawn.md) | Terminate current script and start another in 10 seconds. |
|
||||
| [spawn(script, threadOrOptions, args)](./bitburner.ns.spawn.md) | Terminate current script and start another in a defined number of milliseconds. |
|
||||
| [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. |
|
||||
|
||||
@@ -16,7 +16,7 @@ peek(portNumber: number): PortData;
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| portNumber | number | Port to peek. Must be an integer between 1 and 20. |
|
||||
| portNumber | number | Port to peek. Must be a positive integer. |
|
||||
|
||||
**Returns:**
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ readPort(portNumber: number): PortData;
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| portNumber | number | |
|
||||
| portNumber | number | Port to read from. Must be a positive integer. |
|
||||
|
||||
**Returns:**
|
||||
|
||||
|
||||
@@ -19,5 +19,5 @@ Promise<void>
|
||||
|
||||
RAM cost: 2.4 GB
|
||||
|
||||
Increases your rep gain of all faction work types while share is called. Scales with thread count.
|
||||
Increases rep/second for all faction work while share is running. Each cycle of ns.share() is 10 seconds. Scales with thread count, but at a sharply decreasing rate.
|
||||
|
||||
|
||||
@@ -4,12 +4,12 @@
|
||||
|
||||
## NS.spawn() method
|
||||
|
||||
Terminate current script and start another in 10 seconds.
|
||||
Terminate current script and start another in a defined number of milliseconds.
|
||||
|
||||
**Signature:**
|
||||
|
||||
```typescript
|
||||
spawn(script: string, threadOrOptions?: number | RunOptions, ...args: (string | number | boolean)[]): void;
|
||||
spawn(script: string, threadOrOptions?: number | SpawnOptions, ...args: (string | number | boolean)[]): void;
|
||||
```
|
||||
|
||||
## Parameters
|
||||
@@ -17,7 +17,7 @@ spawn(script: string, threadOrOptions?: number | RunOptions, ...args: (string |
|
||||
| Parameter | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| script | string | Filename of script to execute. |
|
||||
| threadOrOptions | number \| [RunOptions](./bitburner.runoptions.md) | _(Optional)_ Either an integer number of threads for new script, or a [RunOptions](./bitburner.runoptions.md) object. Threads defaults to 1. |
|
||||
| threadOrOptions | number \| [SpawnOptions](./bitburner.spawnoptions.md) | _(Optional)_ Either an integer number of threads for new script, or a [SpawnOptions](./bitburner.spawnoptions.md) object. Threads defaults to 1. |
|
||||
| args | (string \| number \| boolean)\[\] | Additional arguments to pass into the new script that is being run. |
|
||||
|
||||
**Returns:**
|
||||
@@ -28,7 +28,7 @@ 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.
|
||||
Terminates the current script, and then after a defined delay 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.
|
||||
|
||||
@@ -38,7 +38,7 @@ Running this function with 0 or fewer threads will cause a runtime error.
|
||||
|
||||
|
||||
```js
|
||||
//The following example will execute the script ‘foo.js’ with 10 threads and the arguments ‘foodnstuff’ and 90:
|
||||
ns.spawn('foo.js', 10, 'foodnstuff', 90);
|
||||
//The following example will execute the script ‘foo.js’ with 10 threads, in 500 milliseconds and the arguments ‘foodnstuff’ and 90:
|
||||
ns.spawn('foo.js', 10, 500, 'foodnstuff', 90);
|
||||
```
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ Opens a script’s logs. This is functionally the same as the tail Terminal comm
|
||||
|
||||
If the function is called with no arguments, it will open the current script’s 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.
|
||||
Otherwise, the PID or filename, 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
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ tryWritePort(portNumber: number, data: string | number): boolean;
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| portNumber | number | Port or text file that will be written to. |
|
||||
| portNumber | number | Port to attempt to write to to. Must be a positive integer. |
|
||||
| data | string \| number | Data to write. |
|
||||
|
||||
**Returns:**
|
||||
|
||||
@@ -16,7 +16,7 @@ writePort(portNumber: number, data: string | number): PortData | null;
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| portNumber | number | |
|
||||
| portNumber | number | Port to write to. Must be a positive integer. |
|
||||
| data | string \| number | |
|
||||
|
||||
**Returns:**
|
||||
|
||||
@@ -17,7 +17,8 @@ export type NSEnums = {
|
||||
LocationName: typeof LocationName;
|
||||
ToastVariant: typeof ToastVariant;
|
||||
UniversityClassType: typeof UniversityClassType;
|
||||
CompanyName: typeof CompanyName;
|
||||
};
|
||||
```
|
||||
**References:** [CityName](./bitburner.cityname.md)<!-- -->, [CrimeType](./bitburner.crimetype.md)<!-- -->, [FactionWorkType](./bitburner.factionworktype.md)<!-- -->, [GymType](./bitburner.gymtype.md)<!-- -->, [JobName](./bitburner.jobname.md)<!-- -->, [LocationName](./bitburner.locationname.md)<!-- -->, [ToastVariant](./bitburner.toastvariant.md)<!-- -->, [UniversityClassType](./bitburner.universityclasstype.md)
|
||||
**References:** [CityName](./bitburner.cityname.md)<!-- -->, [CrimeType](./bitburner.crimetype.md)<!-- -->, [FactionWorkType](./bitburner.factionworktype.md)<!-- -->, [GymType](./bitburner.gymtype.md)<!-- -->, [JobName](./bitburner.jobname.md)<!-- -->, [LocationName](./bitburner.locationname.md)<!-- -->, [ToastVariant](./bitburner.toastvariant.md)<!-- -->, [UniversityClassType](./bitburner.universityclasstype.md)<!-- -->, [CompanyName](./bitburner.companyname.md)
|
||||
|
||||
|
||||
@@ -7,5 +7,5 @@
|
||||
**Signature:**
|
||||
|
||||
```typescript
|
||||
jobs: Record<string, string>;
|
||||
jobs: Partial<Record<CompanyName, JobName>>;
|
||||
```
|
||||
|
||||
@@ -18,7 +18,7 @@ interface Player extends Person
|
||||
| --- | --- | --- | --- |
|
||||
| [entropy](./bitburner.player.entropy.md) | | number | |
|
||||
| [factions](./bitburner.player.factions.md) | | string\[\] | |
|
||||
| [jobs](./bitburner.player.jobs.md) | | Record<string, string> | |
|
||||
| [jobs](./bitburner.player.jobs.md) | | Partial<Record<[CompanyName](./bitburner.companyname.md)<!-- -->, [JobName](./bitburner.jobname.md)<!-- -->>> | |
|
||||
| [location](./bitburner.player.location.md) | | string | |
|
||||
| [money](./bitburner.player.money.md) | | number | |
|
||||
| [numPeopleKilled](./bitburner.player.numpeoplekilled.md) | | number | |
|
||||
|
||||
@@ -19,4 +19,6 @@ interface ResetInfo
|
||||
| [currentNode](./bitburner.resetinfo.currentnode.md) | | number | The current bitnode |
|
||||
| [lastAugReset](./bitburner.resetinfo.lastaugreset.md) | | number | Numeric timestamp (from Date.now()) of last augmentation reset |
|
||||
| [lastNodeReset](./bitburner.resetinfo.lastnodereset.md) | | number | Numeric timestamp (from Date.now()) of last bitnode reset |
|
||||
| [ownedAugs](./bitburner.resetinfo.ownedaugs.md) | | Map<string, number> | A map of owned augmentations to their levels. Keyed by the augmentation name. Map values are the augmentation level (e.g. for NeuroFlux governor). |
|
||||
| [ownedSF](./bitburner.resetinfo.ownedsf.md) | | Map<number, number> | A map of owned SF to their levels. Keyed by the SF number. Map values are the SF level. |
|
||||
|
||||
|
||||
13
markdown/bitburner.resetinfo.ownedaugs.md
Normal file
13
markdown/bitburner.resetinfo.ownedaugs.md
Normal file
@@ -0,0 +1,13 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [bitburner](./bitburner.md) > [ResetInfo](./bitburner.resetinfo.md) > [ownedAugs](./bitburner.resetinfo.ownedaugs.md)
|
||||
|
||||
## ResetInfo.ownedAugs property
|
||||
|
||||
A map of owned augmentations to their levels. Keyed by the augmentation name. Map values are the augmentation level (e.g. for NeuroFlux governor).
|
||||
|
||||
**Signature:**
|
||||
|
||||
```typescript
|
||||
ownedAugs: Map<string, number>;
|
||||
```
|
||||
13
markdown/bitburner.resetinfo.ownedsf.md
Normal file
13
markdown/bitburner.resetinfo.ownedsf.md
Normal file
@@ -0,0 +1,13 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [bitburner](./bitburner.md) > [ResetInfo](./bitburner.resetinfo.md) > [ownedSF](./bitburner.resetinfo.ownedsf.md)
|
||||
|
||||
## ResetInfo.ownedSF property
|
||||
|
||||
A map of owned SF to their levels. Keyed by the SF number. Map values are the SF level.
|
||||
|
||||
**Signature:**
|
||||
|
||||
```typescript
|
||||
ownedSF: Map<number, number>;
|
||||
```
|
||||
@@ -9,14 +9,14 @@ Apply for a job at a company.
|
||||
**Signature:**
|
||||
|
||||
```typescript
|
||||
applyToCompany(companyName: string, field: string): boolean;
|
||||
applyToCompany(companyName: CompanyName | `${CompanyName}`, field: string): boolean;
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| companyName | string | Name of company to apply to. |
|
||||
| companyName | [CompanyName](./bitburner.companyname.md) \| \`${[CompanyName](./bitburner.companyname.md)<!-- -->}\` | Name of company to apply to. |
|
||||
| field | string | Field to which you want to apply. |
|
||||
|
||||
**Returns:**
|
||||
|
||||
32
markdown/bitburner.singularity.getaugmentationfactions.md
Normal file
32
markdown/bitburner.singularity.getaugmentationfactions.md
Normal file
@@ -0,0 +1,32 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [bitburner](./bitburner.md) > [Singularity](./bitburner.singularity.md) > [getAugmentationFactions](./bitburner.singularity.getaugmentationfactions.md)
|
||||
|
||||
## Singularity.getAugmentationFactions() method
|
||||
|
||||
Get a list of faction(s) that have a specific Augmentation.
|
||||
|
||||
**Signature:**
|
||||
|
||||
```typescript
|
||||
getAugmentationFactions(augName: string): string[];
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| augName | string | Name of Augmentation. |
|
||||
|
||||
**Returns:**
|
||||
|
||||
string\[\]
|
||||
|
||||
Array containing the names of all factions.
|
||||
|
||||
## Remarks
|
||||
|
||||
RAM cost: 5 GB \* 16/4/1
|
||||
|
||||
Returns an array containing the names (as strings) of all factions that offer the specified Augmentation. If no factions offer the Augmentation, a blank array is returned.
|
||||
|
||||
@@ -9,14 +9,14 @@ Get company favor.
|
||||
**Signature:**
|
||||
|
||||
```typescript
|
||||
getCompanyFavor(companyName: string): number;
|
||||
getCompanyFavor(companyName: CompanyName | `${CompanyName}`): number;
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| companyName | string | Name of the company. |
|
||||
| companyName | [CompanyName](./bitburner.companyname.md) \| \`${[CompanyName](./bitburner.companyname.md)<!-- -->}\` | Name of the company. |
|
||||
|
||||
**Returns:**
|
||||
|
||||
|
||||
@@ -9,14 +9,14 @@ Get company favor gain.
|
||||
**Signature:**
|
||||
|
||||
```typescript
|
||||
getCompanyFavorGain(companyName: string): number;
|
||||
getCompanyFavorGain(companyName: CompanyName | `${CompanyName}`): number;
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| companyName | string | Name of the company. |
|
||||
| companyName | [CompanyName](./bitburner.companyname.md) \| \`${[CompanyName](./bitburner.companyname.md)<!-- -->}\` | Name of the company. |
|
||||
|
||||
**Returns:**
|
||||
|
||||
|
||||
@@ -9,15 +9,18 @@ Get Requirements for Company Position.
|
||||
**Signature:**
|
||||
|
||||
```typescript
|
||||
getCompanyPositionInfo(companyName: string, positionName: JobName): CompanyPositionInfo;
|
||||
getCompanyPositionInfo(
|
||||
companyName: CompanyName | `${CompanyName}`,
|
||||
positionName: JobName | `${JobName}`,
|
||||
): CompanyPositionInfo;
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| companyName | string | Name of company to get the requirements for. Must be an exact match. |
|
||||
| positionName | [JobName](./bitburner.jobname.md) | Name of position to get the requirements for. Must be an exact match. |
|
||||
| companyName | [CompanyName](./bitburner.companyname.md) \| \`${[CompanyName](./bitburner.companyname.md)<!-- -->}\` | Name of company to get the requirements for. Must be an exact match. |
|
||||
| positionName | [JobName](./bitburner.jobname.md) \| \`${[JobName](./bitburner.jobname.md)<!-- -->}\` | Name of position to get the requirements for. Must be an exact match. |
|
||||
|
||||
**Returns:**
|
||||
|
||||
|
||||
@@ -9,14 +9,14 @@ Get List of Company Positions.
|
||||
**Signature:**
|
||||
|
||||
```typescript
|
||||
getCompanyPositions(companyName: string): JobName[];
|
||||
getCompanyPositions(companyName: CompanyName | `${CompanyName}`): JobName[];
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| companyName | string | Name of company to get the position list for. Must be an exact match. |
|
||||
| companyName | [CompanyName](./bitburner.companyname.md) \| \`${[CompanyName](./bitburner.companyname.md)<!-- -->}\` | Name of company to get the position list for. Must be an exact match. |
|
||||
|
||||
**Returns:**
|
||||
|
||||
|
||||
@@ -9,14 +9,14 @@ Get company reputation.
|
||||
**Signature:**
|
||||
|
||||
```typescript
|
||||
getCompanyRep(companyName: string): number;
|
||||
getCompanyRep(companyName: CompanyName | `${CompanyName}`): number;
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| companyName | string | Name of the company. |
|
||||
| companyName | [CompanyName](./bitburner.companyname.md) \| \`${[CompanyName](./bitburner.companyname.md)<!-- -->}\` | Name of the company. |
|
||||
|
||||
**Returns:**
|
||||
|
||||
|
||||
@@ -31,6 +31,7 @@ This API requires Source-File 4 to use. The RAM cost of all these functions is m
|
||||
| [exportGame()](./bitburner.singularity.exportgame.md) | Backup game save. |
|
||||
| [exportGameBonus()](./bitburner.singularity.exportgamebonus.md) | Returns Backup save bonus availability. |
|
||||
| [getAugmentationBasePrice(augName)](./bitburner.singularity.getaugmentationbaseprice.md) | Get base price of an augmentation. |
|
||||
| [getAugmentationFactions(augName)](./bitburner.singularity.getaugmentationfactions.md) | Get a list of faction(s) that have a specific Augmentation. |
|
||||
| [getAugmentationPrereq(augName)](./bitburner.singularity.getaugmentationprereq.md) | Get the pre-requisite of an augmentation. |
|
||||
| [getAugmentationPrice(augName)](./bitburner.singularity.getaugmentationprice.md) | Get price of an augmentation. |
|
||||
| [getAugmentationRepReq(augName)](./bitburner.singularity.getaugmentationrepreq.md) | Get reputation requirement of an augmentation. |
|
||||
|
||||
@@ -9,14 +9,14 @@ Quit jobs by company.
|
||||
**Signature:**
|
||||
|
||||
```typescript
|
||||
quitJob(companyName?: string): void;
|
||||
quitJob(companyName?: CompanyName | `${CompanyName}`): void;
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| companyName | string | _(Optional)_ Name of the company. |
|
||||
| companyName | [CompanyName](./bitburner.companyname.md) \| \`${[CompanyName](./bitburner.companyname.md)<!-- -->}\` | _(Optional)_ Name of the company. |
|
||||
|
||||
**Returns:**
|
||||
|
||||
|
||||
@@ -9,14 +9,14 @@ Work for a company.
|
||||
**Signature:**
|
||||
|
||||
```typescript
|
||||
workForCompany(companyName: string, focus?: boolean): boolean;
|
||||
workForCompany(companyName: CompanyName, focus?: boolean): boolean;
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| companyName | string | Name of company to work for. Must be an exact match. Optional. If not specified, this argument defaults to the last job that you worked. |
|
||||
| companyName | [CompanyName](./bitburner.companyname.md) | Name of company to work for. Must be an exact match. Optional. If not specified, this argument defaults to the last job that you worked. |
|
||||
| focus | boolean | _(Optional)_ Acquire player focus on this work operation. Optional. Defaults to true. |
|
||||
|
||||
**Returns:**
|
||||
|
||||
@@ -9,7 +9,7 @@ Set a sleeve to work for a company.
|
||||
**Signature:**
|
||||
|
||||
```typescript
|
||||
setToCompanyWork(sleeveNumber: number, companyName: string): boolean;
|
||||
setToCompanyWork(sleeveNumber: number, companyName: CompanyName | `${CompanyName}`): boolean;
|
||||
```
|
||||
|
||||
## Parameters
|
||||
@@ -17,7 +17,7 @@ setToCompanyWork(sleeveNumber: number, companyName: string): boolean;
|
||||
| Parameter | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| sleeveNumber | number | Index of the sleeve to work for the company. |
|
||||
| companyName | string | Name of the company to work for. |
|
||||
| companyName | [CompanyName](./bitburner.companyname.md) \| \`${[CompanyName](./bitburner.companyname.md)<!-- -->}\` | Name of the company to work for. |
|
||||
|
||||
**Returns:**
|
||||
|
||||
|
||||
@@ -8,5 +8,7 @@
|
||||
**Signature:**
|
||||
|
||||
```typescript
|
||||
type SleeveCompanyTask = { type: "COMPANY"; companyName: string };
|
||||
type SleeveCompanyTask = { type: "COMPANY"; companyName: CompanyName };
|
||||
```
|
||||
**References:** [CompanyName](./bitburner.companyname.md)
|
||||
|
||||
|
||||
20
markdown/bitburner.spawnoptions.md
Normal file
20
markdown/bitburner.spawnoptions.md
Normal file
@@ -0,0 +1,20 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [bitburner](./bitburner.md) > [SpawnOptions](./bitburner.spawnoptions.md)
|
||||
|
||||
## SpawnOptions interface
|
||||
|
||||
|
||||
**Signature:**
|
||||
|
||||
```typescript
|
||||
interface SpawnOptions extends RunOptions
|
||||
```
|
||||
**Extends:** [RunOptions](./bitburner.runoptions.md)
|
||||
|
||||
## Properties
|
||||
|
||||
| Property | Modifiers | Type | Description |
|
||||
| --- | --- | --- | --- |
|
||||
| [spawnDelay?](./bitburner.spawnoptions.spawndelay.md) | | number | _(Optional)_ Number of milliseconds to delay before spawning script, defaults to 10000 (10s). Must be a positive integer. |
|
||||
|
||||
13
markdown/bitburner.spawnoptions.spawndelay.md
Normal file
13
markdown/bitburner.spawnoptions.spawndelay.md
Normal file
@@ -0,0 +1,13 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [bitburner](./bitburner.md) > [SpawnOptions](./bitburner.spawnoptions.md) > [spawnDelay](./bitburner.spawnoptions.spawndelay.md)
|
||||
|
||||
## SpawnOptions.spawnDelay property
|
||||
|
||||
Number of milliseconds to delay before spawning script, defaults to 10000 (10s). Must be a positive integer.
|
||||
|
||||
**Signature:**
|
||||
|
||||
```typescript
|
||||
spawnDelay?: number;
|
||||
```
|
||||
13
markdown/bitburner.stockmarketconstants.marketdata4scost.md
Normal file
13
markdown/bitburner.stockmarketconstants.marketdata4scost.md
Normal file
@@ -0,0 +1,13 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [bitburner](./bitburner.md) > [StockMarketConstants](./bitburner.stockmarketconstants.md) > [MarketData4SCost](./bitburner.stockmarketconstants.marketdata4scost.md)
|
||||
|
||||
## StockMarketConstants.MarketData4SCost property
|
||||
|
||||
Cost of the 4S Market Data
|
||||
|
||||
**Signature:**
|
||||
|
||||
```typescript
|
||||
MarketData4SCost: number;
|
||||
```
|
||||
@@ -0,0 +1,13 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [bitburner](./bitburner.md) > [StockMarketConstants](./bitburner.stockmarketconstants.md) > [MarketDataTixApi4SCost](./bitburner.stockmarketconstants.marketdatatixapi4scost.md)
|
||||
|
||||
## StockMarketConstants.MarketDataTixApi4SCost property
|
||||
|
||||
Cost of the 4S Market Data TIX API integration
|
||||
|
||||
**Signature:**
|
||||
|
||||
```typescript
|
||||
MarketDataTixApi4SCost: number;
|
||||
```
|
||||
27
markdown/bitburner.stockmarketconstants.md
Normal file
27
markdown/bitburner.stockmarketconstants.md
Normal file
@@ -0,0 +1,27 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [bitburner](./bitburner.md) > [StockMarketConstants](./bitburner.stockmarketconstants.md)
|
||||
|
||||
## StockMarketConstants interface
|
||||
|
||||
Constants used for the stockmarket game mechanic.
|
||||
|
||||
**Signature:**
|
||||
|
||||
```typescript
|
||||
interface StockMarketConstants
|
||||
```
|
||||
|
||||
## Properties
|
||||
|
||||
| Property | Modifiers | Type | Description |
|
||||
| --- | --- | --- | --- |
|
||||
| [MarketData4SCost](./bitburner.stockmarketconstants.marketdata4scost.md) | | number | Cost of the 4S Market Data |
|
||||
| [MarketDataTixApi4SCost](./bitburner.stockmarketconstants.marketdatatixapi4scost.md) | | number | Cost of the 4S Market Data TIX API integration |
|
||||
| [msPerStockUpdate](./bitburner.stockmarketconstants.msperstockupdate.md) | | number | Normal time in ms between stock market updates |
|
||||
| [msPerStockUpdateMin](./bitburner.stockmarketconstants.msperstockupdatemin.md) | | number | Minimum time in ms between stock market updates if there is stored offline/bonus time |
|
||||
| [StockMarketCommission](./bitburner.stockmarketconstants.stockmarketcommission.md) | | number | Commission fee for transactions |
|
||||
| [TicksPerCycle](./bitburner.stockmarketconstants.tickspercycle.md) | | number | An internal constant used while determining when to flip a stock's forecast |
|
||||
| [TIXAPICost](./bitburner.stockmarketconstants.tixapicost.md) | | number | Cost of the TIX API |
|
||||
| [WSEAccountCost](./bitburner.stockmarketconstants.wseaccountcost.md) | | number | Cost of the WSE account |
|
||||
|
||||
13
markdown/bitburner.stockmarketconstants.msperstockupdate.md
Normal file
13
markdown/bitburner.stockmarketconstants.msperstockupdate.md
Normal file
@@ -0,0 +1,13 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [bitburner](./bitburner.md) > [StockMarketConstants](./bitburner.stockmarketconstants.md) > [msPerStockUpdate](./bitburner.stockmarketconstants.msperstockupdate.md)
|
||||
|
||||
## StockMarketConstants.msPerStockUpdate property
|
||||
|
||||
Normal time in ms between stock market updates
|
||||
|
||||
**Signature:**
|
||||
|
||||
```typescript
|
||||
msPerStockUpdate: number;
|
||||
```
|
||||
@@ -0,0 +1,13 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [bitburner](./bitburner.md) > [StockMarketConstants](./bitburner.stockmarketconstants.md) > [msPerStockUpdateMin](./bitburner.stockmarketconstants.msperstockupdatemin.md)
|
||||
|
||||
## StockMarketConstants.msPerStockUpdateMin property
|
||||
|
||||
Minimum time in ms between stock market updates if there is stored offline/bonus time
|
||||
|
||||
**Signature:**
|
||||
|
||||
```typescript
|
||||
msPerStockUpdateMin: number;
|
||||
```
|
||||
@@ -0,0 +1,13 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [bitburner](./bitburner.md) > [StockMarketConstants](./bitburner.stockmarketconstants.md) > [StockMarketCommission](./bitburner.stockmarketconstants.stockmarketcommission.md)
|
||||
|
||||
## StockMarketConstants.StockMarketCommission property
|
||||
|
||||
Commission fee for transactions
|
||||
|
||||
**Signature:**
|
||||
|
||||
```typescript
|
||||
StockMarketCommission: number;
|
||||
```
|
||||
13
markdown/bitburner.stockmarketconstants.tickspercycle.md
Normal file
13
markdown/bitburner.stockmarketconstants.tickspercycle.md
Normal file
@@ -0,0 +1,13 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [bitburner](./bitburner.md) > [StockMarketConstants](./bitburner.stockmarketconstants.md) > [TicksPerCycle](./bitburner.stockmarketconstants.tickspercycle.md)
|
||||
|
||||
## StockMarketConstants.TicksPerCycle property
|
||||
|
||||
An internal constant used while determining when to flip a stock's forecast
|
||||
|
||||
**Signature:**
|
||||
|
||||
```typescript
|
||||
TicksPerCycle: number;
|
||||
```
|
||||
13
markdown/bitburner.stockmarketconstants.tixapicost.md
Normal file
13
markdown/bitburner.stockmarketconstants.tixapicost.md
Normal file
@@ -0,0 +1,13 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [bitburner](./bitburner.md) > [StockMarketConstants](./bitburner.stockmarketconstants.md) > [TIXAPICost](./bitburner.stockmarketconstants.tixapicost.md)
|
||||
|
||||
## StockMarketConstants.TIXAPICost property
|
||||
|
||||
Cost of the TIX API
|
||||
|
||||
**Signature:**
|
||||
|
||||
```typescript
|
||||
TIXAPICost: number;
|
||||
```
|
||||
13
markdown/bitburner.stockmarketconstants.wseaccountcost.md
Normal file
13
markdown/bitburner.stockmarketconstants.wseaccountcost.md
Normal file
@@ -0,0 +1,13 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [bitburner](./bitburner.md) > [StockMarketConstants](./bitburner.stockmarketconstants.md) > [WSEAccountCost](./bitburner.stockmarketconstants.wseaccountcost.md)
|
||||
|
||||
## StockMarketConstants.WSEAccountCost property
|
||||
|
||||
Cost of the WSE account
|
||||
|
||||
**Signature:**
|
||||
|
||||
```typescript
|
||||
WSEAccountCost: number;
|
||||
```
|
||||
21
markdown/bitburner.tix.getconstants.md
Normal file
21
markdown/bitburner.tix.getconstants.md
Normal file
@@ -0,0 +1,21 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [bitburner](./bitburner.md) > [TIX](./bitburner.tix.md) > [getConstants](./bitburner.tix.getconstants.md)
|
||||
|
||||
## TIX.getConstants() method
|
||||
|
||||
Get game constants for the stock market mechanic.
|
||||
|
||||
**Signature:**
|
||||
|
||||
```typescript
|
||||
getConstants(): StockMarketConstants;
|
||||
```
|
||||
**Returns:**
|
||||
|
||||
[StockMarketConstants](./bitburner.stockmarketconstants.md)
|
||||
|
||||
## Remarks
|
||||
|
||||
RAM cost: 0 GB
|
||||
|
||||
@@ -21,6 +21,7 @@ export interface TIX
|
||||
| [cancelOrder(sym, shares, price, type, pos)](./bitburner.tix.cancelorder.md) | Cancel order for stocks. |
|
||||
| [getAskPrice(sym)](./bitburner.tix.getaskprice.md) | Returns the ask price of that stock. |
|
||||
| [getBidPrice(sym)](./bitburner.tix.getbidprice.md) | Returns the bid price of that stock. |
|
||||
| [getConstants()](./bitburner.tix.getconstants.md) | Get game constants for the stock market mechanic. |
|
||||
| [getForecast(sym)](./bitburner.tix.getforecast.md) | Returns the probability that the specified stock’s price will increase (as opposed to decrease) during the next tick. |
|
||||
| [getMaxShares(sym)](./bitburner.tix.getmaxshares.md) | Returns the maximum number of shares of a stock. |
|
||||
| [getOrders()](./bitburner.tix.getorders.md) | Returns your order book for the stock market. |
|
||||
|
||||
@@ -28,7 +28,7 @@ sellProduct(
|
||||
| productName | string | Name of the product |
|
||||
| amt | string | Amount to sell, can be "MAX" |
|
||||
| price | string | Price to sell, can be "MP" |
|
||||
| all | boolean | Sell in all city |
|
||||
| all | boolean | Set sell amount and price in all cities |
|
||||
|
||||
**Returns:**
|
||||
|
||||
|
||||
@@ -7,7 +7,12 @@
|
||||
**Signature:**
|
||||
|
||||
```typescript
|
||||
companyGains(person: Person, companyName: string, workType: JobName | `${JobName}`, favor: number): WorkStats;
|
||||
companyGains(
|
||||
person: Person,
|
||||
companyName: CompanyName | `${CompanyName}`,
|
||||
workType: JobName | `${JobName}`,
|
||||
favor: number,
|
||||
): WorkStats;
|
||||
```
|
||||
|
||||
## Parameters
|
||||
@@ -15,7 +20,7 @@ companyGains(person: Person, companyName: string, workType: JobName | `${JobName
|
||||
| Parameter | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| person | [Person](./bitburner.person.md) | |
|
||||
| companyName | string | |
|
||||
| companyName | [CompanyName](./bitburner.companyname.md) \| \`${[CompanyName](./bitburner.companyname.md)<!-- -->}\` | |
|
||||
| workType | [JobName](./bitburner.jobname.md) \| \`${[JobName](./bitburner.jobname.md)<!-- -->}\` | |
|
||||
| favor | number | |
|
||||
|
||||
|
||||
16
package-lock.json
generated
16
package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "bitburner",
|
||||
"version": "2.3.2dev",
|
||||
"version": "2.5.0",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "bitburner",
|
||||
"version": "2.3.2dev",
|
||||
"version": "2.5.0",
|
||||
"hasInstallScript": true,
|
||||
"license": "SEE LICENSE IN license.txt",
|
||||
"dependencies": {
|
||||
@@ -6233,9 +6233,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/caniuse-lite": {
|
||||
"version": "1.0.30001473",
|
||||
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001473.tgz",
|
||||
"integrity": "sha512-ewDad7+D2vlyy+E4UJuVfiBsU69IL+8oVmTuZnH5Q6CIUbxNfI50uVpRHbUPDD6SUaN2o0Lh4DhTrvLG/Tn1yg==",
|
||||
"version": "1.0.30001539",
|
||||
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001539.tgz",
|
||||
"integrity": "sha512-hfS5tE8bnNiNvEOEkm8HElUHroYwlqMMENEzELymy77+tJ6m+gA2krtHl5hxJaj71OlpC2cHZbdSMX1/YEqEkA==",
|
||||
"funding": [
|
||||
{
|
||||
"type": "opencollective",
|
||||
@@ -22616,9 +22616,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"caniuse-lite": {
|
||||
"version": "1.0.30001473",
|
||||
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001473.tgz",
|
||||
"integrity": "sha512-ewDad7+D2vlyy+E4UJuVfiBsU69IL+8oVmTuZnH5Q6CIUbxNfI50uVpRHbUPDD6SUaN2o0Lh4DhTrvLG/Tn1yg=="
|
||||
"version": "1.0.30001539",
|
||||
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001539.tgz",
|
||||
"integrity": "sha512-hfS5tE8bnNiNvEOEkm8HElUHroYwlqMMENEzELymy77+tJ6m+gA2krtHl5hxJaj71OlpC2cHZbdSMX1/YEqEkA=="
|
||||
},
|
||||
"ccount": {
|
||||
"version": "2.0.1",
|
||||
|
||||
13
package.json
13
package.json
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "bitburner",
|
||||
"license": "SEE LICENSE IN license.txt",
|
||||
"version": "2.3.2dev",
|
||||
"version": "2.5.0",
|
||||
"main": "electron-main.js",
|
||||
"author": {
|
||||
"name": "Daniel Xie, Olivier Gagnon, et al."
|
||||
@@ -102,16 +102,16 @@
|
||||
"engines": {
|
||||
"node": ">=14"
|
||||
},
|
||||
"homepage": "https://github.com/danielyxie/bitburner",
|
||||
"homepage": "https://bitburner-official.github.io/",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/danielyxie/bitburner.git"
|
||||
"url": "git+https://github.com/bitburner-official/bitburner-src.git"
|
||||
},
|
||||
"scripts": {
|
||||
"doc": "npx api-extractor run && npx api-documenter markdown && rm input/bitburner.api.json && rm -r input && git add markdown/ && git add tsdoc-metadata.json",
|
||||
"doc": "bash ./tools/doc.sh",
|
||||
"format": "prettier -c --write .",
|
||||
"format:report": "prettier -c .",
|
||||
"start": "cd .app && http-server -p 8000",
|
||||
"start": "electron .app/index.html",
|
||||
"start:dev": "webpack serve --progress --env devServer --mode development",
|
||||
"build": "bash ./tools/build.sh production",
|
||||
"build:dev": "bash ./tools/build.sh development",
|
||||
@@ -127,7 +127,6 @@
|
||||
"preversion": "npm install && npm run test",
|
||||
"version": "sh ./tools/build-release.sh && git add --all",
|
||||
"postversion": "git push -u origin dev && git push --tags",
|
||||
"changelog": "node tools/fetch-changelog/index.js --from=$(cat last_changelog_hash) > changelog.md",
|
||||
"bundle-doc": "node tools/bundle-doc/index.js"
|
||||
"changelog": "node tools/fetch-changelog/index.js --from=$(cat last_changelog_hash) > changelog.md"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -322,7 +322,7 @@ export const achievements: Record<string, Achievement> = {
|
||||
WORKOUT: {
|
||||
...achievementData.WORKOUT,
|
||||
Icon: "WORKOUT",
|
||||
Condition: () => isClassWork(Player.currentWork),
|
||||
Condition: () => isClassWork(Player.currentWork) && Player.currentWork.isGym(),
|
||||
},
|
||||
TOR: {
|
||||
...achievementData.TOR,
|
||||
|
||||
78
src/Alias.ts
78
src/Alias.ts
@@ -65,39 +65,51 @@ export function removeAlias(name: string): boolean {
|
||||
/**
|
||||
* Returns the original string with any aliases substituted in.
|
||||
* Aliases are only applied to "whole words", one level deep
|
||||
* @param origCommand the original command string
|
||||
*/
|
||||
export function substituteAliases(origCommand: string): string {
|
||||
const commandArray = origCommand.split(" ");
|
||||
if (commandArray.length > 0) {
|
||||
// For the alias and unalias commands, don't substitute
|
||||
if (commandArray[0] === "unalias" || commandArray[0] === "alias") {
|
||||
return commandArray.join(" ");
|
||||
}
|
||||
|
||||
let somethingSubstituted = true;
|
||||
let depth = 0;
|
||||
let lastAlias;
|
||||
|
||||
while (somethingSubstituted && depth < 10) {
|
||||
depth++;
|
||||
somethingSubstituted = false;
|
||||
const alias = Aliases.get(commandArray[0])?.split(" ");
|
||||
if (alias !== undefined) {
|
||||
somethingSubstituted = true;
|
||||
commandArray.splice(0, 1, ...alias);
|
||||
//commandArray[0] = alias;
|
||||
}
|
||||
for (let i = 0; i < commandArray.length; ++i) {
|
||||
const alias = GlobalAliases.get(commandArray[i])?.split(" ");
|
||||
if (alias !== undefined && (commandArray[i] != lastAlias || somethingSubstituted)) {
|
||||
somethingSubstituted = true;
|
||||
lastAlias = commandArray[i];
|
||||
commandArray.splice(i, 1, ...alias);
|
||||
i += alias.length - 1;
|
||||
//commandArray[i] = alias;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return commandArray.join(" ");
|
||||
return applyAliases(origCommand);
|
||||
}
|
||||
|
||||
/**
|
||||
* Recursively evaluates aliases and applies them to the command string,
|
||||
* unless there are any reference loops or the reference chain is too deep
|
||||
* @param origCommand the original command string
|
||||
* @param depth the current recursion depth
|
||||
* @param currentlyProcessingAliases any aliases that have been applied in the recursive evaluation leading to this point
|
||||
* @return { string } the provided command with all of its referenced aliases evaluated
|
||||
*/
|
||||
function applyAliases(origCommand: string, depth = 0, currentlyProcessingAliases: string[] = []) {
|
||||
if (!origCommand) {
|
||||
return origCommand;
|
||||
}
|
||||
const commandArray = origCommand.split(" ");
|
||||
|
||||
// Do not apply aliases when defining a new alias
|
||||
if (commandArray[0] === "unalias" || commandArray[0] === "alias") {
|
||||
return commandArray.join(" ");
|
||||
}
|
||||
|
||||
// First get non-global aliases, and recursively apply them
|
||||
// (unless there are any reference loops or the reference chain is too deep)
|
||||
const localAlias = Aliases.get(commandArray[0]);
|
||||
if (localAlias && !currentlyProcessingAliases.includes(localAlias)) {
|
||||
const appliedAlias = applyAliases(localAlias, depth + 1, [commandArray[0], ...currentlyProcessingAliases]);
|
||||
commandArray.splice(0, 1, ...appliedAlias.split(" "));
|
||||
}
|
||||
|
||||
// Once local aliasing is complete (or if none are present) handle any global aliases
|
||||
const processedCommands = commandArray.reduce((resolvedCommandArray: string[], command) => {
|
||||
const globalAlias = GlobalAliases.get(command);
|
||||
if (globalAlias && !currentlyProcessingAliases.includes(globalAlias)) {
|
||||
const appliedAlias = applyAliases(globalAlias, depth + 1, [command, ...currentlyProcessingAliases]);
|
||||
resolvedCommandArray.push(appliedAlias);
|
||||
} else {
|
||||
// If there is no alias, or if the alias has a circular reference, leave the command as-is
|
||||
resolvedCommandArray.push(command);
|
||||
}
|
||||
return resolvedCommandArray;
|
||||
}, []);
|
||||
|
||||
return processedCommands.join(" ");
|
||||
}
|
||||
|
||||
@@ -227,4 +227,8 @@ export class Augmentation {
|
||||
const queuedNFGLevel = Player.queuedAugmentations.filter((aug) => aug.name === this.name).length;
|
||||
return ownedNFGLevel + queuedNFGLevel;
|
||||
}
|
||||
/** Get the next level of an augmentation to buy. Currently only relevant for NFG. */
|
||||
getNextLevel(): number {
|
||||
return this.getLevel() + 1;
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user