mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-17 06:48:42 +02:00
Compare commits
213 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d2c7b2504c | ||
|
|
175af0bd28 | ||
|
|
8deb907b89 | ||
|
|
36e3dd73ac | ||
|
|
585e089976 | ||
|
|
7a4a973c06 | ||
|
|
1d8a1d5089 | ||
|
|
7113ee5425 | ||
|
|
38d99ff15e | ||
|
|
b7962ad8ab | ||
|
|
ed308b4fa6 | ||
|
|
574c284321 | ||
|
|
9dc3b22919 | ||
|
|
25afecc0ec | ||
|
|
7f5bc5700e | ||
|
|
da6262c856 | ||
|
|
1288d1c289 | ||
|
|
e478b9a224 | ||
|
|
7ee7a79763 | ||
|
|
519b4fef44 | ||
|
|
e23db93c8b | ||
|
|
1b8205e9d5 | ||
|
|
52111f6e07 | ||
|
|
8ebfcdb089 | ||
|
|
19984a6f22 | ||
|
|
b88361921e | ||
|
|
591ad45154 | ||
|
|
b53c35126e | ||
|
|
35c32e2871 | ||
|
|
e55387df4d | ||
|
|
2414949c2c | ||
|
|
309cd55085 | ||
|
|
8289b23cff | ||
|
|
aef362204d | ||
|
|
bfb9841832 | ||
|
|
6f009679ad | ||
|
|
6a1691fe54 | ||
|
|
bc71b8e18f | ||
|
|
a79d7f9e45 | ||
|
|
478646290e | ||
|
|
5696db2788 | ||
|
|
d4bdb8de2b | ||
|
|
4d3dbf169d | ||
|
|
dc4a85e591 | ||
|
|
de8883ed0f | ||
|
|
3fac471d51 | ||
|
|
0f23c95737 | ||
|
|
f4fcb5cde1 | ||
|
|
e56ed353e5 | ||
|
|
d3b9f32c3f | ||
|
|
384d1c1a2b | ||
|
|
7a1fce6f64 | ||
|
|
eba86e4bf0 | ||
|
|
a3f9a5c21e | ||
|
|
703e7c52ae | ||
|
|
7b993f3550 | ||
|
|
216500ed32 | ||
|
|
dd3975ab1d | ||
|
|
ed59f325ef | ||
|
|
057ccc2a2b | ||
|
|
1ad6f9f310 | ||
|
|
104a97d711 | ||
|
|
be437c83f6 | ||
|
|
7ae309edda | ||
|
|
7ab4ad8174 | ||
|
|
524714601e | ||
|
|
da7f01cca9 | ||
|
|
6c9555ba32 | ||
|
|
6beb6e9f95 | ||
|
|
61274310d6 | ||
|
|
12f9a2b24d | ||
|
|
c467daaf86 | ||
|
|
a923041382 | ||
|
|
ae1ca8f9a6 | ||
|
|
6669c4da6a | ||
|
|
5f1a94a9d3 | ||
|
|
fe87f1f628 | ||
|
|
8553bcb8fc | ||
|
|
75dabd10be | ||
|
|
d8de22a273 | ||
|
|
714c1cc9d6 | ||
|
|
08097aaf09 | ||
|
|
db226ce0b8 | ||
|
|
c5581e92bc | ||
|
|
7c4cd7ef86 | ||
|
|
28a4af0ddc | ||
|
|
0c2a59bb6c | ||
|
|
99f7a4cc7b | ||
|
|
35a34470a2 | ||
|
|
c637d0e4e4 | ||
|
|
803afc5244 | ||
|
|
bbd942ceca | ||
|
|
1e5f7184a2 | ||
|
|
fc8958af83 | ||
|
|
6b9f9ef7fa | ||
|
|
dd4b54406c | ||
|
|
d81358c80f | ||
|
|
6aaeb6b59e | ||
|
|
edf8e24046 | ||
|
|
c0662599b3 | ||
|
|
7ef7b692d0 | ||
|
|
25ac8432fc | ||
|
|
0457081908 | ||
|
|
162310f005 | ||
|
|
c703b71871 | ||
|
|
e9d1ddfaf3 | ||
|
|
4d5401f62e | ||
|
|
de5c1bbf98 | ||
|
|
c93205fec6 | ||
|
|
09c5ec7769 | ||
|
|
33af6685f8 | ||
|
|
d2dd6916b1 | ||
|
|
863ac2c8c0 | ||
|
|
1547581c24 | ||
|
|
1755b7cd7f | ||
|
|
0bf01aacab | ||
|
|
69babf02b2 | ||
|
|
d61e12fdd1 | ||
|
|
4aaf845fca | ||
|
|
4f4c6fe7e5 | ||
|
|
d801743842 | ||
|
|
a5f5c81912 | ||
|
|
65082f677e | ||
|
|
ffc34387f0 | ||
|
|
6a3d22d7bd | ||
|
|
4c7f192645 | ||
|
|
6288eec6d7 | ||
|
|
3d6692b292 | ||
|
|
153dbfff12 | ||
|
|
483d554fc2 | ||
|
|
91105c6d8c | ||
|
|
373ced2efe | ||
|
|
f6871f0911 | ||
|
|
d00fad472e | ||
|
|
b655b7a44e | ||
|
|
1577467fe1 | ||
|
|
ac05135f59 | ||
|
|
47cf5c1610 | ||
|
|
e6755afcb3 | ||
|
|
27a8abbdec | ||
|
|
aba2336093 | ||
|
|
9b483bdd8a | ||
|
|
8c8af38a3a | ||
|
|
93b9a10e41 | ||
|
|
22aec2a8b9 | ||
|
|
ef334cb851 | ||
|
|
c894aba8f5 | ||
|
|
ddb10f833c | ||
|
|
733f2ccb5b | ||
|
|
dc7c9bb065 | ||
|
|
b79df29ef4 | ||
|
|
078f94cbc0 | ||
|
|
0ba337f091 | ||
|
|
fca414e7c9 | ||
|
|
ca374076b8 | ||
|
|
84c4dba1e2 | ||
|
|
fccc27fe58 | ||
|
|
65214c0322 | ||
|
|
903f812424 | ||
|
|
e8311d4f05 | ||
|
|
8c2a23f2ba | ||
|
|
fbc41d0278 | ||
|
|
e966e78b72 | ||
|
|
4d551915b3 | ||
|
|
fd5b0f8241 | ||
|
|
6bd50e6f24 | ||
|
|
9697a82e0c | ||
|
|
187226a30f | ||
|
|
2f2355942f | ||
|
|
330a32e1d0 | ||
|
|
011d5e8fd6 | ||
|
|
5277db2c65 | ||
|
|
497618dc2f | ||
|
|
0ded11af53 | ||
|
|
cf45981cd2 | ||
|
|
55e21d1e19 | ||
|
|
b6b4788845 | ||
|
|
05295598a4 | ||
|
|
cb7c75a3ce | ||
|
|
51ac4d009c | ||
|
|
f79470148e | ||
|
|
788a7549da | ||
|
|
39c5a356b1 | ||
|
|
157ff8ea88 | ||
|
|
d0e66d5be2 | ||
|
|
2ac0470cea | ||
|
|
c5ca30d796 | ||
|
|
63574bca0c | ||
|
|
44f0a77c4e | ||
|
|
87c4cbbc57 | ||
|
|
6f8a59593a | ||
|
|
82511e5030 | ||
|
|
7017f3c2f8 | ||
|
|
f0f335e09a | ||
|
|
a433c8284c | ||
|
|
9827fda4a4 | ||
|
|
dd9ace7891 | ||
|
|
1b03618555 | ||
|
|
68a8427838 | ||
|
|
7e721c144e | ||
|
|
0da9d9d3c0 | ||
|
|
8742df9588 | ||
|
|
4db4b77954 | ||
|
|
1dac133ef4 | ||
|
|
e096456c29 | ||
|
|
eba840dcd3 | ||
|
|
550829a1c3 | ||
|
|
ccf0aa4771 | ||
|
|
e7b68676f5 | ||
|
|
498bb6128a | ||
|
|
a42b72d31a | ||
|
|
489ba595f3 | ||
|
|
7ef12a0323 |
191
.git_blame_ignore_revs
Normal file
191
.git_blame_ignore_revs
Normal file
@@ -0,0 +1,191 @@
|
|||||||
|
## What is this?
|
||||||
|
## Some git commits contain mostly prettier/lint changes and aren't as valuable when
|
||||||
|
## using `git blame`. This file contains a list of hashes that identify such commits
|
||||||
|
## in a way that git can use.
|
||||||
|
|
||||||
|
## Tell git to use this file with:
|
||||||
|
## git config --local blame.ignoreRevsFile .git_blame_ignore_revs
|
||||||
|
|
||||||
|
## This file was created by cleaning up and filtering the output of this command line:
|
||||||
|
## git log --grep "[Pp]rettier"
|
||||||
|
|
||||||
|
## All that's really needed here are the actual 40-digit hashes of
|
||||||
|
## the commits. I left the author/date info in as it helped when I
|
||||||
|
## was filtering this list to just formatting changes.
|
||||||
|
|
||||||
|
4c9ca4990450740785a4dc95a75de53aeac724df
|
||||||
|
# Author: omuretsu
|
||||||
|
# Date: Fri Jun 23 10:14:18 2023 -0400
|
||||||
|
|
||||||
|
07b1eefe33b16251e0e67ae3231db2059defb1cc
|
||||||
|
# Author: omuretsu
|
||||||
|
# Date: Tue Feb 7 21:16:18 2023 -0500
|
||||||
|
|
||||||
|
bbe6421b067b0d0b876c42e49dafcbbb6458ef8d
|
||||||
|
# Author: borisflagell
|
||||||
|
# Date: Tue Oct 11 15:33:55 2022 +0300
|
||||||
|
|
||||||
|
ed0a28d29272ba2d5716618b73d231bca1ad79d1
|
||||||
|
# Author: hydroflame
|
||||||
|
# Date: Sun Oct 9 00:22:25 2022 -0400
|
||||||
|
|
||||||
|
a1f90d77ce708efb968d7e7ddb804b9862f2f460
|
||||||
|
# Author: Snarling
|
||||||
|
# Date: Tue Sep 27 19:58:14 2022 -0400
|
||||||
|
|
||||||
|
6be884a9ad42e9920be233302a066dea01766c8e
|
||||||
|
# Author: borisflagell
|
||||||
|
# Date: Sat May 28 01:15:05 2022 +0200
|
||||||
|
|
||||||
|
51ba358464ce5787ef472531e0bdb2b6b239955e
|
||||||
|
# Author: Markus-D-M
|
||||||
|
# Date: Wed May 25 21:27:58 2022 +0200
|
||||||
|
|
||||||
|
9091441389182a261438ec16ea17edcf11ab6f39
|
||||||
|
# Author: borisflagell
|
||||||
|
# Date: Mon May 23 19:43:46 2022 +0200
|
||||||
|
|
||||||
|
5bc1d293ca14f717d967ff4a345fe1ace1ffdd4c
|
||||||
|
# Author: borisflagell
|
||||||
|
# Date: Sun May 22 11:59:14 2022 +0200
|
||||||
|
|
||||||
|
d44d71712f066518321cefed18e145141ea23818
|
||||||
|
# Author: borisflagell
|
||||||
|
# Date: Sun May 22 06:40:32 2022 +0200
|
||||||
|
|
||||||
|
bd2d5396a60f31c1bd9837786fb10586cbcc6eda
|
||||||
|
# Author: phyzical
|
||||||
|
# Date: Thu Apr 28 19:22:37 2022 +0800
|
||||||
|
|
||||||
|
ad4c84be937224297f6745b6df3d433466b047c1
|
||||||
|
# Author: borisflagell
|
||||||
|
# Date: Sat Apr 23 15:18:43 2022 +0200
|
||||||
|
|
||||||
|
d4f8f2d0354832101f48d60f0b3445cc1f43dd23
|
||||||
|
# Author: borisflagell
|
||||||
|
# Date: Sat Apr 23 15:01:24 2022 +0200
|
||||||
|
|
||||||
|
a7045a234353de795494c0b3f378808b4a6d32aa
|
||||||
|
# Author: borisflagell
|
||||||
|
# Date: Thu Apr 21 19:20:16 2022 +0200
|
||||||
|
|
||||||
|
421e7b8c74eb85238ccf45b1a83225a452024058
|
||||||
|
# Author: borisflagell
|
||||||
|
# Date: Thu Apr 21 18:51:04 2022 +0200
|
||||||
|
|
||||||
|
9850b56711b29c254102ad8694b1610b4d5adc81
|
||||||
|
# Author: Snarling
|
||||||
|
# Date: Sun Apr 17 17:23:14 2022 -0400
|
||||||
|
|
||||||
|
567fcf8fb63bc469ae61013cca511a76eb6f9086
|
||||||
|
# Author: violet
|
||||||
|
# Date: Wed Apr 13 14:42:07 2022 -0500
|
||||||
|
|
||||||
|
f6af85a38d8286aec702556f1296565de5a5067f
|
||||||
|
# Author: violet
|
||||||
|
# Date: Sun Apr 10 15:57:34 2022 -0500
|
||||||
|
|
||||||
|
57f04d3911b5a384c379dcfb2d0bcb18b25c37ea
|
||||||
|
# Author: violet
|
||||||
|
# Date: Thu Apr 7 11:45:21 2022 -0500
|
||||||
|
|
||||||
|
720e2112c6766b581e43e1f9e712c47300b22dcd
|
||||||
|
# Author: violet
|
||||||
|
# Date: Mon Mar 21 14:40:17 2022 -0500
|
||||||
|
|
||||||
|
ecffc8655a70e6e3c7bd03ba5723b437d7857dfa
|
||||||
|
Merge: 8506dcfed 00d1d294e
|
||||||
|
# Author: hydroflame
|
||||||
|
# Date: Sun Mar 20 22:21:00 2022 -0400
|
||||||
|
|
||||||
|
901ee92fe97606bd27840900512b0fa760ba428e
|
||||||
|
# Author: Olivier Gagnon
|
||||||
|
# Date: Sun Mar 20 22:02:36 2022 -0400
|
||||||
|
|
||||||
|
b3f9380ebd3feb3b6ef91873a1c6a3a1ddc56654
|
||||||
|
# Author: Billy Vong
|
||||||
|
# Date: Fri Dec 17 12:56:48 2021 -0500
|
||||||
|
|
||||||
|
# I *really* didn't want to include this one because it has a few tiny, actual
|
||||||
|
# code changes, but it reformats tens of thousands of lines of code. Argh.
|
||||||
|
8f13363466c2e825bbfb7e4b66d853c4805eda61
|
||||||
|
# Author: Olivier Gagnon
|
||||||
|
# Date: Mon Oct 11 16:38:50 2021 -0400
|
||||||
|
|
||||||
|
66a2adaeb4b12a48fc8fdafe5e5169919f8d46a5
|
||||||
|
# Author: Olivier Gagnon
|
||||||
|
# Date: Wed Sep 22 12:56:55 2021 -0400
|
||||||
|
|
||||||
|
## Additional changes that should be ignored for blame.
|
||||||
|
|
||||||
|
2e7f164b5f251ce457f0d3b9a42cfa0f08ef200e
|
||||||
|
# Author: tyasuh.taeragan
|
||||||
|
# Date: Fri Oct 22 16:35:05 2021 -0400
|
||||||
|
|
||||||
|
a18bdd6afc77752bded2f0794bf35ad9d6455fa1
|
||||||
|
# Author: Olivier Gagnon
|
||||||
|
# Date: Sat Sep 4 19:09:30 2021 -0400
|
||||||
|
|
||||||
|
# from a search for "lint"; many more of these had significant code changes than
|
||||||
|
# Prettier, so I'm only vetting the largest for inclusion
|
||||||
|
|
||||||
|
48f80f25d6fb90edc292481905814c0d5593b5a9
|
||||||
|
# Author: Olivier Gagnon
|
||||||
|
# Date: Wed Apr 6 19:30:08 2022 -0400
|
||||||
|
|
||||||
|
b0f20c8c8f4859f01cfc79bc3945a8e7272d6592
|
||||||
|
# Author: Olivier Gagnon
|
||||||
|
# Date: Sat Sep 25 01:26:03 2021 -0400
|
||||||
|
|
||||||
|
d745150c45979ab251b51447a0847e28966346a6
|
||||||
|
# Author: Olivier Gagnon
|
||||||
|
# Date: Sat May 1 03:17:31 2021 -0400
|
||||||
|
|
||||||
|
3fad5050961a3259b0158763f48016174a2a690e
|
||||||
|
# Author: Olivier Gagnon
|
||||||
|
# Date: Thu Apr 29 23:52:56 2021 -0400
|
||||||
|
|
||||||
|
#
|
||||||
|
# The commits listed below showed up on a search for "[Pp]rettier", but
|
||||||
|
# weren't just Prettier/lint changes.
|
||||||
|
#
|
||||||
|
|
||||||
|
# 6459b1ab483cf66ae1e6e50518424311c6bbbd8b
|
||||||
|
# Author: omuretsu
|
||||||
|
# Date: Sat Feb 4 07:42:35 2023 -0500
|
||||||
|
|
||||||
|
# 5b4addbb212411aa1de27ba0ee16ebaabedbc6a1
|
||||||
|
# Author: borisflagell
|
||||||
|
# Date: Sun May 22 01:08:53 2022 +0200
|
||||||
|
|
||||||
|
# 705a56f3bdcb859179144cdafab7eeb8832f7eb9
|
||||||
|
# Author: borisflagell
|
||||||
|
# Date: Sat May 7 12:55:56 2022 +0200
|
||||||
|
|
||||||
|
# 4fa65322fe770dc3d79cd0301521d230694a1fc7
|
||||||
|
# Author: borisflagell
|
||||||
|
# Date: Thu Apr 21 18:37:47 2022 +0200
|
||||||
|
|
||||||
|
# 81d1c02fdfe087c3bd0a2a8a2a41c2f82a6fef56
|
||||||
|
# Author: hydroflame
|
||||||
|
# Date: Sun Mar 20 22:50:42 2022 -0400
|
||||||
|
|
||||||
|
# 4a7fcda86f5d3d05638b4a9f3a61e5937dde52c6
|
||||||
|
# Author: hydroflame
|
||||||
|
# Date: Sat Sep 4 19:03:05 2021 -0400
|
||||||
|
|
||||||
|
# 7ee2612c17a90a80e5a0a7793a4c81465e212c0c
|
||||||
|
# Author: Martin Fournier
|
||||||
|
# Date: Sun Jan 9 11:15:09 2022 -0500
|
||||||
|
|
||||||
|
# c59806c87d543c7cc78d1d68af9599d118c0cb2b
|
||||||
|
# Author: Martin Fournier
|
||||||
|
# Date: Fri Dec 17 09:54:32 2021 -0500
|
||||||
|
|
||||||
|
# 306facc0d10104d543974d5cb01b6ff419c9acb2
|
||||||
|
# Author: David Edmondson
|
||||||
|
# Date: Sat Sep 4 22:17:30 2021 -0700
|
||||||
|
|
||||||
|
# 1e42f73e2a1b7ac9489a7287c7be99298f412ac0
|
||||||
|
# Author: David Edmondson
|
||||||
|
# Date: Sat Sep 4 13:18:08 2021 -0700commit 2e7f164b5f251ce457f0d3b9a42cfa0f08ef200e
|
||||||
@@ -15,3 +15,5 @@ markdown
|
|||||||
package.json
|
package.json
|
||||||
package.lock.json
|
package.lock.json
|
||||||
tsdoc-metadata.json
|
tsdoc-metadata.json
|
||||||
|
|
||||||
|
.git_blame_ignore_revs
|
||||||
|
|||||||
@@ -1,10 +1,13 @@
|
|||||||
import JSDOMEnvironment from "jest-environment-jsdom";
|
import JSDOMEnvironment from "jest-environment-jsdom";
|
||||||
|
import { cloneDeep } from "lodash";
|
||||||
|
|
||||||
// https://github.com/facebook/jest/blob/v29.4.3/website/versioned_docs/version-29.4/Configuration.md#testenvironment-string
|
// https://github.com/facebook/jest/blob/v29.4.3/website/versioned_docs/version-29.4/Configuration.md#testenvironment-string
|
||||||
export default class FixJSDOMEnvironment extends JSDOMEnvironment {
|
export default class FixJSDOMEnvironment extends JSDOMEnvironment {
|
||||||
constructor(...args: ConstructorParameters<typeof JSDOMEnvironment>) {
|
constructor(...args: ConstructorParameters<typeof JSDOMEnvironment>) {
|
||||||
super(...args);
|
super(...args);
|
||||||
|
|
||||||
|
// TODO Tests aren't polyfilled.
|
||||||
|
this.global.structuredClone = cloneDeep;
|
||||||
// FIXME https://github.com/nodejs/node/issues/35889
|
// FIXME https://github.com/nodejs/node/issues/35889
|
||||||
// Add missing importActual() function to mirror requireActual(),
|
// Add missing importActual() function to mirror requireActual(),
|
||||||
// which lets us work around the ESM bug.
|
// which lets us work around the ESM bug.
|
||||||
|
|||||||
@@ -207,9 +207,17 @@ the following rules:
|
|||||||
- Ensure you have run `npm run lint` to make sure your changes conform to the
|
- Ensure you have run `npm run lint` to make sure your changes conform to the
|
||||||
rules enforced across the code base. The command will fail if any of the
|
rules enforced across the code base. The command will fail if any of the
|
||||||
linters find a violation.
|
linters find a violation.
|
||||||
|
- Ensure you have run `npm run format` to make sure your changes conform to the
|
||||||
|
style guide.
|
||||||
|
- Also, ensure you have run `npm run test` to make sure your changes pass
|
||||||
|
the automated tests.
|
||||||
- Do not check in any bundled files (`dist\*.bundle.js`) or the `index.html`
|
- Do not check in any bundled files (`dist\*.bundle.js`) or the `index.html`
|
||||||
in the root of the repository. These will be updated as part of official
|
in the root of the repository. These will be updated as part of official
|
||||||
releases.
|
releases.
|
||||||
|
- The title of your Pull Request will need to be formatted like
|
||||||
|
`MISC: Reticulated the splines`, where the first word must be capitalised
|
||||||
|
and relate to the kind of change being implemented. Possible examples
|
||||||
|
are UI, BUGFIX, SERVERS, NETSCRIPT... You get the idea.
|
||||||
|
|
||||||
## As a Documenter
|
## As a Documenter
|
||||||
|
|
||||||
|
|||||||
@@ -44,6 +44,9 @@ async function createWindow(killall) {
|
|||||||
window.removeMenu();
|
window.removeMenu();
|
||||||
noScripts = killall ? { query: { noScripts: killall } } : {};
|
noScripts = killall ? { query: { noScripts: killall } } : {};
|
||||||
window.loadFile("index.html", noScripts);
|
window.loadFile("index.html", noScripts);
|
||||||
|
window.once("ready-to-show", () => {
|
||||||
|
utils.setZoomFactor(window, utils.getZoomFactor());
|
||||||
|
});
|
||||||
window.show();
|
window.show();
|
||||||
if (debug) window.webContents.openDevTools();
|
if (debug) window.webContents.openDevTools();
|
||||||
|
|
||||||
@@ -60,7 +63,6 @@ async function createWindow(killall) {
|
|||||||
|
|
||||||
achievements.enableAchievementsInterval(window);
|
achievements.enableAchievementsInterval(window);
|
||||||
utils.attachUnresponsiveAppHandler(window);
|
utils.attachUnresponsiveAppHandler(window);
|
||||||
utils.setZoomFactor(window);
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await api.initialize(window);
|
await api.initialize(window);
|
||||||
|
|||||||
@@ -1,7 +1,24 @@
|
|||||||
/* eslint-disable no-process-exit */
|
/* eslint-disable no-process-exit */
|
||||||
/* eslint-disable @typescript-eslint/no-var-requires */
|
/* eslint-disable @typescript-eslint/no-var-requires */
|
||||||
const { app, dialog, BrowserWindow, ipcMain, protocol } = require("electron");
|
const { app, dialog, BrowserWindow, ipcMain, protocol } = require("electron");
|
||||||
|
|
||||||
const log = require("electron-log");
|
const log = require("electron-log");
|
||||||
|
log.catchErrors();
|
||||||
|
|
||||||
|
// This handler must be set ASAP to prevent ghost processes.
|
||||||
|
process.on("uncaughtException", function () {
|
||||||
|
// The exception will be logged by electron-log.
|
||||||
|
app.quit();
|
||||||
|
process.exit(1);
|
||||||
|
});
|
||||||
|
|
||||||
|
// This handler must be set ASAP to prevent ghost processes.
|
||||||
|
app.on("window-all-closed", () => {
|
||||||
|
log.info("Quitting the app...");
|
||||||
|
app.quit();
|
||||||
|
process.exit(0);
|
||||||
|
});
|
||||||
|
|
||||||
const greenworks = require("./greenworks");
|
const greenworks = require("./greenworks");
|
||||||
const api = require("./api-server");
|
const api = require("./api-server");
|
||||||
const gameWindow = require("./gameWindow");
|
const gameWindow = require("./gameWindow");
|
||||||
@@ -17,15 +34,8 @@ const { fileURLToPath } = require("url");
|
|||||||
log.transports.file.level = store.get("file-log-level", "info");
|
log.transports.file.level = store.get("file-log-level", "info");
|
||||||
log.transports.console.level = store.get("console-log-level", "debug");
|
log.transports.console.level = store.get("console-log-level", "debug");
|
||||||
|
|
||||||
log.catchErrors();
|
|
||||||
log.info(`Started app: ${JSON.stringify(process.argv)}`);
|
log.info(`Started app: ${JSON.stringify(process.argv)}`);
|
||||||
|
|
||||||
process.on("uncaughtException", function () {
|
|
||||||
// The exception will already have been logged by electron-log
|
|
||||||
app.quit();
|
|
||||||
process.exit(1);
|
|
||||||
});
|
|
||||||
|
|
||||||
// We want to fail gracefully if we cannot connect to Steam
|
// We want to fail gracefully if we cannot connect to Steam
|
||||||
try {
|
try {
|
||||||
if (greenworks && greenworks.init()) {
|
if (greenworks && greenworks.init()) {
|
||||||
@@ -42,13 +52,6 @@ try {
|
|||||||
|
|
||||||
let isRestoreDisabled = false;
|
let isRestoreDisabled = false;
|
||||||
|
|
||||||
// This was moved so that startup errors do not lead to ghost processes
|
|
||||||
app.on("window-all-closed", () => {
|
|
||||||
log.info("Quitting the app...");
|
|
||||||
app.quit();
|
|
||||||
process.exit(0);
|
|
||||||
});
|
|
||||||
|
|
||||||
function setStopProcessHandler(app, window) {
|
function setStopProcessHandler(app, window) {
|
||||||
const closingWindowHandler = async (e) => {
|
const closingWindowHandler = async (e) => {
|
||||||
// We need to prevent the default closing event to add custom logic
|
// We need to prevent the default closing event to add custom logic
|
||||||
@@ -152,7 +155,7 @@ function setStopProcessHandler(app, window) {
|
|||||||
log.debug("Saving to Steam Cloud ...");
|
log.debug("Saving to Steam Cloud ...");
|
||||||
try {
|
try {
|
||||||
const playerId = window.gameInfo.player.identifier;
|
const playerId = window.gameInfo.player.identifier;
|
||||||
await storage.pushGameSaveToSteamCloud(save, playerId);
|
await storage.pushSaveDataToSteamCloud(save, playerId);
|
||||||
log.silly("Saved Game to Steam Cloud");
|
log.silly("Saved Game to Steam Cloud");
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
log.error(error);
|
log.error(error);
|
||||||
@@ -203,7 +206,7 @@ app.on("ready", async () => {
|
|||||||
if ((method === "GET" && relativePath.startsWith("dist")) || relativePath.match(/^[a-zA-Z-_]*\.html/)) {
|
if ((method === "GET" && relativePath.startsWith("dist")) || relativePath.match(/^[a-zA-Z-_]*\.html/)) {
|
||||||
return callback(filePath);
|
return callback(filePath);
|
||||||
}
|
}
|
||||||
log.error("Tried to access a page outside sandbox.");
|
log.error(`Tried to access a page outside the sandbox. Url: ${url}. Method: ${method}.`);
|
||||||
callback(path.join(__dirname, "fileError.txt"));
|
callback(path.join(__dirname, "fileError.txt"));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -103,8 +103,8 @@ function getMenu(window) {
|
|||||||
enabled: storage.isCloudEnabled(),
|
enabled: storage.isCloudEnabled(),
|
||||||
click: async () => {
|
click: async () => {
|
||||||
try {
|
try {
|
||||||
const saveGame = await storage.getSteamCloudSaveString();
|
const saveData = await storage.getSteamCloudSaveData();
|
||||||
await storage.pushSaveGameForImport(window, saveGame, false);
|
await storage.pushSaveGameForImport(window, saveData, false);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
log.error(error);
|
log.error(error);
|
||||||
utils.writeToast(window, "Could not load from Steam Cloud", "error", 5000);
|
utils.writeToast(window, "Could not load from Steam Cloud", "error", 5000);
|
||||||
@@ -114,16 +114,6 @@ function getMenu(window) {
|
|||||||
{
|
{
|
||||||
type: "separator",
|
type: "separator",
|
||||||
},
|
},
|
||||||
{
|
|
||||||
label: "Compress Disk Saves (.gz)",
|
|
||||||
type: "checkbox",
|
|
||||||
checked: storage.isSaveCompressionEnabled(),
|
|
||||||
click: (menuItem) => {
|
|
||||||
storage.setSaveCompressionConfig(menuItem.checked);
|
|
||||||
utils.writeToast(window, `${menuItem.checked ? "Enabled" : "Disabled"} Save Compression`, "info", 5000);
|
|
||||||
refreshMenu(window);
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
label: "Auto-Save to Disk",
|
label: "Auto-Save to Disk",
|
||||||
type: "checkbox",
|
type: "checkbox",
|
||||||
@@ -222,7 +212,7 @@ function getMenu(window) {
|
|||||||
click: () => window.loadFile("index.html"),
|
click: () => window.loadFile("index.html"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "Reload & Kill All Scripts",
|
label: "Reload && Kill All Scripts",
|
||||||
click: () => utils.reloadAndKill(window, true),
|
click: () => utils.reloadAndKill(window, true),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|||||||
4
electron/package-lock.json
generated
4
electron/package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "bitburner",
|
"name": "bitburner",
|
||||||
"version": "2.5.2",
|
"version": "2.6.1",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "bitburner",
|
"name": "bitburner",
|
||||||
"version": "2.5.2",
|
"version": "2.6.1",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"electron-log": "^4.4.8",
|
"electron-log": "^4.4.8",
|
||||||
"electron-store": "^8.1.0",
|
"electron-store": "^8.1.0",
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
{
|
{
|
||||||
"name": "bitburner",
|
"name": "bitburner",
|
||||||
"version": "2.5.2",
|
"version": "2.6.1",
|
||||||
"description": "A cyberpunk-themed programming incremental game",
|
"description": "A cyberpunk-themed programming incremental game",
|
||||||
"main": "main.js",
|
"main": "main.js",
|
||||||
"author": "Daniel Xie, Olivier Gagnon, et al.",
|
"author": "Daniel Xie, hydroflame, et al.",
|
||||||
"mac": {
|
"mac": {
|
||||||
"icon": "./public/icons/mac/icon.icns",
|
"icon": "./public/icons/mac/icon.icns",
|
||||||
"category": "public.app-category.games"
|
"category": "public.app-category.games"
|
||||||
|
|||||||
1
electron/saveDataBinaryFormat.d.ts
vendored
Normal file
1
electron/saveDataBinaryFormat.d.ts
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
export declare const isBinaryFormat: (saveData: string | Uint8Array) => boolean;
|
||||||
13
electron/saveDataBinaryFormat.js
Normal file
13
electron/saveDataBinaryFormat.js
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
// The 2 magic bytes of the gzip header plus the mandatory compression type of DEFLATE
|
||||||
|
const magicBytes = [0x1f, 0x8b, 0x08];
|
||||||
|
|
||||||
|
function isBinaryFormat(rawData) {
|
||||||
|
for (let i = 0; i < magicBytes.length; ++i) {
|
||||||
|
if (magicBytes[i] !== rawData[i]) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = { isBinaryFormat };
|
||||||
@@ -11,6 +11,7 @@ const greenworks = require("./greenworks");
|
|||||||
const log = require("electron-log");
|
const log = require("electron-log");
|
||||||
const flatten = require("lodash/flatten");
|
const flatten = require("lodash/flatten");
|
||||||
const Store = require("electron-store");
|
const Store = require("electron-store");
|
||||||
|
const { isBinaryFormat } = require("./saveDataBinaryFormat");
|
||||||
const store = new Store();
|
const store = new Store();
|
||||||
|
|
||||||
// https://stackoverflow.com/a/69418940
|
// https://stackoverflow.com/a/69418940
|
||||||
@@ -86,14 +87,6 @@ function isAutosaveEnabled() {
|
|||||||
return store.get("autosave-enabled", true);
|
return store.get("autosave-enabled", true);
|
||||||
}
|
}
|
||||||
|
|
||||||
function setSaveCompressionConfig(value) {
|
|
||||||
store.set("save-compression-enabled", value);
|
|
||||||
}
|
|
||||||
|
|
||||||
function isSaveCompressionEnabled() {
|
|
||||||
return store.get("save-compression-enabled", true);
|
|
||||||
}
|
|
||||||
|
|
||||||
function setCloudEnabledConfig(value) {
|
function setCloudEnabledConfig(value) {
|
||||||
store.set("cloud-enabled", value);
|
store.set("cloud-enabled", value);
|
||||||
}
|
}
|
||||||
@@ -163,17 +156,22 @@ async function backupSteamDataToDisk(currentPlayerId) {
|
|||||||
const file = greenworks.getFileNameAndSize(0);
|
const file = greenworks.getFileNameAndSize(0);
|
||||||
const previousPlayerId = file.name.replace(".json.gz", "");
|
const previousPlayerId = file.name.replace(".json.gz", "");
|
||||||
if (previousPlayerId !== currentPlayerId) {
|
if (previousPlayerId !== currentPlayerId) {
|
||||||
const backupSave = await getSteamCloudSaveString();
|
const backupSaveData = await getSteamCloudSaveData();
|
||||||
const backupFile = path.join(app.getPath("userData"), "/saves/_backups", `${previousPlayerId}.json.gz`);
|
const backupFile = path.join(app.getPath("userData"), "/saves/_backups", `${previousPlayerId}.json.gz`);
|
||||||
const buffer = Buffer.from(backupSave, "base64").toString("utf8");
|
await fs.writeFile(backupFile, backupSaveData, "utf8");
|
||||||
saveContent = await gzip(buffer);
|
|
||||||
await fs.writeFile(backupFile, saveContent, "utf8");
|
|
||||||
log.debug(`Saved backup game to '${backupFile}`);
|
log.debug(`Saved backup game to '${backupFile}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function pushGameSaveToSteamCloud(base64save, currentPlayerId) {
|
/**
|
||||||
if (!isCloudEnabled) return Promise.reject("Steam Cloud is not Enabled");
|
* The name of save file is `${currentPlayerId}.json.gz`. The content of save file is weird: it's a base64 string of the
|
||||||
|
* binary data of compressed json save string. It's weird because the extension is .json.gz while the content is a
|
||||||
|
* base64 string. Check the comments in the implementation to see why it is like that.
|
||||||
|
*/
|
||||||
|
async function pushSaveDataToSteamCloud(saveData, currentPlayerId) {
|
||||||
|
if (!isCloudEnabled()) {
|
||||||
|
return Promise.reject("Steam Cloud is not Enabled");
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
backupSteamDataToDisk(currentPlayerId);
|
backupSteamDataToDisk(currentPlayerId);
|
||||||
@@ -183,12 +181,19 @@ async function pushGameSaveToSteamCloud(base64save, currentPlayerId) {
|
|||||||
|
|
||||||
const steamSaveName = `${currentPlayerId}.json.gz`;
|
const steamSaveName = `${currentPlayerId}.json.gz`;
|
||||||
|
|
||||||
// Let's decode the base64 string so GZIP is more efficient.
|
/**
|
||||||
const buffer = Buffer.from(base64save, "base64");
|
* When we push save file to Steam Cloud, we use greenworks.saveTextToFile. It seems that this method expects a string
|
||||||
const compressedBuffer = await gzip(buffer);
|
* as the file content. That is why saveData is encoded in base64 and pushed to Steam Cloud as a text file.
|
||||||
// We can't use utf8 for some reason, steamworks is unhappy.
|
*
|
||||||
const content = compressedBuffer.toString("base64");
|
* Encoding saveData in UTF-8 (with buffer.toString("utf8")) is not the proper way to convert binary data to string.
|
||||||
log.debug(`Uncompressed: ${base64save.length} bytes`);
|
* Quote from buffer's documentation: "If encoding is 'utf8' and a byte sequence in the input is not valid UTF-8, then
|
||||||
|
* each invalid byte is replaced with the replacement character U+FFFD.". The proper way to do it is to use
|
||||||
|
* String.fromCharCode or String.fromCodePoint.
|
||||||
|
*
|
||||||
|
* Instead of implementing it, the old code (encoding in base64) is used here for backward compatibility.
|
||||||
|
*/
|
||||||
|
const content = saveData.toString("base64");
|
||||||
|
log.debug(`Uncompressed: ${saveData.length} bytes`);
|
||||||
log.debug(`Compressed: ${content.length} bytes`);
|
log.debug(`Compressed: ${content.length} bytes`);
|
||||||
log.debug(`Saving to Steam Cloud as ${steamSaveName}`);
|
log.debug(`Saving to Steam Cloud as ${steamSaveName}`);
|
||||||
|
|
||||||
@@ -199,19 +204,22 @@ async function pushGameSaveToSteamCloud(base64save, currentPlayerId) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function getSteamCloudSaveString() {
|
/**
|
||||||
if (!isCloudEnabled()) return Promise.reject("Steam Cloud is not Enabled");
|
* This function processes the save file in Steam Cloud and returns the save data in the binary format.
|
||||||
|
*/
|
||||||
|
async function getSteamCloudSaveData() {
|
||||||
|
if (!isCloudEnabled()) {
|
||||||
|
return Promise.reject("Steam Cloud is not Enabled");
|
||||||
|
}
|
||||||
log.debug(`Fetching Save in Steam Cloud`);
|
log.debug(`Fetching Save in Steam Cloud`);
|
||||||
const cloudString = await getCloudFile();
|
const cloudString = await getCloudFile();
|
||||||
const gzippedBase64Buffer = Buffer.from(cloudString, "base64");
|
// Decode cloudString to get save data back.
|
||||||
const uncompressedBuffer = await gunzip(gzippedBase64Buffer);
|
const saveData = Buffer.from(cloudString, "base64");
|
||||||
const content = uncompressedBuffer.toString("base64");
|
log.debug(`SaveData: ${saveData.length} bytes`);
|
||||||
log.debug(`Compressed: ${cloudString.length} bytes`);
|
return saveData;
|
||||||
log.debug(`Uncompressed: ${content.length} bytes`);
|
|
||||||
return content;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async function saveGameToDisk(window, saveData) {
|
async function saveGameToDisk(window, electronGameData) {
|
||||||
const currentFolder = await getSaveFolder(window);
|
const currentFolder = await getSaveFolder(window);
|
||||||
let saveFolderSizeBytes = await getFolderSizeInBytes(currentFolder);
|
let saveFolderSizeBytes = await getFolderSizeInBytes(currentFolder);
|
||||||
const maxFolderSizeBytes = store.get("autosave-quota", 1e8); // 100Mb per playerIndentifier
|
const maxFolderSizeBytes = store.get("autosave-quota", 1e8); // 100Mb per playerIndentifier
|
||||||
@@ -221,19 +229,12 @@ async function saveGameToDisk(window, saveData) {
|
|||||||
log.debug(
|
log.debug(
|
||||||
`Remaining: ${remainingSpaceBytes} bytes (${((saveFolderSizeBytes / maxFolderSizeBytes) * 100).toFixed(2)}% used)`,
|
`Remaining: ${remainingSpaceBytes} bytes (${((saveFolderSizeBytes / maxFolderSizeBytes) * 100).toFixed(2)}% used)`,
|
||||||
);
|
);
|
||||||
const shouldCompress = isSaveCompressionEnabled();
|
let saveData = electronGameData.save;
|
||||||
const fileName = saveData.fileName;
|
const file = path.join(currentFolder, electronGameData.fileName);
|
||||||
const file = path.join(currentFolder, fileName + (shouldCompress ? ".gz" : ""));
|
|
||||||
try {
|
try {
|
||||||
let saveContent = saveData.save;
|
await fs.writeFile(file, saveData, "utf8");
|
||||||
if (shouldCompress) {
|
|
||||||
// Let's decode the base64 string so GZIP is more efficient.
|
|
||||||
const buffer = Buffer.from(saveContent, "base64").toString("utf8");
|
|
||||||
saveContent = await gzip(buffer);
|
|
||||||
}
|
|
||||||
await fs.writeFile(file, saveContent, "utf8");
|
|
||||||
log.debug(`Saved Game to '${file}'`);
|
log.debug(`Saved Game to '${file}'`);
|
||||||
log.debug(`Save Size: ${saveContent.length} bytes`);
|
log.debug(`Save Size: ${saveData.length} bytes`);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
log.error(error);
|
log.error(error);
|
||||||
}
|
}
|
||||||
@@ -276,14 +277,14 @@ async function loadLastFromDisk(window) {
|
|||||||
async function loadFileFromDisk(path) {
|
async function loadFileFromDisk(path) {
|
||||||
const buffer = await fs.readFile(path);
|
const buffer = await fs.readFile(path);
|
||||||
let content;
|
let content;
|
||||||
if (path.endsWith(".gz")) {
|
if (isBinaryFormat(buffer)) {
|
||||||
const uncompressedBuffer = await gunzip(buffer);
|
// Save file is in the binary format.
|
||||||
content = uncompressedBuffer.toString("base64");
|
content = buffer;
|
||||||
log.debug(`Uncompressed file content (new size: ${content.length} bytes)`);
|
|
||||||
} else {
|
} else {
|
||||||
|
// Save file is in the base64 format.
|
||||||
content = buffer.toString("utf8");
|
content = buffer.toString("utf8");
|
||||||
log.debug(`Loaded file with ${content.length} bytes`);
|
|
||||||
}
|
}
|
||||||
|
log.debug(`Loaded file with ${content.length} bytes`);
|
||||||
return content;
|
return content;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -319,7 +320,7 @@ async function restoreIfNewerExists(window) {
|
|||||||
const disk = {};
|
const disk = {};
|
||||||
|
|
||||||
try {
|
try {
|
||||||
steam.save = await getSteamCloudSaveString();
|
steam.save = await getSteamCloudSaveData();
|
||||||
steam.data = await getSaveInformation(window, steam.save);
|
steam.data = await getSaveInformation(window, steam.save);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
log.error("Could not retrieve steam file");
|
log.error("Could not retrieve steam file");
|
||||||
@@ -361,12 +362,12 @@ async function restoreIfNewerExists(window) {
|
|||||||
// We add a few seconds to the currentSave's lastSave to prioritize it
|
// We add a few seconds to the currentSave's lastSave to prioritize it
|
||||||
log.info("Found newer data than the current's save file");
|
log.info("Found newer data than the current's save file");
|
||||||
log.silly(bestMatch.data);
|
log.silly(bestMatch.data);
|
||||||
await pushSaveGameForImport(window, bestMatch.save, true);
|
pushSaveGameForImport(window, bestMatch.save, true);
|
||||||
return true;
|
return true;
|
||||||
} else if (bestMatch.data.playtime > currentData.playtime && currentData.playtime < lowPlaytime) {
|
} else if (bestMatch.data.playtime > currentData.playtime && currentData.playtime < lowPlaytime) {
|
||||||
log.info("Found older save, but with more playtime, and current less than 15 mins played");
|
log.info("Found older save, but with more playtime, and current less than 15 mins played");
|
||||||
log.silly(bestMatch.data);
|
log.silly(bestMatch.data);
|
||||||
await pushSaveGameForImport(window, bestMatch.save, true);
|
pushSaveGameForImport(window, bestMatch.save, true);
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
log.debug("Current save data is the freshest");
|
log.debug("Current save data is the freshest");
|
||||||
@@ -380,8 +381,8 @@ module.exports = {
|
|||||||
getSaveInformation,
|
getSaveInformation,
|
||||||
restoreIfNewerExists,
|
restoreIfNewerExists,
|
||||||
pushSaveGameForImport,
|
pushSaveGameForImport,
|
||||||
pushGameSaveToSteamCloud,
|
pushSaveDataToSteamCloud,
|
||||||
getSteamCloudSaveString,
|
getSteamCloudSaveData,
|
||||||
getSteamCloudQuota,
|
getSteamCloudQuota,
|
||||||
deleteCloudFile,
|
deleteCloudFile,
|
||||||
saveGameToDisk,
|
saveGameToDisk,
|
||||||
@@ -394,6 +395,4 @@ module.exports = {
|
|||||||
setCloudEnabledConfig,
|
setCloudEnabledConfig,
|
||||||
isAutosaveEnabled,
|
isAutosaveEnabled,
|
||||||
setAutosaveConfig,
|
setAutosaveConfig,
|
||||||
isSaveCompressionEnabled,
|
|
||||||
setSaveCompressionConfig,
|
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -7,8 +7,12 @@ const store = new Store();
|
|||||||
|
|
||||||
function reloadAndKill(window, killScripts) {
|
function reloadAndKill(window, killScripts) {
|
||||||
log.info("Reloading & Killing all scripts...");
|
log.info("Reloading & Killing all scripts...");
|
||||||
|
const zoomFactor = getZoomFactor();
|
||||||
window.webContents.forcefullyCrashRenderer();
|
window.webContents.forcefullyCrashRenderer();
|
||||||
window.loadFile("index.html", killScripts ? { query: { noScripts: true } } : {});
|
window.loadFile("index.html", killScripts ? { query: { noScripts: true } } : {});
|
||||||
|
window.once("ready-to-show", () => {
|
||||||
|
setZoomFactor(window, zoomFactor);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function promptForReload(window) {
|
function promptForReload(window) {
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ module.exports = {
|
|||||||
transformIgnorePatterns: ["node_modules/(?!react-markdown)/"],
|
transformIgnorePatterns: ["node_modules/(?!react-markdown)/"],
|
||||||
testPathIgnorePatterns: [".cypress", "node_modules", "dist"],
|
testPathIgnorePatterns: [".cypress", "node_modules", "dist"],
|
||||||
testEnvironment: "./FixJSDOMEnvironment.ts",
|
testEnvironment: "./FixJSDOMEnvironment.ts",
|
||||||
|
setupFiles: ["./jest.polyfills.js"],
|
||||||
moduleNameMapper: {
|
moduleNameMapper: {
|
||||||
"\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$":
|
"\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$":
|
||||||
"<rootDir>/test/__mocks__/fileMock.js",
|
"<rootDir>/test/__mocks__/fileMock.js",
|
||||||
|
|||||||
6
jest.polyfills.js
Normal file
6
jest.polyfills.js
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
const { TextEncoder, TextDecoder } = require("node:util");
|
||||||
|
|
||||||
|
Object.defineProperties(globalThis, {
|
||||||
|
TextEncoder: { value: TextEncoder },
|
||||||
|
TextDecoder: { value: TextDecoder },
|
||||||
|
});
|
||||||
@@ -18,5 +18,5 @@ interface BasicHGWOptions
|
|||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- |
|
||||||
| [additionalMsec?](./bitburner.basichgwoptions.additionalmsec.md) | | number | _(Optional)_ Number of additional milliseconds that will be spent waiting between the start of the function and when it completes. |
|
| [additionalMsec?](./bitburner.basichgwoptions.additionalmsec.md) | | number | _(Optional)_ Number of additional milliseconds that will be spent waiting between the start of the function and when it completes. |
|
||||||
| [stock?](./bitburner.basichgwoptions.stock.md) | | boolean | _(Optional)_ Set to true this action will affect the stock market. |
|
| [stock?](./bitburner.basichgwoptions.stock.md) | | boolean | _(Optional)_ Set to true this action will affect the stock market. |
|
||||||
| [threads?](./bitburner.basichgwoptions.threads.md) | | number | _(Optional)_ Number of threads to use for this function. Must be less than or equal to the number of threads the script is running with. |
|
| [threads?](./bitburner.basichgwoptions.threads.md) | | number | _(Optional)_ Number of threads to use for this function. Must be less than or equal to the number of threads the script is running with. Accepts positive non integer values. |
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
## BasicHGWOptions.threads property
|
## BasicHGWOptions.threads property
|
||||||
|
|
||||||
Number of threads to use for this function. Must be less than or equal to the number of threads the script is running with.
|
Number of threads to use for this function. Must be less than or equal to the number of threads the script is running with. Accepts positive non integer values.
|
||||||
|
|
||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
|
|||||||
@@ -9,17 +9,15 @@ Get current action.
|
|||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
getCurrentAction(): BladeburnerCurAction;
|
getCurrentAction(): BladeburnerCurAction | null;
|
||||||
```
|
```
|
||||||
**Returns:**
|
**Returns:**
|
||||||
|
|
||||||
[BladeburnerCurAction](./bitburner.bladeburnercuraction.md)
|
[BladeburnerCurAction](./bitburner.bladeburnercuraction.md) \| null
|
||||||
|
|
||||||
Object that represents the player’s current Bladeburner action.
|
Object that represents the player’s current Bladeburner action, or null if no action is being performed.
|
||||||
|
|
||||||
## Remarks
|
## Remarks
|
||||||
|
|
||||||
RAM cost: 1 GB
|
RAM cost: 1 GB
|
||||||
|
|
||||||
Returns an object that represents the player’s current Bladeburner action. If the player is not performing an action, the function will return an object with the ‘type’ property set to “Idle”.
|
|
||||||
|
|
||||||
|
|||||||
@@ -31,5 +31,5 @@ RAM cost: 4 GB
|
|||||||
|
|
||||||
This function returns the number of skill points needed to upgrade the specified skill the specified number of times.
|
This function returns the number of skill points needed to upgrade the specified skill the specified number of times.
|
||||||
|
|
||||||
The function returns -1 if an invalid skill name is passed in.
|
The function returns -1 if an invalid skill name is passed in, and Infinity if the count overflows the maximum level.
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ Generate a dummy contract.
|
|||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
createDummyContract(type: string): void;
|
createDummyContract(type: string): string;
|
||||||
```
|
```
|
||||||
|
|
||||||
## Parameters
|
## Parameters
|
||||||
@@ -20,7 +20,9 @@ createDummyContract(type: string): void;
|
|||||||
|
|
||||||
**Returns:**
|
**Returns:**
|
||||||
|
|
||||||
void
|
string
|
||||||
|
|
||||||
|
Filename of the contract.
|
||||||
|
|
||||||
## Remarks
|
## Remarks
|
||||||
|
|
||||||
|
|||||||
11
markdown/bitburner.companyworktask.companyname.md
Normal file
11
markdown/bitburner.companyworktask.companyname.md
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||||
|
|
||||||
|
[Home](./index.md) > [bitburner](./bitburner.md) > [CompanyWorkTask](./bitburner.companyworktask.md) > [companyName](./bitburner.companyworktask.companyname.md)
|
||||||
|
|
||||||
|
## CompanyWorkTask.companyName property
|
||||||
|
|
||||||
|
**Signature:**
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
companyName: CompanyName;
|
||||||
|
```
|
||||||
11
markdown/bitburner.companyworktask.cyclesworked.md
Normal file
11
markdown/bitburner.companyworktask.cyclesworked.md
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||||
|
|
||||||
|
[Home](./index.md) > [bitburner](./bitburner.md) > [CompanyWorkTask](./bitburner.companyworktask.md) > [cyclesWorked](./bitburner.companyworktask.cyclesworked.md)
|
||||||
|
|
||||||
|
## CompanyWorkTask.cyclesWorked property
|
||||||
|
|
||||||
|
**Signature:**
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
cyclesWorked: number;
|
||||||
|
```
|
||||||
26
markdown/bitburner.companyworktask.md
Normal file
26
markdown/bitburner.companyworktask.md
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||||
|
|
||||||
|
[Home](./index.md) > [bitburner](./bitburner.md) > [CompanyWorkTask](./bitburner.companyworktask.md)
|
||||||
|
|
||||||
|
## CompanyWorkTask interface
|
||||||
|
|
||||||
|
Company Work
|
||||||
|
|
||||||
|
**Signature:**
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
export interface CompanyWorkTask
|
||||||
|
```
|
||||||
|
|
||||||
|
## Remarks
|
||||||
|
|
||||||
|
An object representing the current work for a company
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
| Property | Modifiers | Type | Description |
|
||||||
|
| --- | --- | --- | --- |
|
||||||
|
| [companyName](./bitburner.companyworktask.companyname.md) | | [CompanyName](./bitburner.companyname.md) | |
|
||||||
|
| [cyclesWorked](./bitburner.companyworktask.cyclesworked.md) | | number | |
|
||||||
|
| [type](./bitburner.companyworktask.type.md) | | "COMPANY" | |
|
||||||
|
|
||||||
11
markdown/bitburner.companyworktask.type.md
Normal file
11
markdown/bitburner.companyworktask.type.md
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||||
|
|
||||||
|
[Home](./index.md) > [bitburner](./bitburner.md) > [CompanyWorkTask](./bitburner.companyworktask.md) > [type](./bitburner.companyworktask.type.md)
|
||||||
|
|
||||||
|
## CompanyWorkTask.type property
|
||||||
|
|
||||||
|
**Signature:**
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
type: "COMPANY";
|
||||||
|
```
|
||||||
@@ -41,5 +41,6 @@ export interface Corporation extends WarehouseAPI, OfficeAPI
|
|||||||
| [levelUpgrade(upgradeName)](./bitburner.corporation.levelupgrade.md) | Level an upgrade. |
|
| [levelUpgrade(upgradeName)](./bitburner.corporation.levelupgrade.md) | Level an upgrade. |
|
||||||
| [nextUpdate()](./bitburner.corporation.nextupdate.md) | Sleep until the next Corporation update has happened. |
|
| [nextUpdate()](./bitburner.corporation.nextupdate.md) | Sleep until the next Corporation update has happened. |
|
||||||
| [purchaseUnlock(upgradeName)](./bitburner.corporation.purchaseunlock.md) | Unlock an upgrade |
|
| [purchaseUnlock(upgradeName)](./bitburner.corporation.purchaseunlock.md) | Unlock an upgrade |
|
||||||
|
| [sellDivision(divisionName)](./bitburner.corporation.selldivision.md) | Sell a division |
|
||||||
| [sellShares(amount)](./bitburner.corporation.sellshares.md) | Sell Shares. Transfer shares from the CEO to public traders to receive money in the player's wallet. |
|
| [sellShares(amount)](./bitburner.corporation.sellshares.md) | Sell Shares. Transfer shares from the CEO to public traders to receive money in the player's wallet. |
|
||||||
|
|
||||||
|
|||||||
28
markdown/bitburner.corporation.selldivision.md
Normal file
28
markdown/bitburner.corporation.selldivision.md
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||||
|
|
||||||
|
[Home](./index.md) > [bitburner](./bitburner.md) > [Corporation](./bitburner.corporation.md) > [sellDivision](./bitburner.corporation.selldivision.md)
|
||||||
|
|
||||||
|
## Corporation.sellDivision() method
|
||||||
|
|
||||||
|
Sell a division
|
||||||
|
|
||||||
|
**Signature:**
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
sellDivision(divisionName: string): void;
|
||||||
|
```
|
||||||
|
|
||||||
|
## Parameters
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| divisionName | string | Name of the division |
|
||||||
|
|
||||||
|
**Returns:**
|
||||||
|
|
||||||
|
void
|
||||||
|
|
||||||
|
## Remarks
|
||||||
|
|
||||||
|
RAM cost: 20 GB
|
||||||
|
|
||||||
11
markdown/bitburner.createprogramworktask.cyclesworked.md
Normal file
11
markdown/bitburner.createprogramworktask.cyclesworked.md
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||||
|
|
||||||
|
[Home](./index.md) > [bitburner](./bitburner.md) > [CreateProgramWorkTask](./bitburner.createprogramworktask.md) > [cyclesWorked](./bitburner.createprogramworktask.cyclesworked.md)
|
||||||
|
|
||||||
|
## CreateProgramWorkTask.cyclesWorked property
|
||||||
|
|
||||||
|
**Signature:**
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
cyclesWorked: number;
|
||||||
|
```
|
||||||
26
markdown/bitburner.createprogramworktask.md
Normal file
26
markdown/bitburner.createprogramworktask.md
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||||
|
|
||||||
|
[Home](./index.md) > [bitburner](./bitburner.md) > [CreateProgramWorkTask](./bitburner.createprogramworktask.md)
|
||||||
|
|
||||||
|
## CreateProgramWorkTask interface
|
||||||
|
|
||||||
|
Create Program
|
||||||
|
|
||||||
|
**Signature:**
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
export interface CreateProgramWorkTask
|
||||||
|
```
|
||||||
|
|
||||||
|
## Remarks
|
||||||
|
|
||||||
|
An object representing the status of the program being created
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
| Property | Modifiers | Type | Description |
|
||||||
|
| --- | --- | --- | --- |
|
||||||
|
| [cyclesWorked](./bitburner.createprogramworktask.cyclesworked.md) | | number | |
|
||||||
|
| [programName](./bitburner.createprogramworktask.programname.md) | | string | |
|
||||||
|
| [type](./bitburner.createprogramworktask.type.md) | | "CREATE\_PROGRAM" | |
|
||||||
|
|
||||||
11
markdown/bitburner.createprogramworktask.programname.md
Normal file
11
markdown/bitburner.createprogramworktask.programname.md
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||||
|
|
||||||
|
[Home](./index.md) > [bitburner](./bitburner.md) > [CreateProgramWorkTask](./bitburner.createprogramworktask.md) > [programName](./bitburner.createprogramworktask.programname.md)
|
||||||
|
|
||||||
|
## CreateProgramWorkTask.programName property
|
||||||
|
|
||||||
|
**Signature:**
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
programName: string;
|
||||||
|
```
|
||||||
11
markdown/bitburner.createprogramworktask.type.md
Normal file
11
markdown/bitburner.createprogramworktask.type.md
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||||
|
|
||||||
|
[Home](./index.md) > [bitburner](./bitburner.md) > [CreateProgramWorkTask](./bitburner.createprogramworktask.md) > [type](./bitburner.createprogramworktask.type.md)
|
||||||
|
|
||||||
|
## CreateProgramWorkTask.type property
|
||||||
|
|
||||||
|
**Signature:**
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
type: "CREATE_PROGRAM";
|
||||||
|
```
|
||||||
11
markdown/bitburner.crimetask.crimetype.md
Normal file
11
markdown/bitburner.crimetask.crimetype.md
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||||
|
|
||||||
|
[Home](./index.md) > [bitburner](./bitburner.md) > [CrimeTask](./bitburner.crimetask.md) > [crimeType](./bitburner.crimetask.crimetype.md)
|
||||||
|
|
||||||
|
## CrimeTask.crimeType property
|
||||||
|
|
||||||
|
**Signature:**
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
crimeType: CrimeType;
|
||||||
|
```
|
||||||
11
markdown/bitburner.crimetask.cyclesworked.md
Normal file
11
markdown/bitburner.crimetask.cyclesworked.md
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||||
|
|
||||||
|
[Home](./index.md) > [bitburner](./bitburner.md) > [CrimeTask](./bitburner.crimetask.md) > [cyclesWorked](./bitburner.crimetask.cyclesworked.md)
|
||||||
|
|
||||||
|
## CrimeTask.cyclesWorked property
|
||||||
|
|
||||||
|
**Signature:**
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
cyclesWorked: number;
|
||||||
|
```
|
||||||
26
markdown/bitburner.crimetask.md
Normal file
26
markdown/bitburner.crimetask.md
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||||
|
|
||||||
|
[Home](./index.md) > [bitburner](./bitburner.md) > [CrimeTask](./bitburner.crimetask.md)
|
||||||
|
|
||||||
|
## CrimeTask interface
|
||||||
|
|
||||||
|
Crime
|
||||||
|
|
||||||
|
**Signature:**
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
export interface CrimeTask
|
||||||
|
```
|
||||||
|
|
||||||
|
## Remarks
|
||||||
|
|
||||||
|
An object representing the crime being commited
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
| Property | Modifiers | Type | Description |
|
||||||
|
| --- | --- | --- | --- |
|
||||||
|
| [crimeType](./bitburner.crimetask.crimetype.md) | | [CrimeType](./bitburner.crimetype.md) | |
|
||||||
|
| [cyclesWorked](./bitburner.crimetask.cyclesworked.md) | | number | |
|
||||||
|
| [type](./bitburner.crimetask.type.md) | | "CRIME" | |
|
||||||
|
|
||||||
11
markdown/bitburner.crimetask.type.md
Normal file
11
markdown/bitburner.crimetask.type.md
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||||
|
|
||||||
|
[Home](./index.md) > [bitburner](./bitburner.md) > [CrimeTask](./bitburner.crimetask.md) > [type](./bitburner.crimetask.type.md)
|
||||||
|
|
||||||
|
## CrimeTask.type property
|
||||||
|
|
||||||
|
**Signature:**
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
type: "CRIME";
|
||||||
|
```
|
||||||
11
markdown/bitburner.factionworktask.cyclesworked.md
Normal file
11
markdown/bitburner.factionworktask.cyclesworked.md
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||||
|
|
||||||
|
[Home](./index.md) > [bitburner](./bitburner.md) > [FactionWorkTask](./bitburner.factionworktask.md) > [cyclesWorked](./bitburner.factionworktask.cyclesworked.md)
|
||||||
|
|
||||||
|
## FactionWorkTask.cyclesWorked property
|
||||||
|
|
||||||
|
**Signature:**
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
cyclesWorked: number;
|
||||||
|
```
|
||||||
11
markdown/bitburner.factionworktask.factionname.md
Normal file
11
markdown/bitburner.factionworktask.factionname.md
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||||
|
|
||||||
|
[Home](./index.md) > [bitburner](./bitburner.md) > [FactionWorkTask](./bitburner.factionworktask.md) > [factionName](./bitburner.factionworktask.factionname.md)
|
||||||
|
|
||||||
|
## FactionWorkTask.factionName property
|
||||||
|
|
||||||
|
**Signature:**
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
factionName: string;
|
||||||
|
```
|
||||||
11
markdown/bitburner.factionworktask.factionworktype.md
Normal file
11
markdown/bitburner.factionworktask.factionworktype.md
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||||
|
|
||||||
|
[Home](./index.md) > [bitburner](./bitburner.md) > [FactionWorkTask](./bitburner.factionworktask.md) > [factionWorkType](./bitburner.factionworktask.factionworktype.md)
|
||||||
|
|
||||||
|
## FactionWorkTask.factionWorkType property
|
||||||
|
|
||||||
|
**Signature:**
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
factionWorkType: FactionWorkType;
|
||||||
|
```
|
||||||
27
markdown/bitburner.factionworktask.md
Normal file
27
markdown/bitburner.factionworktask.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) > [FactionWorkTask](./bitburner.factionworktask.md)
|
||||||
|
|
||||||
|
## FactionWorkTask interface
|
||||||
|
|
||||||
|
Faction Work
|
||||||
|
|
||||||
|
**Signature:**
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
export interface FactionWorkTask
|
||||||
|
```
|
||||||
|
|
||||||
|
## Remarks
|
||||||
|
|
||||||
|
An object representing the current work for a faction
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
| Property | Modifiers | Type | Description |
|
||||||
|
| --- | --- | --- | --- |
|
||||||
|
| [cyclesWorked](./bitburner.factionworktask.cyclesworked.md) | | number | |
|
||||||
|
| [factionName](./bitburner.factionworktask.factionname.md) | | string | |
|
||||||
|
| [factionWorkType](./bitburner.factionworktask.factionworktype.md) | | [FactionWorkType](./bitburner.factionworktype.md) | |
|
||||||
|
| [type](./bitburner.factionworktask.type.md) | | "FACTION" | |
|
||||||
|
|
||||||
11
markdown/bitburner.factionworktask.type.md
Normal file
11
markdown/bitburner.factionworktask.type.md
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||||
|
|
||||||
|
[Home](./index.md) > [bitburner](./bitburner.md) > [FactionWorkTask](./bitburner.factionworktask.md) > [type](./bitburner.factionworktask.type.md)
|
||||||
|
|
||||||
|
## FactionWorkTask.type property
|
||||||
|
|
||||||
|
**Signature:**
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
type: "FACTION";
|
||||||
|
```
|
||||||
32
markdown/bitburner.gang.getinstallresult.md
Normal file
32
markdown/bitburner.gang.getinstallresult.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) > [Gang](./bitburner.gang.md) > [getInstallResult](./bitburner.gang.getinstallresult.md)
|
||||||
|
|
||||||
|
## Gang.getInstallResult() method
|
||||||
|
|
||||||
|
Get the effect of an install on ascension multipliers without installing.
|
||||||
|
|
||||||
|
**Signature:**
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
getInstallResult(memberName: string): GangMemberInstall | undefined;
|
||||||
|
```
|
||||||
|
|
||||||
|
## Parameters
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| memberName | string | Name of member. |
|
||||||
|
|
||||||
|
**Returns:**
|
||||||
|
|
||||||
|
[GangMemberInstall](./bitburner.gangmemberinstall.md) \| undefined
|
||||||
|
|
||||||
|
Object with info about the install results on ascension multipliers, or undefined if ascension is not possible.
|
||||||
|
|
||||||
|
## Remarks
|
||||||
|
|
||||||
|
RAM cost: 2 GB
|
||||||
|
|
||||||
|
Get [GangMemberInstall](./bitburner.gangmemberinstall.md) effects on ascension multipliers for a gang member after installing without performing the install.
|
||||||
|
|
||||||
@@ -31,6 +31,7 @@ If you are not in BitNode-2, then you must have Source-File 2 in order to use th
|
|||||||
| [getEquipmentStats(equipName)](./bitburner.gang.getequipmentstats.md) | Get stats of an equipment. |
|
| [getEquipmentStats(equipName)](./bitburner.gang.getequipmentstats.md) | Get stats of an equipment. |
|
||||||
| [getEquipmentType(equipName)](./bitburner.gang.getequipmenttype.md) | Get type of an equipment. |
|
| [getEquipmentType(equipName)](./bitburner.gang.getequipmenttype.md) | Get type of an equipment. |
|
||||||
| [getGangInformation()](./bitburner.gang.getganginformation.md) | Get information about your gang. |
|
| [getGangInformation()](./bitburner.gang.getganginformation.md) | Get information about your gang. |
|
||||||
|
| [getInstallResult(memberName)](./bitburner.gang.getinstallresult.md) | Get the effect of an install on ascension multipliers without installing. |
|
||||||
| [getMemberInformation(name)](./bitburner.gang.getmemberinformation.md) | Get information about a specific gang member. |
|
| [getMemberInformation(name)](./bitburner.gang.getmemberinformation.md) | Get information about a specific gang member. |
|
||||||
| [getMemberNames()](./bitburner.gang.getmembernames.md) | List all gang members. |
|
| [getMemberNames()](./bitburner.gang.getmembernames.md) | List all gang members. |
|
||||||
| [getOtherGangInformation()](./bitburner.gang.getotherganginformation.md) | Get information about the other gangs. |
|
| [getOtherGangInformation()](./bitburner.gang.getotherganginformation.md) | Get information about the other gangs. |
|
||||||
|
|||||||
13
markdown/bitburner.gangmemberinstall.agi.md
Normal file
13
markdown/bitburner.gangmemberinstall.agi.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) > [GangMemberInstall](./bitburner.gangmemberinstall.md) > [agi](./bitburner.gangmemberinstall.agi.md)
|
||||||
|
|
||||||
|
## GangMemberInstall.agi property
|
||||||
|
|
||||||
|
Factor by which the agility ascension multiplier was decreased (newMult / oldMult)
|
||||||
|
|
||||||
|
**Signature:**
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
agi: number;
|
||||||
|
```
|
||||||
13
markdown/bitburner.gangmemberinstall.cha.md
Normal file
13
markdown/bitburner.gangmemberinstall.cha.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) > [GangMemberInstall](./bitburner.gangmemberinstall.md) > [cha](./bitburner.gangmemberinstall.cha.md)
|
||||||
|
|
||||||
|
## GangMemberInstall.cha property
|
||||||
|
|
||||||
|
Factor by which the charisma ascension multiplier was decreased (newMult / oldMult)
|
||||||
|
|
||||||
|
**Signature:**
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
cha: number;
|
||||||
|
```
|
||||||
13
markdown/bitburner.gangmemberinstall.def.md
Normal file
13
markdown/bitburner.gangmemberinstall.def.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) > [GangMemberInstall](./bitburner.gangmemberinstall.md) > [def](./bitburner.gangmemberinstall.def.md)
|
||||||
|
|
||||||
|
## GangMemberInstall.def property
|
||||||
|
|
||||||
|
Factor by which the defense ascension multiplier was decreased (newMult / oldMult)
|
||||||
|
|
||||||
|
**Signature:**
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
def: number;
|
||||||
|
```
|
||||||
13
markdown/bitburner.gangmemberinstall.dex.md
Normal file
13
markdown/bitburner.gangmemberinstall.dex.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) > [GangMemberInstall](./bitburner.gangmemberinstall.md) > [dex](./bitburner.gangmemberinstall.dex.md)
|
||||||
|
|
||||||
|
## GangMemberInstall.dex property
|
||||||
|
|
||||||
|
Factor by which the dexterity ascension multiplier was decreased (newMult / oldMult)
|
||||||
|
|
||||||
|
**Signature:**
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
dex: number;
|
||||||
|
```
|
||||||
13
markdown/bitburner.gangmemberinstall.hack.md
Normal file
13
markdown/bitburner.gangmemberinstall.hack.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) > [GangMemberInstall](./bitburner.gangmemberinstall.md) > [hack](./bitburner.gangmemberinstall.hack.md)
|
||||||
|
|
||||||
|
## GangMemberInstall.hack property
|
||||||
|
|
||||||
|
Factor by which the hacking ascension multiplier was decreased (newMult / oldMult)
|
||||||
|
|
||||||
|
**Signature:**
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
hack: number;
|
||||||
|
```
|
||||||
24
markdown/bitburner.gangmemberinstall.md
Normal file
24
markdown/bitburner.gangmemberinstall.md
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||||
|
|
||||||
|
[Home](./index.md) > [bitburner](./bitburner.md) > [GangMemberInstall](./bitburner.gangmemberinstall.md)
|
||||||
|
|
||||||
|
## GangMemberInstall interface
|
||||||
|
|
||||||
|
|
||||||
|
**Signature:**
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
interface GangMemberInstall
|
||||||
|
```
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
| Property | Modifiers | Type | Description |
|
||||||
|
| --- | --- | --- | --- |
|
||||||
|
| [agi](./bitburner.gangmemberinstall.agi.md) | | number | Factor by which the agility ascension multiplier was decreased (newMult / oldMult) |
|
||||||
|
| [cha](./bitburner.gangmemberinstall.cha.md) | | number | Factor by which the charisma ascension multiplier was decreased (newMult / oldMult) |
|
||||||
|
| [def](./bitburner.gangmemberinstall.def.md) | | number | Factor by which the defense ascension multiplier was decreased (newMult / oldMult) |
|
||||||
|
| [dex](./bitburner.gangmemberinstall.dex.md) | | number | Factor by which the dexterity ascension multiplier was decreased (newMult / oldMult) |
|
||||||
|
| [hack](./bitburner.gangmemberinstall.hack.md) | | number | Factor by which the hacking ascension multiplier was decreased (newMult / oldMult) |
|
||||||
|
| [str](./bitburner.gangmemberinstall.str.md) | | number | Factor by which the strength ascension multiplier was decreased (newMult / oldMult) |
|
||||||
|
|
||||||
13
markdown/bitburner.gangmemberinstall.str.md
Normal file
13
markdown/bitburner.gangmemberinstall.str.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) > [GangMemberInstall](./bitburner.gangmemberinstall.md) > [str](./bitburner.gangmemberinstall.str.md)
|
||||||
|
|
||||||
|
## GangMemberInstall.str property
|
||||||
|
|
||||||
|
Factor by which the strength ascension multiplier was decreased (newMult / oldMult)
|
||||||
|
|
||||||
|
**Signature:**
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
str: number;
|
||||||
|
```
|
||||||
23
markdown/bitburner.go.analysis.md
Normal file
23
markdown/bitburner.go.analysis.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) > [Go](./bitburner.go.md) > [analysis](./bitburner.go.analysis.md)
|
||||||
|
|
||||||
|
## Go.analysis property
|
||||||
|
|
||||||
|
Tools to analyze the IPvGO subnet.
|
||||||
|
|
||||||
|
**Signature:**
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
analysis: {
|
||||||
|
getValidMoves(): boolean[][];
|
||||||
|
|
||||||
|
getChains(): (number | null)[][];
|
||||||
|
|
||||||
|
getLiberties(): number[][];
|
||||||
|
|
||||||
|
getControlledEmptyNodes(): string[];
|
||||||
|
|
||||||
|
getStats(): Partial<Record<GoOpponent, SimpleOpponentStats>>;
|
||||||
|
};
|
||||||
|
```
|
||||||
51
markdown/bitburner.go.cheat.md
Normal file
51
markdown/bitburner.go.cheat.md
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||||
|
|
||||||
|
[Home](./index.md) > [bitburner](./bitburner.md) > [Go](./bitburner.go.md) > [cheat](./bitburner.go.cheat.md)
|
||||||
|
|
||||||
|
## Go.cheat property
|
||||||
|
|
||||||
|
Illicit and dangerous IPvGO tools. Not for the faint of heart. Requires Bitnode 14.2 to use.
|
||||||
|
|
||||||
|
**Signature:**
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
cheat: {
|
||||||
|
getCheatSuccessChance(): number;
|
||||||
|
removeRouter(
|
||||||
|
x: number,
|
||||||
|
y: number,
|
||||||
|
): Promise<{
|
||||||
|
type: "move" | "pass" | "gameOver";
|
||||||
|
x: number | null;
|
||||||
|
y: number | null;
|
||||||
|
}>;
|
||||||
|
playTwoMoves(
|
||||||
|
x1: number,
|
||||||
|
y1: number,
|
||||||
|
x2: number,
|
||||||
|
y2: number,
|
||||||
|
): Promise<{
|
||||||
|
type: "move" | "pass" | "gameOver";
|
||||||
|
x: number | null;
|
||||||
|
y: number | null;
|
||||||
|
}>;
|
||||||
|
|
||||||
|
repairOfflineNode(
|
||||||
|
x: number,
|
||||||
|
y: number,
|
||||||
|
): Promise<{
|
||||||
|
type: "move" | "pass" | "gameOver";
|
||||||
|
x: number | null;
|
||||||
|
y: number | null;
|
||||||
|
}>;
|
||||||
|
|
||||||
|
destroyNode(
|
||||||
|
x: number,
|
||||||
|
y: number,
|
||||||
|
): Promise<{
|
||||||
|
type: "move" | "pass" | "gameOver";
|
||||||
|
x: number | null;
|
||||||
|
y: number | null;
|
||||||
|
}>;
|
||||||
|
};
|
||||||
|
```
|
||||||
31
markdown/bitburner.go.getboardstate.md
Normal file
31
markdown/bitburner.go.getboardstate.md
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||||
|
|
||||||
|
[Home](./index.md) > [bitburner](./bitburner.md) > [Go](./bitburner.go.md) > [getBoardState](./bitburner.go.getboardstate.md)
|
||||||
|
|
||||||
|
## Go.getBoardState() method
|
||||||
|
|
||||||
|
Retrieves a simplified version of the board state. "X" represents black pieces, "O" white, and "." empty points. "\#" are dead nodes that are not part of the subnet. (They are not territory nor open nodes.)
|
||||||
|
|
||||||
|
For example, a 5x5 board might look like this:
|
||||||
|
|
||||||
|
\[<br/> "XX.O.",<br/> "X..OO",<br/> ".XO..",<br/> "XXO.\#",<br/> ".XO.\#",<br/> \]
|
||||||
|
|
||||||
|
Each string represents a vertical column on the board, and each character in the string represents a point.
|
||||||
|
|
||||||
|
Traditional notation for Go is e.g. "B,1" referring to second ("B") column, first rank. This is the equivalent of index \[1\]\[0\].
|
||||||
|
|
||||||
|
Note that the \[0\]\[0\] point is shown on the bottom-left on the visual board (as is traditional), and each string represents a vertical column on the board. In other words, the printed example above can be understood to be rotated 90 degrees clockwise compared to the board UI as shown in the IPvGO subnet tab.
|
||||||
|
|
||||||
|
**Signature:**
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
getBoardState(): string[];
|
||||||
|
```
|
||||||
|
**Returns:**
|
||||||
|
|
||||||
|
string\[\]
|
||||||
|
|
||||||
|
## Remarks
|
||||||
|
|
||||||
|
RAM cost: 4 GB
|
||||||
|
|
||||||
19
markdown/bitburner.go.getcurrentplayer.md
Normal file
19
markdown/bitburner.go.getcurrentplayer.md
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||||
|
|
||||||
|
[Home](./index.md) > [bitburner](./bitburner.md) > [Go](./bitburner.go.md) > [getCurrentPlayer](./bitburner.go.getcurrentplayer.md)
|
||||||
|
|
||||||
|
## Go.getCurrentPlayer() method
|
||||||
|
|
||||||
|
Returns the color of the current player, or 'None' if the game is over.
|
||||||
|
|
||||||
|
**Signature:**
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
getCurrentPlayer(): "White" | "Black" | "None";
|
||||||
|
```
|
||||||
|
**Returns:**
|
||||||
|
|
||||||
|
"White" \| "Black" \| "None"
|
||||||
|
|
||||||
|
"White" \| "Black" \| "None"
|
||||||
|
|
||||||
22
markdown/bitburner.go.getgamestate.md
Normal file
22
markdown/bitburner.go.getgamestate.md
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||||
|
|
||||||
|
[Home](./index.md) > [bitburner](./bitburner.md) > [Go](./bitburner.go.md) > [getGameState](./bitburner.go.getgamestate.md)
|
||||||
|
|
||||||
|
## Go.getGameState() method
|
||||||
|
|
||||||
|
Gets the status of the current game. Shows the current player, current score, and the previous move coordinates. Previous move coordinates will be \[-1, -1\] for a pass, or if there are no prior moves.
|
||||||
|
|
||||||
|
**Signature:**
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
getGameState(): {
|
||||||
|
currentPlayer: "White" | "Black" | "None";
|
||||||
|
whiteScore: number;
|
||||||
|
blackScore: number;
|
||||||
|
previousMove: [number, number] | null;
|
||||||
|
};
|
||||||
|
```
|
||||||
|
**Returns:**
|
||||||
|
|
||||||
|
{ currentPlayer: "White" \| "Black" \| "None"; whiteScore: number; blackScore: number; previousMove: \[number, number\] \| null; }
|
||||||
|
|
||||||
17
markdown/bitburner.go.getopponent.md
Normal file
17
markdown/bitburner.go.getopponent.md
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||||
|
|
||||||
|
[Home](./index.md) > [bitburner](./bitburner.md) > [Go](./bitburner.go.md) > [getOpponent](./bitburner.go.getopponent.md)
|
||||||
|
|
||||||
|
## Go.getOpponent() method
|
||||||
|
|
||||||
|
Returns the name of the opponent faction in the current subnet.
|
||||||
|
|
||||||
|
**Signature:**
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
getOpponent(): GoOpponent | "No AI";
|
||||||
|
```
|
||||||
|
**Returns:**
|
||||||
|
|
||||||
|
[GoOpponent](./bitburner.goopponent.md) \| "No AI"
|
||||||
|
|
||||||
38
markdown/bitburner.go.makemove.md
Normal file
38
markdown/bitburner.go.makemove.md
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||||
|
|
||||||
|
[Home](./index.md) > [bitburner](./bitburner.md) > [Go](./bitburner.go.md) > [makeMove](./bitburner.go.makemove.md)
|
||||||
|
|
||||||
|
## Go.makeMove() method
|
||||||
|
|
||||||
|
Make a move on the IPvGO subnet gameboard, and await the opponent's response. x:0 y:0 represents the bottom-left corner of the board in the UI.
|
||||||
|
|
||||||
|
**Signature:**
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
makeMove(
|
||||||
|
x: number,
|
||||||
|
y: number,
|
||||||
|
): Promise<{
|
||||||
|
type: "move" | "pass" | "gameOver";
|
||||||
|
x: number | null;
|
||||||
|
y: number | null;
|
||||||
|
}>;
|
||||||
|
```
|
||||||
|
|
||||||
|
## Parameters
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| x | number | |
|
||||||
|
| y | number | |
|
||||||
|
|
||||||
|
**Returns:**
|
||||||
|
|
||||||
|
Promise<{ type: "move" \| "pass" \| "gameOver"; x: number \| null; y: number \| null; }>
|
||||||
|
|
||||||
|
a promise that contains if your move was valid and successful, the opponent move's x and y coordinates (or pass) in response, or an indication if the game has ended
|
||||||
|
|
||||||
|
## Remarks
|
||||||
|
|
||||||
|
RAM cost: 4 GB
|
||||||
|
|
||||||
34
markdown/bitburner.go.md
Normal file
34
markdown/bitburner.go.md
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||||
|
|
||||||
|
[Home](./index.md) > [bitburner](./bitburner.md) > [Go](./bitburner.go.md)
|
||||||
|
|
||||||
|
## Go interface
|
||||||
|
|
||||||
|
IPvGO api
|
||||||
|
|
||||||
|
**Signature:**
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
export interface Go
|
||||||
|
```
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
| Property | Modifiers | Type | Description |
|
||||||
|
| --- | --- | --- | --- |
|
||||||
|
| [analysis](./bitburner.go.analysis.md) | | { getValidMoves(): boolean\[\]\[\]; getChains(): (number \| null)\[\]\[\]; getLiberties(): number\[\]\[\]; getControlledEmptyNodes(): string\[\]; getStats(): Partial<Record<[GoOpponent](./bitburner.goopponent.md)<!-- -->, [SimpleOpponentStats](./bitburner.simpleopponentstats.md)<!-- -->>>; } | Tools to analyze the IPvGO subnet. |
|
||||||
|
| [cheat](./bitburner.go.cheat.md) | | { getCheatSuccessChance(): number; removeRouter( x: number, y: number, ): Promise<{ type: "move" \| "pass" \| "gameOver"; x: number \| null; y: number \| null; }>; playTwoMoves( x1: number, y1: number, x2: number, y2: number, ): Promise<{ type: "move" \| "pass" \| "gameOver"; x: number \| null; y: number \| null; }>; repairOfflineNode( x: number, y: number, ): Promise<{ type: "move" \| "pass" \| "gameOver"; x: number \| null; y: number \| null; }>; destroyNode( x: number, y: number, ): Promise<{ type: "move" \| "pass" \| "gameOver"; x: number \| null; y: number \| null; }>; } | Illicit and dangerous IPvGO tools. Not for the faint of heart. Requires Bitnode 14.2 to use. |
|
||||||
|
|
||||||
|
## Methods
|
||||||
|
|
||||||
|
| Method | Description |
|
||||||
|
| --- | --- |
|
||||||
|
| [getBoardState()](./bitburner.go.getboardstate.md) | <p>Retrieves a simplified version of the board state. "X" represents black pieces, "O" white, and "." empty points. "\#" are dead nodes that are not part of the subnet. (They are not territory nor open nodes.)</p><p>For example, a 5x5 board might look like this:</p><p>\[<br/> "XX.O.",<br/> "X..OO",<br/> ".XO..",<br/> "XXO.\#",<br/> ".XO.\#",<br/> \]</p><p>Each string represents a vertical column on the board, and each character in the string represents a point.</p><p>Traditional notation for Go is e.g. "B,1" referring to second ("B") column, first rank. This is the equivalent of index \[1\]\[0\].</p><p>Note that the \[0\]\[0\] point is shown on the bottom-left on the visual board (as is traditional), and each string represents a vertical column on the board. In other words, the printed example above can be understood to be rotated 90 degrees clockwise compared to the board UI as shown in the IPvGO subnet tab.</p> |
|
||||||
|
| [getCurrentPlayer()](./bitburner.go.getcurrentplayer.md) | Returns the color of the current player, or 'None' if the game is over. |
|
||||||
|
| [getGameState()](./bitburner.go.getgamestate.md) | Gets the status of the current game. Shows the current player, current score, and the previous move coordinates. Previous move coordinates will be \[-1, -1\] for a pass, or if there are no prior moves. |
|
||||||
|
| [getOpponent()](./bitburner.go.getopponent.md) | Returns the name of the opponent faction in the current subnet. |
|
||||||
|
| [makeMove(x, y)](./bitburner.go.makemove.md) | Make a move on the IPvGO subnet gameboard, and await the opponent's response. x:0 y:0 represents the bottom-left corner of the board in the UI. |
|
||||||
|
| [opponentNextTurn(logOpponentMove)](./bitburner.go.opponentnextturn.md) | Returns a promise that resolves with the success or failure state of your last move, and the AI's response, if applicable. x:0 y:0 represents the bottom-left corner of the board in the UI. |
|
||||||
|
| [passTurn()](./bitburner.go.passturn.md) | <p>Pass the player's turn rather than making a move, and await the opponent's response. This ends the game if the opponent passed on the previous turn, or if the opponent passes on their following turn.</p><p>This can also be used if you pick up the game in a state where the opponent needs to play next. For example: if BitBurner was closed while waiting for the opponent to make a move, you may need to call passTurn() to get them to play their move on game start.</p> |
|
||||||
|
| [resetBoardState(opponent, boardSize)](./bitburner.go.resetboardstate.md) | <p>Gets new IPvGO subnet with the specified size owned by the listed faction, ready for the player to make a move. This will reset your win streak if the current game is not complete and you have already made moves.</p><p>Note that some factions will have a few routers on the subnet at this state.</p><p>opponent is "Netburners" or "Slum Snakes" or "The Black Hand" or "Tetrads" or "Daedalus" or "Illuminati" or "????????????",</p> |
|
||||||
|
|
||||||
34
markdown/bitburner.go.opponentnextturn.md
Normal file
34
markdown/bitburner.go.opponentnextturn.md
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||||
|
|
||||||
|
[Home](./index.md) > [bitburner](./bitburner.md) > [Go](./bitburner.go.md) > [opponentNextTurn](./bitburner.go.opponentnextturn.md)
|
||||||
|
|
||||||
|
## Go.opponentNextTurn() method
|
||||||
|
|
||||||
|
Returns a promise that resolves with the success or failure state of your last move, and the AI's response, if applicable. x:0 y:0 represents the bottom-left corner of the board in the UI.
|
||||||
|
|
||||||
|
**Signature:**
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
opponentNextTurn(logOpponentMove?: boolean): Promise<{
|
||||||
|
type: "move" | "pass" | "gameOver";
|
||||||
|
x: number | null;
|
||||||
|
y: number | null;
|
||||||
|
}>;
|
||||||
|
```
|
||||||
|
|
||||||
|
## Parameters
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| logOpponentMove | boolean | _(Optional)_ optional, defaults to true. if false prevents logging opponent move |
|
||||||
|
|
||||||
|
**Returns:**
|
||||||
|
|
||||||
|
Promise<{ type: "move" \| "pass" \| "gameOver"; x: number \| null; y: number \| null; }>
|
||||||
|
|
||||||
|
a promise that contains if your last move was valid and successful, the opponent move's x and y coordinates (or pass) in response, or an indication if the game has ended
|
||||||
|
|
||||||
|
## Remarks
|
||||||
|
|
||||||
|
RAM cost: 0 GB
|
||||||
|
|
||||||
29
markdown/bitburner.go.passturn.md
Normal file
29
markdown/bitburner.go.passturn.md
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||||
|
|
||||||
|
[Home](./index.md) > [bitburner](./bitburner.md) > [Go](./bitburner.go.md) > [passTurn](./bitburner.go.passturn.md)
|
||||||
|
|
||||||
|
## Go.passTurn() method
|
||||||
|
|
||||||
|
Pass the player's turn rather than making a move, and await the opponent's response. This ends the game if the opponent passed on the previous turn, or if the opponent passes on their following turn.
|
||||||
|
|
||||||
|
This can also be used if you pick up the game in a state where the opponent needs to play next. For example: if BitBurner was closed while waiting for the opponent to make a move, you may need to call passTurn() to get them to play their move on game start.
|
||||||
|
|
||||||
|
**Signature:**
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
passTurn(): Promise<{
|
||||||
|
type: "move" | "pass" | "gameOver";
|
||||||
|
x: number | null;
|
||||||
|
y: number | null;
|
||||||
|
}>;
|
||||||
|
```
|
||||||
|
**Returns:**
|
||||||
|
|
||||||
|
Promise<{ type: "move" \| "pass" \| "gameOver"; x: number \| null; y: number \| null; }>
|
||||||
|
|
||||||
|
a promise that contains if your move was valid and successful, the opponent move's x and y coordinates (or pass) in response, or an indication if the game has ended
|
||||||
|
|
||||||
|
## Remarks
|
||||||
|
|
||||||
|
RAM cost: 0 GB
|
||||||
|
|
||||||
35
markdown/bitburner.go.resetboardstate.md
Normal file
35
markdown/bitburner.go.resetboardstate.md
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||||
|
|
||||||
|
[Home](./index.md) > [bitburner](./bitburner.md) > [Go](./bitburner.go.md) > [resetBoardState](./bitburner.go.resetboardstate.md)
|
||||||
|
|
||||||
|
## Go.resetBoardState() method
|
||||||
|
|
||||||
|
Gets new IPvGO subnet with the specified size owned by the listed faction, ready for the player to make a move. This will reset your win streak if the current game is not complete and you have already made moves.
|
||||||
|
|
||||||
|
Note that some factions will have a few routers on the subnet at this state.
|
||||||
|
|
||||||
|
opponent is "Netburners" or "Slum Snakes" or "The Black Hand" or "Tetrads" or "Daedalus" or "Illuminati" or "????????????",
|
||||||
|
|
||||||
|
**Signature:**
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
resetBoardState(opponent: GoOpponent, boardSize: 5 | 7 | 9 | 13): string[] | undefined;
|
||||||
|
```
|
||||||
|
|
||||||
|
## Parameters
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| opponent | [GoOpponent](./bitburner.goopponent.md) | |
|
||||||
|
| boardSize | 5 \| 7 \| 9 \| 13 | |
|
||||||
|
|
||||||
|
**Returns:**
|
||||||
|
|
||||||
|
string\[\] \| undefined
|
||||||
|
|
||||||
|
a simplified version of the board state as an array of strings representing the board columns. See ns.Go.getBoardState() for full details
|
||||||
|
|
||||||
|
## Remarks
|
||||||
|
|
||||||
|
RAM cost: 0 GB
|
||||||
|
|
||||||
19
markdown/bitburner.goopponent.md
Normal file
19
markdown/bitburner.goopponent.md
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||||
|
|
||||||
|
[Home](./index.md) > [bitburner](./bitburner.md) > [GoOpponent](./bitburner.goopponent.md)
|
||||||
|
|
||||||
|
## GoOpponent type
|
||||||
|
|
||||||
|
|
||||||
|
**Signature:**
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
type GoOpponent =
|
||||||
|
| "Netburners"
|
||||||
|
| "Slum Snakes"
|
||||||
|
| "The Black Hand"
|
||||||
|
| "Tetrads"
|
||||||
|
| "Daedalus"
|
||||||
|
| "Illuminati"
|
||||||
|
| "????????????";
|
||||||
|
```
|
||||||
11
markdown/bitburner.graftingtask.augmentation.md
Normal file
11
markdown/bitburner.graftingtask.augmentation.md
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||||
|
|
||||||
|
[Home](./index.md) > [bitburner](./bitburner.md) > [GraftingTask](./bitburner.graftingtask.md) > [augmentation](./bitburner.graftingtask.augmentation.md)
|
||||||
|
|
||||||
|
## GraftingTask.augmentation property
|
||||||
|
|
||||||
|
**Signature:**
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
augmentation: string;
|
||||||
|
```
|
||||||
11
markdown/bitburner.graftingtask.cyclesworked.md
Normal file
11
markdown/bitburner.graftingtask.cyclesworked.md
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||||
|
|
||||||
|
[Home](./index.md) > [bitburner](./bitburner.md) > [GraftingTask](./bitburner.graftingtask.md) > [cyclesWorked](./bitburner.graftingtask.cyclesworked.md)
|
||||||
|
|
||||||
|
## GraftingTask.cyclesWorked property
|
||||||
|
|
||||||
|
**Signature:**
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
cyclesWorked: number;
|
||||||
|
```
|
||||||
26
markdown/bitburner.graftingtask.md
Normal file
26
markdown/bitburner.graftingtask.md
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||||
|
|
||||||
|
[Home](./index.md) > [bitburner](./bitburner.md) > [GraftingTask](./bitburner.graftingtask.md)
|
||||||
|
|
||||||
|
## GraftingTask interface
|
||||||
|
|
||||||
|
Faction Work
|
||||||
|
|
||||||
|
**Signature:**
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
export interface GraftingTask
|
||||||
|
```
|
||||||
|
|
||||||
|
## Remarks
|
||||||
|
|
||||||
|
An object representing the current grafting status
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
| Property | Modifiers | Type | Description |
|
||||||
|
| --- | --- | --- | --- |
|
||||||
|
| [augmentation](./bitburner.graftingtask.augmentation.md) | | string | |
|
||||||
|
| [cyclesWorked](./bitburner.graftingtask.cyclesworked.md) | | number | |
|
||||||
|
| [type](./bitburner.graftingtask.type.md) | | "GRAFTING" | |
|
||||||
|
|
||||||
11
markdown/bitburner.graftingtask.type.md
Normal file
11
markdown/bitburner.graftingtask.type.md
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||||
|
|
||||||
|
[Home](./index.md) > [bitburner](./bitburner.md) > [GraftingTask](./bitburner.graftingtask.md) > [type](./bitburner.graftingtask.type.md)
|
||||||
|
|
||||||
|
## GraftingTask.type property
|
||||||
|
|
||||||
|
**Signature:**
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
type: "GRAFTING";
|
||||||
|
```
|
||||||
33
markdown/bitburner.hackingformulas.growamount.md
Normal file
33
markdown/bitburner.hackingformulas.growamount.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) > [HackingFormulas](./bitburner.hackingformulas.md) > [growAmount](./bitburner.hackingformulas.growamount.md)
|
||||||
|
|
||||||
|
## HackingFormulas.growAmount() method
|
||||||
|
|
||||||
|
Calculate the amount of money a grow action will leave a server with. Starting money is server.moneyAvailable. Note that when simulating the effect of [grow](./bitburner.ns.grow.md)<!-- -->, what matters is the state of the server and player when the grow \*finishes\*, not when it is started.
|
||||||
|
|
||||||
|
The growth amount depends both linearly \*and\* exponentially on threads; see [grow](./bitburner.ns.grow.md) for more details.
|
||||||
|
|
||||||
|
The inverse of this function is [formulas.hacking.growThreads](./bitburner.hackingformulas.growthreads.md)<!-- -->, although it rounds up to integer threads.
|
||||||
|
|
||||||
|
**Signature:**
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
growAmount(server: Server, player: Person, threads: number, cores?: number): number;
|
||||||
|
```
|
||||||
|
|
||||||
|
## Parameters
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| server | [Server](./bitburner.server.md) | Server info, typically from [getServer](./bitburner.ns.getserver.md) |
|
||||||
|
| player | [Person](./bitburner.person.md) | Player info, typically from [getPlayer](./bitburner.ns.getplayer.md) |
|
||||||
|
| threads | number | Number of threads to grow with. Can be fractional. |
|
||||||
|
| cores | number | _(Optional)_ Number of cores on the computer that will execute grow. |
|
||||||
|
|
||||||
|
**Returns:**
|
||||||
|
|
||||||
|
number
|
||||||
|
|
||||||
|
The amount of money after the calculated grow.
|
||||||
|
|
||||||
@@ -4,7 +4,13 @@
|
|||||||
|
|
||||||
## HackingFormulas.growPercent() method
|
## HackingFormulas.growPercent() method
|
||||||
|
|
||||||
Calculate the percent a server would grow to. Not exact due to limitations of mathematics. (Ex: 3.0 would grow the server to 300% of its current value.)
|
Calculate the growth multiplier constant for a given server and threads.
|
||||||
|
|
||||||
|
The actual amount of money grown depends both linearly \*and\* exponentially on threads; this is only giving the exponential part that is used for the multiplier. See [grow](./bitburner.ns.grow.md) for more details.
|
||||||
|
|
||||||
|
As a result of the above, this multiplier does \*not\* depend on the amount of money on the server. Changing server.moneyAvailable and server.moneyMax will have no effect.
|
||||||
|
|
||||||
|
For the most common use-cases, you probably want either [formulas.hacking.growThreads](./bitburner.hackingformulas.growthreads.md) or [formulas.hacking.growAmount](./bitburner.hackingformulas.growamount.md) instead.
|
||||||
|
|
||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
@@ -17,7 +23,7 @@ growPercent(server: Server, threads: number, player: Person, cores?: number): nu
|
|||||||
| Parameter | Type | Description |
|
| Parameter | Type | Description |
|
||||||
| --- | --- | --- |
|
| --- | --- | --- |
|
||||||
| server | [Server](./bitburner.server.md) | Server info, typically from [getServer](./bitburner.ns.getserver.md) |
|
| server | [Server](./bitburner.server.md) | Server info, typically from [getServer](./bitburner.ns.getserver.md) |
|
||||||
| threads | number | Amount of thread. |
|
| threads | number | Amount of threads. Can be fractional. |
|
||||||
| player | [Person](./bitburner.person.md) | Player info, typically from [getPlayer](./bitburner.ns.getplayer.md) |
|
| player | [Person](./bitburner.person.md) | Player info, typically from [getPlayer](./bitburner.ns.getplayer.md) |
|
||||||
| cores | number | _(Optional)_ Number of cores on the computer that will execute grow. |
|
| cores | number | _(Optional)_ Number of cores on the computer that will execute grow. |
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,11 @@
|
|||||||
|
|
||||||
## HackingFormulas.growThreads() method
|
## HackingFormulas.growThreads() method
|
||||||
|
|
||||||
Calculate how many threads it will take to grow server to targetMoney. Starting money is server.moneyAvailable.
|
Calculate how many threads it will take to grow server to targetMoney. Starting money is server.moneyAvailable. Note that when simulating the effect of [grow](./bitburner.ns.grow.md)<!-- -->, what matters is the state of the server and player when the grow \*finishes\*, not when it is started.
|
||||||
|
|
||||||
|
The growth amount depends both linearly \*and\* exponentially on threads; see [grow](./bitburner.ns.grow.md) for more details.
|
||||||
|
|
||||||
|
The inverse of this function is [formulas.hacking.growAmount](./bitburner.hackingformulas.growamount.md)<!-- -->, although it can work with fractional threads.
|
||||||
|
|
||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
|
|||||||
@@ -16,8 +16,9 @@ interface HackingFormulas
|
|||||||
|
|
||||||
| Method | Description |
|
| Method | Description |
|
||||||
| --- | --- |
|
| --- | --- |
|
||||||
| [growPercent(server, threads, player, cores)](./bitburner.hackingformulas.growpercent.md) | Calculate the percent a server would grow to. Not exact due to limitations of mathematics. (Ex: 3.0 would grow the server to 300% of its current value.) |
|
| [growAmount(server, player, threads, cores)](./bitburner.hackingformulas.growamount.md) | <p>Calculate the amount of money a grow action will leave a server with. Starting money is server.moneyAvailable. Note that when simulating the effect of [grow](./bitburner.ns.grow.md)<!-- -->, what matters is the state of the server and player when the grow \*finishes\*, not when it is started.</p><p>The growth amount depends both linearly \*and\* exponentially on threads; see [grow](./bitburner.ns.grow.md) for more details.</p><p>The inverse of this function is [formulas.hacking.growThreads](./bitburner.hackingformulas.growthreads.md)<!-- -->, although it rounds up to integer threads.</p> |
|
||||||
| [growThreads(server, player, targetMoney, cores)](./bitburner.hackingformulas.growthreads.md) | Calculate how many threads it will take to grow server to targetMoney. Starting money is server.moneyAvailable. |
|
| [growPercent(server, threads, player, cores)](./bitburner.hackingformulas.growpercent.md) | <p>Calculate the growth multiplier constant for a given server and threads.</p><p>The actual amount of money grown depends both linearly \*and\* exponentially on threads; this is only giving the exponential part that is used for the multiplier. See [grow](./bitburner.ns.grow.md) for more details.</p><p>As a result of the above, this multiplier does \*not\* depend on the amount of money on the server. Changing server.moneyAvailable and server.moneyMax will have no effect.</p><p>For the most common use-cases, you probably want either [formulas.hacking.growThreads](./bitburner.hackingformulas.growthreads.md) or [formulas.hacking.growAmount](./bitburner.hackingformulas.growamount.md) instead.</p> |
|
||||||
|
| [growThreads(server, player, targetMoney, cores)](./bitburner.hackingformulas.growthreads.md) | <p>Calculate how many threads it will take to grow server to targetMoney. Starting money is server.moneyAvailable. Note that when simulating the effect of [grow](./bitburner.ns.grow.md)<!-- -->, what matters is the state of the server and player when the grow \*finishes\*, not when it is started.</p><p>The growth amount depends both linearly \*and\* exponentially on threads; see [grow](./bitburner.ns.grow.md) for more details.</p><p>The inverse of this function is [formulas.hacking.growAmount](./bitburner.hackingformulas.growamount.md)<!-- -->, although it can work with fractional threads.</p> |
|
||||||
| [growTime(server, player)](./bitburner.hackingformulas.growtime.md) | Calculate grow time. |
|
| [growTime(server, player)](./bitburner.hackingformulas.growtime.md) | Calculate grow time. |
|
||||||
| [hackChance(server, player)](./bitburner.hackingformulas.hackchance.md) | Calculate hack chance. (Ex: 0.25 would indicate a 25% chance of success.) |
|
| [hackChance(server, player)](./bitburner.hackingformulas.hackchance.md) | Calculate hack chance. (Ex: 0.25 would indicate a 25% chance of success.) |
|
||||||
| [hackExp(server, player)](./bitburner.hackingformulas.hackexp.md) | Calculate hack exp for one thread. |
|
| [hackExp(server, player)](./bitburner.hackingformulas.hackexp.md) | Calculate hack exp for one thread. |
|
||||||
|
|||||||
11
markdown/bitburner.infiltrationlocation.maxclearancelevel.md
Normal file
11
markdown/bitburner.infiltrationlocation.maxclearancelevel.md
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||||
|
|
||||||
|
[Home](./index.md) > [bitburner](./bitburner.md) > [InfiltrationLocation](./bitburner.infiltrationlocation.md) > [maxClearanceLevel](./bitburner.infiltrationlocation.maxclearancelevel.md)
|
||||||
|
|
||||||
|
## InfiltrationLocation.maxClearanceLevel property
|
||||||
|
|
||||||
|
**Signature:**
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
maxClearanceLevel: number;
|
||||||
|
```
|
||||||
@@ -17,5 +17,7 @@ interface InfiltrationLocation
|
|||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- |
|
||||||
| [difficulty](./bitburner.infiltrationlocation.difficulty.md) | | number | |
|
| [difficulty](./bitburner.infiltrationlocation.difficulty.md) | | number | |
|
||||||
| [location](./bitburner.infiltrationlocation.location.md) | | [ILocation](./bitburner.ilocation.md) | |
|
| [location](./bitburner.infiltrationlocation.location.md) | | [ILocation](./bitburner.ilocation.md) | |
|
||||||
|
| [maxClearanceLevel](./bitburner.infiltrationlocation.maxclearancelevel.md) | | number | |
|
||||||
| [reward](./bitburner.infiltrationlocation.reward.md) | | [InfiltrationReward](./bitburner.infiltrationreward.md) | |
|
| [reward](./bitburner.infiltrationlocation.reward.md) | | [InfiltrationReward](./bitburner.infiltrationreward.md) | |
|
||||||
|
| [startingSecurityLevel](./bitburner.infiltrationlocation.startingsecuritylevel.md) | | number | |
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,11 @@
|
|||||||
|
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||||
|
|
||||||
|
[Home](./index.md) > [bitburner](./bitburner.md) > [InfiltrationLocation](./bitburner.infiltrationlocation.md) > [startingSecurityLevel](./bitburner.infiltrationlocation.startingsecuritylevel.md)
|
||||||
|
|
||||||
|
## InfiltrationLocation.startingSecurityLevel property
|
||||||
|
|
||||||
|
**Signature:**
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
startingSecurityLevel: number;
|
||||||
|
```
|
||||||
@@ -39,18 +39,22 @@
|
|||||||
| [CodingContract](./bitburner.codingcontract.md) | Coding Contract API |
|
| [CodingContract](./bitburner.codingcontract.md) | Coding Contract API |
|
||||||
| [CompanyPositionInfo](./bitburner.companypositioninfo.md) | Company position requirements and salary. |
|
| [CompanyPositionInfo](./bitburner.companypositioninfo.md) | Company position requirements and salary. |
|
||||||
| [CompanyReputationRequirement](./bitburner.companyreputationrequirement.md) | Player must have at least this much reputation with this company. |
|
| [CompanyReputationRequirement](./bitburner.companyreputationrequirement.md) | Player must have at least this much reputation with this company. |
|
||||||
|
| [CompanyWorkTask](./bitburner.companyworktask.md) | Company Work |
|
||||||
| [CorpConstants](./bitburner.corpconstants.md) | Corporation related constants |
|
| [CorpConstants](./bitburner.corpconstants.md) | Corporation related constants |
|
||||||
| [CorpIndustryData](./bitburner.corpindustrydata.md) | Data for an individual industry |
|
| [CorpIndustryData](./bitburner.corpindustrydata.md) | Data for an individual industry |
|
||||||
| [CorpMaterialConstantData](./bitburner.corpmaterialconstantdata.md) | Corporation material information |
|
| [CorpMaterialConstantData](./bitburner.corpmaterialconstantdata.md) | Corporation material information |
|
||||||
| [Corporation](./bitburner.corporation.md) | Corporation API |
|
| [Corporation](./bitburner.corporation.md) | Corporation API |
|
||||||
| [CorporationInfo](./bitburner.corporationinfo.md) | General info about a corporation |
|
| [CorporationInfo](./bitburner.corporationinfo.md) | General info about a corporation |
|
||||||
| [CorpProductData](./bitburner.corpproductdata.md) | Product rating information |
|
| [CorpProductData](./bitburner.corpproductdata.md) | Product rating information |
|
||||||
|
| [CreateProgramWorkTask](./bitburner.createprogramworktask.md) | Create Program |
|
||||||
| [CrimeStats](./bitburner.crimestats.md) | Data representing the internal values of a crime. |
|
| [CrimeStats](./bitburner.crimestats.md) | Data representing the internal values of a crime. |
|
||||||
|
| [CrimeTask](./bitburner.crimetask.md) | Crime |
|
||||||
| [Division](./bitburner.division.md) | Corporation division |
|
| [Division](./bitburner.division.md) | Corporation division |
|
||||||
| [EmployedByRequirement](./bitburner.employedbyrequirement.md) | Player must be working for this company. |
|
| [EmployedByRequirement](./bitburner.employedbyrequirement.md) | Player must be working for this company. |
|
||||||
| [EquipmentStats](./bitburner.equipmentstats.md) | Object representing data representing a gang member equipment. |
|
| [EquipmentStats](./bitburner.equipmentstats.md) | Object representing data representing a gang member equipment. |
|
||||||
| [EveryRequirement](./bitburner.everyrequirement.md) | All sub-conditions must be satisfied. |
|
| [EveryRequirement](./bitburner.everyrequirement.md) | All sub-conditions must be satisfied. |
|
||||||
| [Export](./bitburner.export.md) | Export order for a material |
|
| [Export](./bitburner.export.md) | Export order for a material |
|
||||||
|
| [FactionWorkTask](./bitburner.factionworktask.md) | Faction Work |
|
||||||
| [FileRequirement](./bitburner.filerequirement.md) | Player must have a specific Literature or Message file on their home computer. |
|
| [FileRequirement](./bitburner.filerequirement.md) | Player must have a specific Literature or Message file on their home computer. |
|
||||||
| [Formulas](./bitburner.formulas.md) | Formulas API |
|
| [Formulas](./bitburner.formulas.md) | Formulas API |
|
||||||
| [Fragment](./bitburner.fragment.md) | |
|
| [Fragment](./bitburner.fragment.md) | |
|
||||||
@@ -60,11 +64,14 @@
|
|||||||
| [GangGenInfo](./bitburner.ganggeninfo.md) | Gang general info. |
|
| [GangGenInfo](./bitburner.ganggeninfo.md) | Gang general info. |
|
||||||
| [GangMemberAscension](./bitburner.gangmemberascension.md) | |
|
| [GangMemberAscension](./bitburner.gangmemberascension.md) | |
|
||||||
| [GangMemberInfo](./bitburner.gangmemberinfo.md) | |
|
| [GangMemberInfo](./bitburner.gangmemberinfo.md) | |
|
||||||
|
| [GangMemberInstall](./bitburner.gangmemberinstall.md) | |
|
||||||
| [GangOtherInfo](./bitburner.gangotherinfo.md) | |
|
| [GangOtherInfo](./bitburner.gangotherinfo.md) | |
|
||||||
| [GangOtherInfoObject](./bitburner.gangotherinfoobject.md) | |
|
| [GangOtherInfoObject](./bitburner.gangotherinfoobject.md) | |
|
||||||
| [GangTaskStats](./bitburner.gangtaskstats.md) | Object representing data representing a gang member task. |
|
| [GangTaskStats](./bitburner.gangtaskstats.md) | Object representing data representing a gang member task. |
|
||||||
| [GangTerritory](./bitburner.gangterritory.md) | |
|
| [GangTerritory](./bitburner.gangterritory.md) | |
|
||||||
|
| [Go](./bitburner.go.md) | IPvGO api |
|
||||||
| [Grafting](./bitburner.grafting.md) | Grafting API |
|
| [Grafting](./bitburner.grafting.md) | Grafting API |
|
||||||
|
| [GraftingTask](./bitburner.graftingtask.md) | Faction Work |
|
||||||
| [HackingFormulas](./bitburner.hackingformulas.md) | Hacking formulas |
|
| [HackingFormulas](./bitburner.hackingformulas.md) | Hacking formulas |
|
||||||
| [HackingMultipliers](./bitburner.hackingmultipliers.md) | Hack related multipliers. |
|
| [HackingMultipliers](./bitburner.hackingmultipliers.md) | Hack related multipliers. |
|
||||||
| [Hacknet](./bitburner.hacknet.md) | Hacknet API |
|
| [Hacknet](./bitburner.hacknet.md) | Hacknet API |
|
||||||
@@ -126,6 +133,7 @@
|
|||||||
| [StockMarketConstants](./bitburner.stockmarketconstants.md) | Constants used for the stockmarket game mechanic. |
|
| [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> |
|
| [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) |
|
| [StockOrderObject](./bitburner.stockorderobject.md) | Value in map of [StockOrder](./bitburner.stockorder.md) |
|
||||||
|
| [StudyTask](./bitburner.studytask.md) | Study |
|
||||||
| [TailProperties](./bitburner.tailproperties.md) | |
|
| [TailProperties](./bitburner.tailproperties.md) | |
|
||||||
| [TIX](./bitburner.tix.md) | Stock market API |
|
| [TIX](./bitburner.tix.md) | Stock market API |
|
||||||
| [UserInterface](./bitburner.userinterface.md) | User Interface API. |
|
| [UserInterface](./bitburner.userinterface.md) | User Interface API. |
|
||||||
@@ -149,11 +157,12 @@
|
|||||||
| [CorpUnlockName](./bitburner.corpunlockname.md) | |
|
| [CorpUnlockName](./bitburner.corpunlockname.md) | |
|
||||||
| [CorpUpgradeName](./bitburner.corpupgradename.md) | |
|
| [CorpUpgradeName](./bitburner.corpupgradename.md) | |
|
||||||
| [FilenameOrPID](./bitburner.filenameorpid.md) | |
|
| [FilenameOrPID](./bitburner.filenameorpid.md) | |
|
||||||
|
| [GoOpponent](./bitburner.goopponent.md) | |
|
||||||
| [NSEnums](./bitburner.nsenums.md) | |
|
| [NSEnums](./bitburner.nsenums.md) | |
|
||||||
| [PlayerRequirement](./bitburner.playerrequirement.md) | Structured interface to requirements for joining a faction or company. For fields with numerical value > 0, the player must have at least this value. For fields with numerical value <<!-- -->= 0, the player must have at most this value. For "not", the sub-condition must be failed instead of passed. For "someCondition", at least one sub-condition must be passed. |
|
| [PlayerRequirement](./bitburner.playerrequirement.md) | Structured interface to requirements for joining a faction or company. For fields with numerical value > 0, the player must have at least this value. For fields with numerical value <<!-- -->= 0, the player must have at most this value. For "not", the sub-condition must be failed instead of passed. For "someCondition", at least one sub-condition must be passed. |
|
||||||
| [PortData](./bitburner.portdata.md) | |
|
|
||||||
| [ReactNode](./bitburner.reactnode.md) | <p>A stand-in for the real React.ReactNode. A [ReactElement](./bitburner.reactelement.md) is rendered dynamically with React. number and string are displayed directly. boolean, null, and undefined are ignored and not rendered. An array of ReactNodes will display all members of that array sequentially.</p><p>Use React.createElement to make the ReactElement type, see [creating an element without jsx](https://react.dev/reference/react/createElement#creating-an-element-without-jsx) from the official React documentation.</p> |
|
| [ReactNode](./bitburner.reactnode.md) | <p>A stand-in for the real React.ReactNode. A [ReactElement](./bitburner.reactelement.md) is rendered dynamically with React. number and string are displayed directly. boolean, null, and undefined are ignored and not rendered. An array of ReactNodes will display all members of that array sequentially.</p><p>Use React.createElement to make the ReactElement type, see [creating an element without jsx](https://react.dev/reference/react/createElement#creating-an-element-without-jsx) from the official React documentation.</p> |
|
||||||
| [ScriptArg](./bitburner.scriptarg.md) | |
|
| [ScriptArg](./bitburner.scriptarg.md) | |
|
||||||
|
| [SimpleOpponentStats](./bitburner.simpleopponentstats.md) | |
|
||||||
| [SleeveBladeburnerTask](./bitburner.sleevebladeburnertask.md) | |
|
| [SleeveBladeburnerTask](./bitburner.sleevebladeburnertask.md) | |
|
||||||
| [SleeveClassTask](./bitburner.sleeveclasstask.md) | |
|
| [SleeveClassTask](./bitburner.sleeveclasstask.md) | |
|
||||||
| [SleeveCompanyTask](./bitburner.sleevecompanytask.md) | |
|
| [SleeveCompanyTask](./bitburner.sleevecompanytask.md) | |
|
||||||
@@ -164,4 +173,5 @@
|
|||||||
| [SleeveSupportTask](./bitburner.sleevesupporttask.md) | |
|
| [SleeveSupportTask](./bitburner.sleevesupporttask.md) | |
|
||||||
| [SleeveSynchroTask](./bitburner.sleevesynchrotask.md) | |
|
| [SleeveSynchroTask](./bitburner.sleevesynchrotask.md) | |
|
||||||
| [SleeveTask](./bitburner.sleevetask.md) | Object representing a sleeve current task. |
|
| [SleeveTask](./bitburner.sleevetask.md) | Object representing a sleeve current task. |
|
||||||
|
| [Task](./bitburner.task.md) | Task |
|
||||||
|
|
||||||
|
|||||||
11
markdown/bitburner.moneysource.gang_expenses.md
Normal file
11
markdown/bitburner.moneysource.gang_expenses.md
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||||
|
|
||||||
|
[Home](./index.md) > [bitburner](./bitburner.md) > [MoneySource](./bitburner.moneysource.md) > [gang\_expenses](./bitburner.moneysource.gang_expenses.md)
|
||||||
|
|
||||||
|
## MoneySource.gang\_expenses property
|
||||||
|
|
||||||
|
**Signature:**
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
gang_expenses: number;
|
||||||
|
```
|
||||||
@@ -22,6 +22,7 @@ interface MoneySource
|
|||||||
| [codingcontract](./bitburner.moneysource.codingcontract.md) | | number | |
|
| [codingcontract](./bitburner.moneysource.codingcontract.md) | | number | |
|
||||||
| [corporation](./bitburner.moneysource.corporation.md) | | number | |
|
| [corporation](./bitburner.moneysource.corporation.md) | | number | |
|
||||||
| [crime](./bitburner.moneysource.crime.md) | | number | |
|
| [crime](./bitburner.moneysource.crime.md) | | number | |
|
||||||
|
| [gang\_expenses](./bitburner.moneysource.gang_expenses.md) | | number | |
|
||||||
| [gang](./bitburner.moneysource.gang.md) | | number | |
|
| [gang](./bitburner.moneysource.gang.md) | | number | |
|
||||||
| [hacking](./bitburner.moneysource.hacking.md) | | number | |
|
| [hacking](./bitburner.moneysource.hacking.md) | | number | |
|
||||||
| [hacknet\_expenses](./bitburner.moneysource.hacknet_expenses.md) | | number | |
|
| [hacknet\_expenses](./bitburner.moneysource.hacknet_expenses.md) | | number | |
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ export interface NetscriptPort
|
|||||||
| [clear()](./bitburner.netscriptport.clear.md) | Empties all data from the port. |
|
| [clear()](./bitburner.netscriptport.clear.md) | Empties all data from the port. |
|
||||||
| [empty()](./bitburner.netscriptport.empty.md) | Check if the port is empty. |
|
| [empty()](./bitburner.netscriptport.empty.md) | Check if the port is empty. |
|
||||||
| [full()](./bitburner.netscriptport.full.md) | Check if the port is full. |
|
| [full()](./bitburner.netscriptport.full.md) | Check if the port is full. |
|
||||||
| [nextWrite()](./bitburner.netscriptport.nextwrite.md) | Sleeps until the port is written to. |
|
| [nextWrite()](./bitburner.netscriptport.nextwrite.md) | Waits until the port is written to. |
|
||||||
| [peek()](./bitburner.netscriptport.peek.md) | Retrieve the first element from the port without removing it. |
|
| [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. |
|
| [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. |
|
| [tryWrite(value)](./bitburner.netscriptport.trywrite.md) | Attempt to write data to the port. |
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
## NetscriptPort.nextWrite() method
|
## NetscriptPort.nextWrite() method
|
||||||
|
|
||||||
Sleeps until the port is written to.
|
Waits until the port is written to.
|
||||||
|
|
||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
|
|||||||
@@ -9,11 +9,11 @@ Retrieve the first element from the port without removing it.
|
|||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
peek(): PortData;
|
peek(): any;
|
||||||
```
|
```
|
||||||
**Returns:**
|
**Returns:**
|
||||||
|
|
||||||
[PortData](./bitburner.portdata.md)
|
any
|
||||||
|
|
||||||
the data read
|
the data read
|
||||||
|
|
||||||
|
|||||||
@@ -9,11 +9,11 @@ Shift an element out of the port.
|
|||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
read(): PortData;
|
read(): any;
|
||||||
```
|
```
|
||||||
**Returns:**
|
**Returns:**
|
||||||
|
|
||||||
[PortData](./bitburner.portdata.md)
|
any
|
||||||
|
|
||||||
the data read.
|
the data read.
|
||||||
|
|
||||||
|
|||||||
@@ -9,14 +9,14 @@ Attempt to write data to the port.
|
|||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
tryWrite(value: string | number): boolean;
|
tryWrite(value: any): boolean;
|
||||||
```
|
```
|
||||||
|
|
||||||
## Parameters
|
## Parameters
|
||||||
|
|
||||||
| Parameter | Type | Description |
|
| Parameter | Type | Description |
|
||||||
| --- | --- | --- |
|
| --- | --- | --- |
|
||||||
| value | string \| number | |
|
| value | any | Data to write, it's cloned with structuredClone(). |
|
||||||
|
|
||||||
**Returns:**
|
**Returns:**
|
||||||
|
|
||||||
|
|||||||
@@ -9,18 +9,18 @@ Write data to a port.
|
|||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
write(value: string | number): PortData | null;
|
write(value: any): any;
|
||||||
```
|
```
|
||||||
|
|
||||||
## Parameters
|
## Parameters
|
||||||
|
|
||||||
| Parameter | Type | Description |
|
| Parameter | Type | Description |
|
||||||
| --- | --- | --- |
|
| --- | --- | --- |
|
||||||
| value | string \| number | |
|
| value | any | Data to write, it's cloned with structuredClone(). |
|
||||||
|
|
||||||
**Returns:**
|
**Returns:**
|
||||||
|
|
||||||
[PortData](./bitburner.portdata.md) \| null
|
any
|
||||||
|
|
||||||
The data popped off the queue if it was full.
|
The data popped off the queue if it was full.
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ Arguments passed into the script.
|
|||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
readonly args: (string | number | boolean)[];
|
readonly args: ScriptArg[];
|
||||||
```
|
```
|
||||||
|
|
||||||
## Remarks
|
## Remarks
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ Add callback function when the script dies
|
|||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
atExit(f: () => void): void;
|
atExit(f: () => void, id?: string): void;
|
||||||
```
|
```
|
||||||
|
|
||||||
## Parameters
|
## Parameters
|
||||||
@@ -17,6 +17,7 @@ atExit(f: () => void): void;
|
|||||||
| Parameter | Type | Description |
|
| Parameter | Type | Description |
|
||||||
| --- | --- | --- |
|
| --- | --- | --- |
|
||||||
| f | () => void | |
|
| f | () => void | |
|
||||||
|
| id | string | _(Optional)_ |
|
||||||
|
|
||||||
**Returns:**
|
**Returns:**
|
||||||
|
|
||||||
|
|||||||
@@ -28,3 +28,5 @@ RAM cost: 0 GB
|
|||||||
|
|
||||||
Logging can be disabled for all functions by passing `ALL` as the argument.
|
Logging can be disabled for all functions by passing `ALL` as the argument.
|
||||||
|
|
||||||
|
For specific interfaces, use the form "namespace.functionName". (e.g. "ui.setTheme")
|
||||||
|
|
||||||
|
|||||||
@@ -9,12 +9,7 @@ Start another script on any server.
|
|||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
exec(
|
exec(script: string, hostname: string, threadOrOptions?: number | RunOptions, ...args: ScriptArg[]): number;
|
||||||
script: string,
|
|
||||||
hostname: string,
|
|
||||||
threadOrOptions?: number | RunOptions,
|
|
||||||
...args: (string | number | boolean)[]
|
|
||||||
): number;
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Parameters
|
## Parameters
|
||||||
@@ -24,7 +19,7 @@ exec(
|
|||||||
| script | string | Filename of script to execute. This file must already exist on the target server. |
|
| script | string | Filename of script to execute. This file must already exist on the target server. |
|
||||||
| hostname | string | Hostname of the <code>target server</code> on which to execute the script. |
|
| hostname | string | Hostname of the <code>target server</code> on which to execute the script. |
|
||||||
| 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 \| [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. |
|
||||||
| args | (string \| number \| boolean)\[\] | Additional arguments to pass into the new script that is being run. Note that if any arguments are being passed into the new script, then the third argument threadOrOptions must be filled in with a value. |
|
| args | [ScriptArg](./bitburner.scriptarg.md)<!-- -->\[\] | Additional arguments to pass into the new script that is being run. Note that if any arguments are being passed into the new script, then the third argument threadOrOptions must be filled in with a value. |
|
||||||
|
|
||||||
**Returns:**
|
**Returns:**
|
||||||
|
|
||||||
|
|||||||
@@ -28,6 +28,12 @@ RAM cost: 0 GB
|
|||||||
|
|
||||||
Allows Unix-like flag parsing.
|
Allows Unix-like flag parsing.
|
||||||
|
|
||||||
|
We support 2 forms:
|
||||||
|
|
||||||
|
- Short form: the flag contains only 1 character, e.g. -v.
|
||||||
|
|
||||||
|
- Long form: the flag contains more than 1 character, e.g. --version.
|
||||||
|
|
||||||
## Example
|
## Example
|
||||||
|
|
||||||
|
|
||||||
@@ -38,21 +44,24 @@ export async function main(ns) {
|
|||||||
['server', 'foodnstuff'], // a default string means this flag is a string
|
['server', 'foodnstuff'], // a default string means this flag is a string
|
||||||
['exclude', []], // a default array means this flag is a default array of string
|
['exclude', []], // a default array means this flag is a default array of string
|
||||||
['help', false], // a default boolean means this flag is a boolean
|
['help', false], // a default boolean means this flag is a boolean
|
||||||
|
['v', false], // short form
|
||||||
]);
|
]);
|
||||||
ns.tprint(data);
|
ns.tprint(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
// [home ~/]> run example.js
|
// [home ~/]> run example.js
|
||||||
// {"_":[],"delay":0,"server":"foodnstuff","exclude":[],"help":false}
|
// {"_":[],"delay":0,"server":"foodnstuff","exclude":[],"help":false,"v":false}
|
||||||
// [home ~/]> run example.js --delay 3000
|
// [home ~/]> run example.js --delay 3000
|
||||||
// {"_":[],"server":"foodnstuff","exclude":[],"help":false,"delay":3000}
|
// {"_":[],"delay":3000,"server":"foodnstuff","exclude":[],"help":false,"v":false}
|
||||||
// [home ~/]> run example.js --delay 3000 --server harakiri-sushi
|
// [home ~/]> run example.js --delay 3000 --server harakiri-sushi
|
||||||
// {"_":[],"exclude":[],"help":false,"delay":3000,"server":"harakiri-sushi"}
|
// {"_":[],"delay":3000,"server":"harakiri-sushi","exclude":[],"help":false,"v":false}
|
||||||
// [home ~/]> run example.js --delay 3000 --server harakiri-sushi hello world
|
// [home ~/]> run example.js --delay 3000 --server harakiri-sushi hello world
|
||||||
// {"_":["hello","world"],"exclude":[],"help":false,"delay":3000,"server":"harakiri-sushi"}
|
// {"_":["hello","world"],"delay":3000,"server":"harakiri-sushi","exclude":[],"help":false,"v":false}
|
||||||
// [home ~/]> run example.js --delay 3000 --server harakiri-sushi hello world --exclude a --exclude b
|
// [home ~/]> run example.js --delay 3000 --server harakiri-sushi hello world --exclude a --exclude b
|
||||||
// {"_":["hello","world"],"help":false,"delay":3000,"server":"harakiri-sushi","exclude":["a","b"]}
|
// {"_":["hello","world"],"delay":3000,"server":"harakiri-sushi","exclude":["a","b"],"help":false,"v":false}
|
||||||
// [home ~/]> run example.script --help
|
// [home ~/]> run example.js --help
|
||||||
// {"_":[],"delay":0,"server":"foodnstuff","exclude":[],"help":true}
|
// {"_":[],"delay":0,"server":"foodnstuff","exclude":[],"help":true,"v":false}
|
||||||
|
// [home ~/]> run example.js -v
|
||||||
|
// {"_":[],"delay":0,"server":"foodnstuff","exclude":[],"help":false,"v":true}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -29,6 +29,6 @@ Returns an object containing the Player’s hacking related multipliers. These m
|
|||||||
```js
|
```js
|
||||||
const mults = ns.getHackingMultipliers();
|
const mults = ns.getHackingMultipliers();
|
||||||
print(`chance: ${mults.chance}`);
|
print(`chance: ${mults.chance}`);
|
||||||
print(`growthL ${mults.growth}`);
|
print(`growth: ${mults.growth}`);
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -9,11 +9,7 @@ Get general info about a running script.
|
|||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
getRunningScript(
|
getRunningScript(filename?: FilenameOrPID, hostname?: string, ...args: ScriptArg[]): RunningScript | null;
|
||||||
filename?: FilenameOrPID,
|
|
||||||
hostname?: string,
|
|
||||||
...args: (string | number | boolean)[]
|
|
||||||
): RunningScript | null;
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Parameters
|
## Parameters
|
||||||
@@ -22,7 +18,7 @@ getRunningScript(
|
|||||||
| --- | --- | --- |
|
| --- | --- | --- |
|
||||||
| filename | [FilenameOrPID](./bitburner.filenameorpid.md) | _(Optional)_ Optional. Filename or PID of the script. |
|
| filename | [FilenameOrPID](./bitburner.filenameorpid.md) | _(Optional)_ Optional. Filename or PID of the script. |
|
||||||
| hostname | string | _(Optional)_ Hostname of target server. Optional, defaults to the server the calling script is running on. |
|
| 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. |
|
| args | [ScriptArg](./bitburner.scriptarg.md)<!-- -->\[\] | Arguments to specify/identify the script. Optional, when looking for scripts run without arguments. |
|
||||||
|
|
||||||
**Returns:**
|
**Returns:**
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ Get the exp gain of a script.
|
|||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
getScriptExpGain(script: string, host: string, ...args: (string | number | boolean)[]): number;
|
getScriptExpGain(script: string, host: string, ...args: ScriptArg[]): number;
|
||||||
```
|
```
|
||||||
|
|
||||||
## Parameters
|
## Parameters
|
||||||
@@ -18,7 +18,7 @@ getScriptExpGain(script: string, host: string, ...args: (string | number | boole
|
|||||||
| --- | --- | --- |
|
| --- | --- | --- |
|
||||||
| script | string | Filename of script. |
|
| script | string | Filename of script. |
|
||||||
| host | string | Server on which script is running. |
|
| host | string | Server on which script is running. |
|
||||||
| args | (string \| number \| boolean)\[\] | Arguments that the script is running with. |
|
| args | [ScriptArg](./bitburner.scriptarg.md)<!-- -->\[\] | Arguments that the script is running with. |
|
||||||
|
|
||||||
**Returns:**
|
**Returns:**
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ Get the income of a script.
|
|||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
getScriptIncome(script: string, host: string, ...args: (string | number | boolean)[]): number;
|
getScriptIncome(script: string, host: string, ...args: ScriptArg[]): number;
|
||||||
```
|
```
|
||||||
|
|
||||||
## Parameters
|
## Parameters
|
||||||
@@ -18,7 +18,7 @@ getScriptIncome(script: string, host: string, ...args: (string | number | boolea
|
|||||||
| --- | --- | --- |
|
| --- | --- | --- |
|
||||||
| script | string | Filename of script. |
|
| script | string | Filename of script. |
|
||||||
| host | string | Server on which script is running. |
|
| host | string | Server on which script is running. |
|
||||||
| args | (string \| number \| boolean)\[\] | Arguments that the script is running with. |
|
| args | [ScriptArg](./bitburner.scriptarg.md)<!-- -->\[\] | Arguments that the script is running with. |
|
||||||
|
|
||||||
**Returns:**
|
**Returns:**
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ Get all the logs of a script.
|
|||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
getScriptLogs(fn?: FilenameOrPID, host?: string, ...args: (string | number | boolean)[]): string[];
|
getScriptLogs(fn?: FilenameOrPID, host?: string, ...args: ScriptArg[]): string[];
|
||||||
```
|
```
|
||||||
|
|
||||||
## Parameters
|
## Parameters
|
||||||
@@ -18,7 +18,7 @@ getScriptLogs(fn?: FilenameOrPID, host?: string, ...args: (string | number | boo
|
|||||||
| --- | --- | --- |
|
| --- | --- | --- |
|
||||||
| fn | [FilenameOrPID](./bitburner.filenameorpid.md) | _(Optional)_ Optional. Filename or PID 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. |
|
| 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. |
|
| args | [ScriptArg](./bitburner.scriptarg.md)<!-- -->\[\] | Arguments to identify which scripts to get logs for. |
|
||||||
|
|
||||||
**Returns:**
|
**Returns:**
|
||||||
|
|
||||||
|
|||||||
18
markdown/bitburner.ns.go.md
Normal file
18
markdown/bitburner.ns.go.md
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||||
|
|
||||||
|
[Home](./index.md) > [bitburner](./bitburner.md) > [NS](./bitburner.ns.md) > [go](./bitburner.ns.go.md)
|
||||||
|
|
||||||
|
## NS.go property
|
||||||
|
|
||||||
|
Namespace for Go functions.
|
||||||
|
|
||||||
|
**Signature:**
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
readonly go: Go;
|
||||||
|
```
|
||||||
|
|
||||||
|
## Remarks
|
||||||
|
|
||||||
|
RAM cost: 0 GB
|
||||||
|
|
||||||
@@ -41,7 +41,9 @@ The multiplier scales exponentially with thread count, and its base depends on t
|
|||||||
|
|
||||||
[growthAnalyze](./bitburner.ns.growthanalyze.md) can be used to determine the number of threads needed for a specified multiplicative portion of server growth.
|
[growthAnalyze](./bitburner.ns.growthanalyze.md) can be used to determine the number of threads needed for a specified multiplicative portion of server growth.
|
||||||
|
|
||||||
To determine the effect of a single grow, obtain access to the Formulas API and use [formulas.hacking.growPercent](./bitburner.hackingformulas.growpercent.md)<!-- -->, or invert [growthAnalyze](./bitburner.ns.growthanalyze.md)<!-- -->.
|
To determine the effect of a single grow, obtain access to the Formulas API and use [formulas.hacking.growPercent](./bitburner.hackingformulas.growamount.md)<!-- -->, or invert [growthAnalyze](./bitburner.ns.growthanalyze.md)<!-- -->.
|
||||||
|
|
||||||
|
To determine how many threads are needed to return a server to max money, obtain access to the Formulas API and use [formulas.hacking.growThreads](./bitburner.hackingformulas.growthreads.md)<!-- -->, or [NS.growthAnalyze()](./bitburner.ns.growthanalyze.md) \*if\* the server will be at the same security in the future.
|
||||||
|
|
||||||
Like [hack](./bitburner.ns.hack.md)<!-- -->, `grow` can be called on any hackable server, regardless of where the script is running. Hackable servers are any servers not owned by the player.
|
Like [hack](./bitburner.ns.hack.md)<!-- -->, `grow` can be called on any hackable server, regardless of where the script is running. Hackable servers are any servers not owned by the player.
|
||||||
|
|
||||||
|
|||||||
13
markdown/bitburner.ns.heart.md
Normal file
13
markdown/bitburner.ns.heart.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) > [NS](./bitburner.ns.md) > [heart](./bitburner.ns.heart.md)
|
||||||
|
|
||||||
|
## NS.heart property
|
||||||
|
|
||||||
|
**Signature:**
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
readonly heart: {
|
||||||
|
break(): number;
|
||||||
|
};
|
||||||
|
```
|
||||||
@@ -9,7 +9,7 @@ Check if a script is running.
|
|||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
isRunning(script: FilenameOrPID, host?: string, ...args: (string | number | boolean)[]): boolean;
|
isRunning(script: FilenameOrPID, host?: string, ...args: ScriptArg[]): boolean;
|
||||||
```
|
```
|
||||||
|
|
||||||
## Parameters
|
## Parameters
|
||||||
@@ -18,7 +18,7 @@ isRunning(script: FilenameOrPID, host?: string, ...args: (string | number | bool
|
|||||||
| --- | --- | --- |
|
| --- | --- | --- |
|
||||||
| script | [FilenameOrPID](./bitburner.filenameorpid.md) | Filename or PID 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 | _(Optional)_ Hostname of target server. Optional, defaults to the server the calling script is running on. |
|
| 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. |
|
| args | [ScriptArg](./bitburner.scriptarg.md)<!-- -->\[\] | Arguments to specify/identify the script. Optional, when looking for scripts run without arguments. |
|
||||||
|
|
||||||
**Returns:**
|
**Returns:**
|
||||||
|
|
||||||
|
|||||||
@@ -31,15 +31,17 @@ export async function main(ns) {
|
|||||||
|
|
||||||
| Property | Modifiers | Type | Description |
|
| Property | Modifiers | Type | Description |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- |
|
||||||
| [args](./bitburner.ns.args.md) | <code>readonly</code> | (string \| number \| boolean)\[\] | Arguments passed into the script. |
|
| [args](./bitburner.ns.args.md) | <code>readonly</code> | [ScriptArg](./bitburner.scriptarg.md)<!-- -->\[\] | Arguments passed into the script. |
|
||||||
| [bladeburner](./bitburner.ns.bladeburner.md) | <code>readonly</code> | [Bladeburner](./bitburner.bladeburner.md) | Namespace for bladeburner functions. Contains spoilers. |
|
| [bladeburner](./bitburner.ns.bladeburner.md) | <code>readonly</code> | [Bladeburner](./bitburner.bladeburner.md) | Namespace for bladeburner functions. Contains spoilers. |
|
||||||
| [codingcontract](./bitburner.ns.codingcontract.md) | <code>readonly</code> | [CodingContract](./bitburner.codingcontract.md) | Namespace for codingcontract functions. |
|
| [codingcontract](./bitburner.ns.codingcontract.md) | <code>readonly</code> | [CodingContract](./bitburner.codingcontract.md) | Namespace for codingcontract functions. |
|
||||||
| [corporation](./bitburner.ns.corporation.md) | <code>readonly</code> | [Corporation](./bitburner.corporation.md) | Namespace for corporation functions. Contains spoilers. |
|
| [corporation](./bitburner.ns.corporation.md) | <code>readonly</code> | [Corporation](./bitburner.corporation.md) | Namespace for corporation functions. Contains spoilers. |
|
||||||
| [enums](./bitburner.ns.enums.md) | | [NSEnums](./bitburner.nsenums.md) | |
|
| [enums](./bitburner.ns.enums.md) | | [NSEnums](./bitburner.nsenums.md) | |
|
||||||
| [formulas](./bitburner.ns.formulas.md) | <code>readonly</code> | [Formulas](./bitburner.formulas.md) | Namespace for formulas functions. |
|
| [formulas](./bitburner.ns.formulas.md) | <code>readonly</code> | [Formulas](./bitburner.formulas.md) | Namespace for formulas functions. |
|
||||||
| [gang](./bitburner.ns.gang.md) | <code>readonly</code> | [Gang](./bitburner.gang.md) | Namespace for gang functions. Contains spoilers. |
|
| [gang](./bitburner.ns.gang.md) | <code>readonly</code> | [Gang](./bitburner.gang.md) | Namespace for gang functions. Contains spoilers. |
|
||||||
|
| [go](./bitburner.ns.go.md) | <code>readonly</code> | [Go](./bitburner.go.md) | Namespace for Go functions. |
|
||||||
| [grafting](./bitburner.ns.grafting.md) | <code>readonly</code> | [Grafting](./bitburner.grafting.md) | Namespace for grafting functions. Contains spoilers. |
|
| [grafting](./bitburner.ns.grafting.md) | <code>readonly</code> | [Grafting](./bitburner.grafting.md) | Namespace for grafting functions. Contains spoilers. |
|
||||||
| [hacknet](./bitburner.ns.hacknet.md) | <code>readonly</code> | [Hacknet](./bitburner.hacknet.md) | Namespace for hacknet functions. Some of this API contains spoilers. |
|
| [hacknet](./bitburner.ns.hacknet.md) | <code>readonly</code> | [Hacknet](./bitburner.hacknet.md) | Namespace for hacknet functions. Some of this API contains spoilers. |
|
||||||
|
| [heart](./bitburner.ns.heart.md) | <code>readonly</code> | { break(): number; } | |
|
||||||
| [infiltration](./bitburner.ns.infiltration.md) | <code>readonly</code> | [Infiltration](./bitburner.infiltration.md) | Namespace for infiltration functions. |
|
| [infiltration](./bitburner.ns.infiltration.md) | <code>readonly</code> | [Infiltration](./bitburner.infiltration.md) | Namespace for infiltration functions. |
|
||||||
| [pid](./bitburner.ns.pid.md) | <code>readonly</code> | number | The current script's PID |
|
| [pid](./bitburner.ns.pid.md) | <code>readonly</code> | number | The current script's PID |
|
||||||
| [singularity](./bitburner.ns.singularity.md) | <code>readonly</code> | [Singularity](./bitburner.singularity.md) | Namespace for singularity functions. Contains spoilers. |
|
| [singularity](./bitburner.ns.singularity.md) | <code>readonly</code> | [Singularity](./bitburner.singularity.md) | Namespace for singularity functions. Contains spoilers. |
|
||||||
@@ -54,7 +56,7 @@ export async function main(ns) {
|
|||||||
| --- | --- |
|
| --- | --- |
|
||||||
| [alert(msg)](./bitburner.ns.alert.md) | Open up a message box. |
|
| [alert(msg)](./bitburner.ns.alert.md) | Open up a message box. |
|
||||||
| [asleep(millis)](./bitburner.ns.asleep.md) | Suspends the script for n milliseconds. Doesn't block with concurrent calls. |
|
| [asleep(millis)](./bitburner.ns.asleep.md) | Suspends the script for n milliseconds. Doesn't block with concurrent calls. |
|
||||||
| [atExit(f)](./bitburner.ns.atexit.md) | Add callback function when the script dies |
|
| [atExit(f, id)](./bitburner.ns.atexit.md) | Add callback function when the script dies |
|
||||||
| [brutessh(host)](./bitburner.ns.brutessh.md) | Runs BruteSSH.exe on a server. |
|
| [brutessh(host)](./bitburner.ns.brutessh.md) | Runs BruteSSH.exe on a server. |
|
||||||
| [clear(handle)](./bitburner.ns.clear.md) | Clear data from a file. |
|
| [clear(handle)](./bitburner.ns.clear.md) | Clear data from a file. |
|
||||||
| [clearLog()](./bitburner.ns.clearlog.md) | Clears the script’s logs. |
|
| [clearLog()](./bitburner.ns.clearlog.md) | Clears the script’s logs. |
|
||||||
@@ -131,6 +133,7 @@ export async function main(ns) {
|
|||||||
| [ls(host, substring)](./bitburner.ns.ls.md) | List files on a server. |
|
| [ls(host, substring)](./bitburner.ns.ls.md) | List files on a server. |
|
||||||
| [moveTail(x, y, pid)](./bitburner.ns.movetail.md) | Move a tail window. |
|
| [moveTail(x, y, pid)](./bitburner.ns.movetail.md) | Move a tail window. |
|
||||||
| [mv(host, source, destination)](./bitburner.ns.mv.md) | Move a file on the target server. |
|
| [mv(host, source, destination)](./bitburner.ns.mv.md) | Move a file on the target server. |
|
||||||
|
| [nextPortWrite(port)](./bitburner.ns.nextportwrite.md) | Listen for a port write. |
|
||||||
| [nFormat(n, format)](./bitburner.ns.nformat.md) | Format a number using the numeral library. This function is deprecated and will be removed in 2.4. |
|
| [nFormat(n, format)](./bitburner.ns.nformat.md) | Format a number using the numeral library. This function is deprecated and will be removed in 2.4. |
|
||||||
| [nuke(host)](./bitburner.ns.nuke.md) | Runs NUKE.exe on a server. |
|
| [nuke(host)](./bitburner.ns.nuke.md) | Runs NUKE.exe on a server. |
|
||||||
| [peek(portNumber)](./bitburner.ns.peek.md) | Get a copy of the data from a port without popping it. |
|
| [peek(portNumber)](./bitburner.ns.peek.md) | Get a copy of the data from a port without popping it. |
|
||||||
|
|||||||
30
markdown/bitburner.ns.nextportwrite.md
Normal file
30
markdown/bitburner.ns.nextportwrite.md
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||||
|
|
||||||
|
[Home](./index.md) > [bitburner](./bitburner.md) > [NS](./bitburner.ns.md) > [nextPortWrite](./bitburner.ns.nextportwrite.md)
|
||||||
|
|
||||||
|
## NS.nextPortWrite() method
|
||||||
|
|
||||||
|
Listen for a port write.
|
||||||
|
|
||||||
|
**Signature:**
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
nextPortWrite(port: number): Promise<void>;
|
||||||
|
```
|
||||||
|
|
||||||
|
## Parameters
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| port | number | Port to listen for a write on. Must be a positive integer. |
|
||||||
|
|
||||||
|
**Returns:**
|
||||||
|
|
||||||
|
Promise<void>
|
||||||
|
|
||||||
|
## Remarks
|
||||||
|
|
||||||
|
RAM cost: 0 GB
|
||||||
|
|
||||||
|
Sleeps until the port is written to.
|
||||||
|
|
||||||
@@ -9,7 +9,7 @@ Get a copy of the data from a port without popping it.
|
|||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
peek(portNumber: number): PortData;
|
peek(portNumber: number): any;
|
||||||
```
|
```
|
||||||
|
|
||||||
## Parameters
|
## Parameters
|
||||||
@@ -20,7 +20,7 @@ peek(portNumber: number): PortData;
|
|||||||
|
|
||||||
**Returns:**
|
**Returns:**
|
||||||
|
|
||||||
[PortData](./bitburner.portdata.md)
|
any
|
||||||
|
|
||||||
Data in the specified port.
|
Data in the specified port.
|
||||||
|
|
||||||
|
|||||||
@@ -32,7 +32,9 @@ True if the player clicks “Yes”; false if the player clicks “No”; or the
|
|||||||
|
|
||||||
RAM cost: 0 GB
|
RAM cost: 0 GB
|
||||||
|
|
||||||
Prompts the player with a dialog box. Here is an explanation of the various options.
|
Prompts the player with a dialog box and returns a promise. If the player cancels this dialog box (press X button or click outside the dialog box), the promise is resolved with a default value (empty string or "false"). If this API is called again while the old dialog box still exists, the old dialog box will be replaced with a new one, and the old promise will be resolved with the default value.
|
||||||
|
|
||||||
|
Here is an explanation of the various options.
|
||||||
|
|
||||||
- `options.type` is not provided to the function. If `options.type` is left out and only a string is passed to the function, then the default behavior is to create a boolean dialog box.
|
- `options.type` is not provided to the function. If `options.type` is left out and only a string is passed to the function, then the default behavior is to create a boolean dialog box.
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ Read data from a port.
|
|||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
readPort(portNumber: number): PortData;
|
readPort(portNumber: number): any;
|
||||||
```
|
```
|
||||||
|
|
||||||
## Parameters
|
## Parameters
|
||||||
@@ -20,7 +20,7 @@ readPort(portNumber: number): PortData;
|
|||||||
|
|
||||||
**Returns:**
|
**Returns:**
|
||||||
|
|
||||||
[PortData](./bitburner.portdata.md)
|
any
|
||||||
|
|
||||||
The data read.
|
The data read.
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ Start another script on the current server.
|
|||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
run(script: string, threadOrOptions?: number | RunOptions, ...args: (string | number | boolean)[]): number;
|
run(script: string, threadOrOptions?: number | RunOptions, ...args: ScriptArg[]): number;
|
||||||
```
|
```
|
||||||
|
|
||||||
## Parameters
|
## Parameters
|
||||||
@@ -18,7 +18,7 @@ run(script: string, threadOrOptions?: number | RunOptions, ...args: (string | nu
|
|||||||
| --- | --- | --- |
|
| --- | --- | --- |
|
||||||
| script | string | Filename of script to run. |
|
| script | string | Filename of script to run. |
|
||||||
| 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 \| [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. |
|
||||||
| args | (string \| number \| boolean)\[\] | Additional arguments to pass into the new script that is being run. Note that if any arguments are being passed into the new script, then the second argument threadOrOptions must be filled in with a value. |
|
| args | [ScriptArg](./bitburner.scriptarg.md)<!-- -->\[\] | Additional arguments to pass into the new script that is being run. Note that if any arguments are being passed into the new script, then the second argument threadOrOptions must be filled in with a value. |
|
||||||
|
|
||||||
**Returns:**
|
**Returns:**
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user