Compare commits

..

199 Commits

Author SHA1 Message Date
omuretsu
f55551c0cd 2.3.1 release 2023-06-07 14:41:36 -04:00
Kateract
cc5247ac89 Update exportMaterial amount to number | string (#583) 2023-06-07 13:48:23 -04:00
Snarling
c67f32cdc1 CORP: Validate city with office for product development (#579) 2023-06-07 00:30:10 -04:00
Snarling
cbff2a420b CORP: Robotics industry NaN fix + better exports validation (#578) 2023-06-06 23:50:23 -04:00
quacksouls
4c4c4a0335 DOC: additionalMsec is no longer experimental (#576)
The attribute `additionalMsec` of the object `BasicHGWOptions` was experimental in v2.2.2.  It is now a stable feature.
2023-06-06 17:19:07 -04:00
Snarling
40b89baca1 MISC: Various small fixes (#574)
* ns.ls filter can include leading slash in filename
* scp from terminal accepts multiple filenames
* terminal displays root / instead of ~ as base
* cd with no args returns to root
2023-06-06 08:46:07 -04:00
HiEv
ed93fea141 DOC: Remove invalid use of const in example code (#573) 2023-06-06 01:49:48 -04:00
Aleksei Bezrodnov
027db7e867 MISC: optimize corp affordable upgrade level calculation (#570) 2023-06-06 01:45:28 -04:00
omuretsu
abbf99f2cb Dev changelog update 2023-06-04 12:12:55 -04:00
Aleksei Bezrodnov
7050c90378 UI: Fix several issues with script editor tabs (#554) (#567) 2023-06-04 12:01:06 -04:00
zerbosh
bda1daf49f CORPORATION: parse material Sell field once (#562) 2023-06-04 10:28:35 -04:00
zerbosh
d8fee8e25a CORPORATION: fixed Sell Buttons (#564) 2023-06-04 00:13:26 -04:00
David Walker
3c6b5a1a83 BUGFIX: Fix corp issues relating to imports (#568)
Also clarify the Smart Supply options to be more clear on what they do.
2023-06-04 00:11:07 -04:00
Snarling
403beef69e PRESTIGE: Make bitnode reset synchronous again (#566)
* Make prestige synchronous
2023-06-03 18:04:45 -04:00
Snarling
ec9e7ffa3a GANG: Fix respectGainRate being stored incorrectly (#565) 2023-06-03 16:44:35 -04:00
Aleksei Bezrodnov
dd9849f53d BUGFIX: script tab reordering (#563) 2023-06-03 14:26:55 -04:00
Aleksei Bezrodnov
99954ebd1e REFACTORING: ScriptEditor (#560) 2023-06-03 13:55:25 -04:00
omuretsu
886f402a43 Fix infinite time to hack on 0-difficulty servers 2023-06-02 12:32:06 -04:00
omuretsu
68405b2873 Changelog update 2023-06-01 15:27:07 -04:00
Kateract
10215a924c CORP: Add maxProducts property to division, consolidate maxProducts logic (#551) 2023-06-01 15:20:54 -04:00
David Walker
0d6015104e BUGFIX: Proper default title for loaded RunningScripts (#557) 2023-06-01 06:42:55 -04:00
David Walker
4d1cdaad32 UI: Add title tooltips to tail window elements (#558) 2023-06-01 06:42:06 -04:00
omuretsu
7240bbe8b7 Fix hotfix 2023-05-30 20:47:01 -04:00
omuretsu
8bc67f542a Satisfy lint 2023-05-30 20:06:13 -04:00
omuretsu
b65bd62345 More hotfixes...
* Script editor theme could be corrupted leading to a recovery screen, this should fix that.
* Because script filepath changes were moved before the detection of .ns files, a check was added for .ns files in BaseServer so they get the better name.
2023-05-30 20:00:43 -04:00
Snarling
1aa53739cc Hotfix 30 May 2023 (#555) 2023-05-30 18:48:16 -04:00
omuretsu
469c70ed4b Update dev changelog 2023-05-29 18:43:16 -04:00
bezrodnov
606b4bee95 UI: Prevent terminal scroll on progress bar update (fix #94) (#544) 2023-05-29 14:59:17 -04:00
ttvasterikx
becca87224 Update gettingstartedguideforbeginnerprogrammers.rst (#548) 2023-05-29 14:53:47 -04:00
bezrodnov
ea8f5cede7 add close modal button (#546) 2023-05-29 11:54:14 -04:00
David Walker
e51527aa86 BUGFIX: More savegame loading fixes (#543)
* Fix loading issues back to pre-1.0
* Be more robust about issues with files not being maps
* Avoid non-fatal error when there's no LastExportBonus
2023-05-29 07:10:26 -04:00
Snarling
5f2a1c3f27 TERMINAL: Fix original alias syntax (#545) 2023-05-29 06:54:51 -04:00
omuretsu
7f852373d8 Fix test
Was using old method of saving scripts which is now removed (was removing possible sources of the script hostname mismatch error)
2023-05-28 05:43:09 -04:00
omuretsu
ae8f26f03b More hotfix
* Fix empty solution for all valid math expressions
2023-05-28 05:25:44 -04:00
Snarling
8e4492685d Fix scan analyze display (#539) 2023-05-27 19:30:24 -04:00
omuretsu
72a631d4ed Another lint fix 2023-05-27 08:46:28 -04:00
omuretsu
8bf13b6fd3 fileExists no longer case sensitive for programs 2023-05-27 08:39:29 -04:00
omuretsu
ad3b217b8f lint fix
Fix sloppy unlinted hotfix code
2023-05-27 01:58:47 -04:00
omuretsu
e03a366f12 hotfix broken spring water 2023-05-27 01:53:13 -04:00
David Walker
db26d054fc Various fixes to our upgrade logic (#536)
Stuff broke over time, especially with the major changes we made leading
up to 2.3. We should test with older saves if/when we make large changes
in the future.

Fixes #532
2023-05-27 00:16:31 -04:00
omuretsu
ab207ce36c Fix more terminal usage error text 2023-05-26 15:45:49 -04:00
omuretsu
40babcb2ee more hotfixing
Hotfixed usage tips for alias
Hotfixed prestigeHomeComputer to avoid crashing prestige
Added checking at startWorkerScript to try and find instances where script is launched on wrong server
Fixed corp issue with multibuy not providing multibenefits
2023-05-26 14:59:42 -04:00
omuretsu
912fc98d3a Fix ls clickable links in directory 2023-05-26 12:09:59 -04:00
David Walker
4503da6226 UI: LogBox overhaul (#508) 2023-05-26 08:07:37 -04:00
G4mingJon4s
113af6e711 Add ns.getFunctionRamCost (#526) 2023-05-26 07:46:08 -04:00
bezrodnov
294603fff8 Fix getAugmentationGraftPrice bug (#530) 2023-05-26 04:14:11 -04:00
omuretsu
396e71955e Fix scp logs
Hostname was not being displayed correctly
2023-05-26 04:04:17 -04:00
Snarling
573a714fc6 Delete electronbuild.yaml 2023-05-25 19:49:58 -04:00
omuretsu
4f83d6a58a 2.3.1 dev start 2023-05-25 18:55:04 -04:00
omuretsu
7f6b96fda0 Hotfix
Prevent crash due to renamed files not being able to re-launch automatically
2023-05-25 18:16:10 -04:00
omuretsu
f75c185d39 Final 2.3.0 2023-05-25 16:45:51 -04:00
David W
97ea35bd5b Clarify exec needs script to be on remote server (#512) 2023-05-25 16:27:56 -04:00
Nikolai Korolev
b72eb125f2 DOC: Fix parameter name in documentation (#525) 2023-05-25 16:26:43 -04:00
omuretsu
f3c32d70f2 Fix order of operations for electron build script 2023-05-24 12:10:29 -04:00
Nikolai Korolev
708950350a DOC: Fix link on main page of documentation (#520) 2023-05-22 05:41:05 -04:00
Snarling
87f2ae459d UI: Better support for custom player React content (#513) 2023-05-22 05:28:24 -04:00
omuretsu
0d55b957f1 Small cat fix
cat no longer shows error message for no file found when a message or literature file was found
2023-05-22 01:52:01 -04:00
Aloït R
8dad2e746f Fix missing bracket (#519) 2023-05-21 10:07:29 -04:00
Nikolai Korolev
7cbde69da8 DOC: Fix typos (#517) 2023-05-21 10:06:29 -04:00
David Walker
9d9f6b4dcd Fix incorrect progress (#516) 2023-05-21 10:04:40 -04:00
Nikolai Korolev
2e9dc32deb DOC: Specify optional parameters in hacknet functions (#515) 2023-05-18 01:28:56 -04:00
omuretsu
75706d273a Build fix
Two files somehow missed saving their renaming.
2023-05-17 18:36:49 -04:00
omuretsu
c1f842e5c7 More corporation renaming
Just renaming files / functions. Industries are the static categories that divisions can operate within, divisions are the actual branches of the company. A lot of stuff was still written as if Industries are the actual branches of the company, which is even less accurate now that a corporation is allowed to have multiple divisions operating in the same industry.

Also removed the incorrect tooltip description of what tea does (it's now just a flat +2 increase)
2023-05-17 17:28:24 -04:00
omuretsu
27a6b619eb Lint fix
Also reduce unnecessary imports
2023-05-16 11:41:55 -04:00
omuretsu
00522fb8f3 Fix infinite loop detection
Also debounce it with the ram calc to improve performance
2023-05-16 11:27:11 -04:00
omuretsu
b44050cfec Fix oldcorp loading 2023-05-16 08:36:14 -04:00
omuretsu
f4655b8e1b Typo fix 2023-05-15 23:12:17 -04:00
omuretsu
6c730d46f4 Dev branch always show changelog regardless of location 2023-05-15 23:05:36 -04:00
omuretsu
df237b0842 Fix Stanek fix 2023-05-15 23:01:19 -04:00
omuretsu
21162c8cdd Fix stanek not recalculating stats immediately on game load 2023-05-15 22:55:57 -04:00
omuretsu
ce9ceb05a3 Revert hostname in tail titlebar 2023-05-15 20:26:18 -04:00
omuretsu
48396bf8cb Changelog update 2.3 2023-05-15 18:39:01 -04:00
Snarling
2ae3ac52f1 CORPORATION: Corp changes prior to 2.3 finalization (#503) 2023-05-15 18:06:57 -04:00
David Walker
e2e9b084bc SETTINGS: Add an autoexec setting (#505) 2023-05-09 00:13:05 -04:00
omuretsu
4e07900c5a Fix hacknet level base cost constant 2023-05-05 23:22:54 -04:00
Snarling
ebae35b1fb CODEBASE: Expand lint rules, and Aliases are stored as maps (#501) 2023-05-05 03:55:59 -04:00
Snarling
d25254caf1 BUGFIX: Prevent crash that could occur with server named runningScripts (#502) 2023-05-03 20:19:56 -04:00
omuretsu
003be33886 Lint fix 2023-05-03 07:31:29 -04:00
omuretsu
3c996a47ea Fully remove formatCode function (trim on script save) 2023-05-03 07:21:23 -04:00
David Walker
ad5a1c4bac NETSCRIPT: Revert FormattedCode type (#500) 2023-05-03 07:13:35 -04:00
Ryan McEntire
6e028a0744 DOC: Grammar and spelling fixes (#499) 2023-05-02 11:49:42 -04:00
David Walker
8b7166e4ed UI: Fix (most) perf issues in Active Scripts (#498) 2023-04-30 19:31:29 -04:00
Ryan McEntire
2f46831ad1 DOC: Grammar & language fixes for v2.0.0 migration (#495) 2023-04-30 17:37:28 -04:00
Snarling
802f2f1c66 Blacklist some more special characters
Also improved readability of the valid character section by using escapeRegExp
2023-04-28 15:33:05 -04:00
Snarling
8f684fa74c Changelog and markdown update 2023-04-28 14:45:55 -04:00
Snarling
e1aff1a315 Lint fix 2023-04-28 11:49:05 -04:00
Snarling
350679bc83 Program path bugfix + wget use contentFile 2023-04-28 11:42:35 -04:00
Snarling
8fd4eee8e9 Fix wget with text file target 2023-04-28 11:14:29 -04:00
David Walker
aa7facd4ba NETSCRIPT: Greatly speed up script launching, and remove the limitation unique args per script (#440)
* Remove the limitation unique args per script
* Internal changes to how runningScripts are stored on the server, to make common usage faster.
2023-04-27 18:21:06 -04:00
Snarling
f81297dcd6 ls display is responsive (#492) 2023-04-26 15:18:26 -04:00
Snarling
d9ef53e2e8 Fix SF12 wrong multipliers applied 2023-04-25 09:31:53 -04:00
Snarling
ae2b8cf87e Fix build test passing on failed builds 2023-04-25 09:12:17 -04:00
Snarling
6024c81113 NETSCRIPT: add ns.getResetInfo(#490)
* Move lastAugReset and lastNodeReset back to main API under getResetInfo, also included currentNode.
* The associated properties are deprecated on getPlayer()
2023-04-25 05:22:36 -04:00
Snarling
62adaf3006 Various bugfix/cleanup (#489)
* parseCommands no longer removes excess whitespace (it was unneeded and also had a bug in it relating to commands that ended in a quote mark)
* more documentation and some variable renaming
* Fix script editor focus bug on navigating to the editor from sidebar
* Fix initialization for lastNodeReset and lastAugReset
2023-04-24 15:48:49 -04:00
omuretsu
9004b12256 Actually fix quoted string args 2023-04-24 13:21:58 -04:00
omuretsu
c4776753f1 Fix quoted section detection 2023-04-24 13:05:50 -04:00
omuretsu
3106c03b5b Fix broken run command 2023-04-24 12:54:09 -04:00
David Walker
be4b0267a6 TERMINAL: Greatly improve ANSI handling (#485)
- Add support for 2;r;g;b color codes (much easier to deal with
  than 5;x256 style codes)
- Fix 40-47 (standard background colors) so that they work
- Add support for italic
- Add support for empty arguments interpreted as 0
  (0 is still not supported for "reset style", since it's not needed
  with our non-standard usage of resetting styles on every escape
  sequence, and it might cause compat issues)
- Fix ordering of 0-15 in the x256 colors to match the standard. The
  "main" colors (selected via 30-37 for FG and 40-47 for BG) are still
  artificially bright for FG, kept for compatibility, but there's no
  reason to screw up the x256 colors. (Hopefully usage of that section
  should be small anyway.)
2023-04-24 11:04:37 -04:00
David Walker
b3c0027b66 NETSCRIPT: Change error return of hackAnalyzeThreads (#482)
Fixes #102
2023-04-24 11:04:19 -04:00
Arron Chapman
e7fcda19c1 UI: Added hostname to LogBox title (#478) 2023-04-24 10:33:16 -04:00
Snarling
e0272ad4af FILES: Path rework & typesafety (#479)
* Added new types for various file paths, all in the Paths folder.
* TypeSafety and other helper functions related to these types
* Added basic globbing support with * and ?. Currently only implemented for Script/Text, on nano and download terminal commands
* Enforcing the new types throughout the codebase, plus whatever rewrites happened along the way
* Server.textFiles is now a map
* TextFile no longer uses a fn property, now it is filename
* Added a shared ContentFile interface for shared functionality between TextFile and Script.
* related to ContentFile change above, the player is now allowed to move a text file to a script file and vice versa.
* File paths no longer conditionally start with slashes, and all directory names other than root have ending slashes. The player is still able to provide paths starting with / but this now indicates that the player is specifying an absolute path instead of one relative to root.
* Singularized the MessageFilename and LiteratureName enums
* Because they now only accept correct types, server.writeToXFile functions now always succeed (the only reasons they could fail before were invalid filepath).
* Fix several issues with tab completion, which included pretty much a complete rewrite
* Changed the autocomplete display options so there's less chance it clips outside the display area.
* Turned CompletedProgramName into an enum.
* Got rid of programsMetadata, and programs and DarkWebItems are now initialized immediately instead of relying on initializers called from the engine.
* For any executable (program, cct, or script file) pathing can be used directly to execute without using the run command (previously the command had to start with ./ and it wasn't actually using pathing).
2023-04-24 10:26:57 -04:00
Snarling
6f56f35943 Add deprecation messages (#486)
Add back getPlayer().playtimeSinceLastX, but with deprecation messages applied
2023-04-24 10:21:43 -04:00
hydroflame
72037b5dab Update Constants.ts (#481) 2023-04-20 01:55:00 -04:00
Snarling
0df984eea0 CODEBASE: Add Jsonable Map and Set types, move player.sourceFiles to a map (#473) 2023-04-18 03:19:45 -04:00
Snarling
c44bdc1018 Remove unreachable code 2023-04-12 21:05:53 -04:00
G4mingJon4s
d01ba91654 SINGULARITY: Added aug and node identifiers (timestamps of last resets) (#472) 2023-04-12 13:13:42 -04:00
Snarling
f761eed377 NETSCRIPT: Type correctness for getServer (#476) 2023-04-11 15:12:55 -04:00
Steven Proctor
561b5cbf75 debugAccelerator: (#471)
- Added the F12 accelerator for Debug->Activate (DevTools) for faster access in Electron. Matches the shortcut for Chrome browsers.
2023-04-11 15:10:07 -04:00
T.J. Eckman
751fe82f92 HASHNET: Company Favor (#469) 2023-04-08 23:24:09 -04:00
David Walker
ed9e6d5ea3 NETSCRIPT: Compiled modules will be even more shared (#468) 2023-04-07 21:08:39 -04:00
omuretsu
f74002cce0 Fix and rebuild doc 2023-04-07 07:49:11 -04:00
quacksouls
4ade263ae8 DOC: typo fixes in sleeves API (#467)
A bunch of typographical fixes in the documentation of the Sleeve API.
2023-04-07 07:45:14 -04:00
omuretsu
482a04d757 Fix broken devServer config 2023-04-07 07:43:39 -04:00
Snarling
a6dfdff3ba Fix build issue 2023-04-07 02:45:19 -04:00
Snarling
04d49e3a6d SCRIPTS: Script modules are reused when they are imported (#461)
Also corrects some compile race conditions.
2023-04-07 00:33:51 -04:00
omuretsu
f5cddb6984 Fix index.html file location
Was being created at wrong location on `npm run build:dev`
2023-04-06 20:42:26 -04:00
T.J. Eckman
677686fa20 SINGULARITY: getCompanyPositionInfo (#460) 2023-04-04 12:00:54 -04:00
Eric
8d52e1b510 Small text fix (#462) 2023-04-03 00:21:37 -04:00
T.J. Eckman
df334ea6de SINGULARITY: Added getCompanyPositions (#459)
Also workForCompany will throw an error if provided a bad company name, instead of returning false
2023-04-01 21:30:46 -04:00
mjz19910
8b83791515 BUGFIX: Fix npm audit for webpack 5.75.0 (#457) 2023-04-01 07:58:18 -04:00
David Walker
8c4b992d59 TEST: Add a NS2 test (finally) (#458) 2023-04-01 07:45:23 -04:00
Tyasuh
c730d6ed82 Fix a bug introduced in #454 (#456) 2023-03-31 04:18:58 -04:00
Snarling
b9e227509e Minor gang stuff (#454)
* Fix a weird mismatch between gangFormulas and actual gang for calculating wanted penalty
* Gang respect will not fall below 1. Previously, ascension did clamp this at 1 but members dying in warfare allowed respect to reach 0.
* Gang member earned respect is now calculated correctly. Previously the actual gains were calculated, then the respect was added to the gang, and then the member earnedRespect was incorrectly being re-calculated using the increased respect. Now the respect is recorded on the member during the first/actual calculation.
2023-03-30 16:31:50 -04:00
David Walker
8445af5f2b Moved Player initialization point (#452)
Now initialized as side effect in PlayerObject, instead of in Player file that is imported everywhere.
2023-03-29 00:30:27 -04:00
omuretsu
798da75d83 renameServer changes
* Update doc error, regenerate docs
* Update a bad error message in renamePurchasedServer@serverPurchases.ts
* restore true/false return (removed in #450 due to miscommunication)
2023-03-28 16:10:24 -04:00
Zelow79
eb8bcd00e3 NETSCRIPT: reduce RAM cost for renamePurchasedServer to 0 (#450) 2023-03-28 16:01:09 -04:00
Minzenkatze
a1441b31f2 UI: Improvements to Create Program tab (#449)
* Progress indicator for programs that are in progress
* Button for a program that is currently being worked (unfocused) is just a refocus button
2023-03-28 11:23:36 -04:00
Snarling
dadf42bfe8 Fix hackAnalyzeThreads again
But actually this time
2023-03-26 02:56:01 -04:00
Minzenkatze
3c18fd7a51 fixed issue with duplicate programs (#447) 2023-03-26 02:42:15 -04:00
David Walker
9353129e84 BUGFIX: Fix the return of weaken() to account for BN mult (#448) 2023-03-26 02:16:51 -04:00
Snarling
6290ce562a Prevent errors thrown from terminal (#443)
At least from getFilepath function
2023-03-23 12:01:58 -04:00
David Walker
07b18edb5c REFACTOR: Post-PR changes to NetscriptHelpers.runOptions() (#442) 2023-03-23 12:01:20 -04:00
David Walker
2b54c6c9b9 NETSCRIPT: Add ramOverride as a RunOption (#441)
Allows overriding the static ram calculation. Dynamic ram limit still applies.
2023-03-22 10:09:12 -04:00
omuretsu
a03a441906 Merge branch 'dev' of https://github.com/bitburner-official/bitburner-src into dev 2023-03-21 21:25:33 -04:00
omuretsu
4934801073 quick docfix 2023-03-21 21:25:24 -04:00
Snarling
a774592e64 fix crash when renaming server while connected to that server (#438) 2023-03-21 21:21:15 -04:00
Eric
39d26673c4 Refactor flipForecastForecast (#437)
Algebraic reduction of Stock.flipForecastForecast() to make it more readable.
2023-03-21 20:36:54 -04:00
David Walker
98f7f473b4 NETSCRIPT: Add "temporary" as a RunOption to run/exec/spawn (#432) 2023-03-21 18:54:49 -04:00
omuretsu
042a476f78 Update electron package version info 2023-03-20 23:38:18 -04:00
hydroflame
7ee36cf22c Fix inconsistent magic number in skill/exp calculation (#434) 2023-03-20 05:16:26 -04:00
Mughur
1ef99f0c35 my bad 2023-03-18 12:15:00 +02:00
David Walker
c77b89d4d9 PERFORMANCE: Improve speed of saving when there are lots of scripts (#430) 2023-03-17 23:59:27 -04:00
Mughur
be5bba8ad6 small fixes (#429) 2023-03-18 03:34:28 +02:00
Mughur
1f98eecb57 CORP: rework (#428)
* corp overhaul: Corp production quality now depends on materials

* corp overhaul: Product price can be set separately for each city

* corp overhaul: export uses relatives

* corp overhaul: ignore energy in quality

* corp overhaul: getProduct() is city dependant

* corp overhaul: bulkbuy available from start

* corp overhaul: add multibuy for leveled upgrads

* corp overhaul: changes to UI

* corp overhaul: base quality 1, reqmat changes

* corp overhaul: puchased material quality is 1

* corp overhaul: get rid of the text box from ta2

* corp overhaul: sold shares limitations

* corp overhaul: coffee -> tea, training -> intern

* corp overhaul: smartsupply has multiple options

* corp overhaul: restart, literature, investore, ui

* corp overhaul: nerf advertising

* corp overhaul: bunch of stuff
2023-03-18 03:12:43 +02:00
Zelow79
5ffefcca80 Show on tooltip that bladeburner augs can be grafted (#427) 2023-03-17 07:57:38 -04:00
Zelow79
4723984bf8 MISC: More Bladeburner Dev menu options (#414) 2023-03-15 21:41:18 -04:00
David Walker
b92e0f1468 BUGFIX: Allow (attempting) importing the same save filename twice in a row (#424) 2023-03-15 21:10:48 -04:00
David Walker
028d9f9462 BUGFIX: Fix order-of-ops issue with SCRIPT_32GB achievement (#422) 2023-03-13 21:20:56 -04:00
David Walker
02a436dc79 ENGINE: Use setTimeout() instead of requestAnimationFrame() (#421) 2023-03-12 18:31:58 -04:00
omuretsu
f2e1a67ec1 Changelog update and steam dev updater v2
Attempting to build using ubuntu 20.04 to possibly fix Linux issue.
2023-03-11 17:07:08 -05:00
LiamGeorge1999
e84e734171 Updated "next equipment unlock" text for gang equipment (#418) 2023-03-10 23:51:33 -05:00
omuretsu
057aeaea83 Doc update
* Added notes about whether ns API layers contain spoilers.
* Add some more info to checkFactionInvitation doc
2023-03-08 01:39:05 -05:00
Zelow79
d7380a9243 Sleeve crime kills add to numPeopleKilled (#413) 2023-03-07 19:35:01 -05:00
omuretsu
b9ffb9e42e Add triggers for faction invite check
Manually check for faction invites whenever a server is backdoored, and whenever the player uses ns.singularity.checkFactionInvites
2023-03-07 19:31:54 -05:00
Snarling
401bfe9f31 Sleeve work type changes (#412) 2023-03-07 18:03:13 -05:00
Snarling
51bf0d1904 Stanek performance boost + bonus time rework (#410) 2023-03-07 14:45:22 -05:00
Zelow79
701f063642 Blade Contracts/Operations now reduce count on fails. (#411) 2023-03-07 14:45:05 -05:00
omuretsu
c2cd5845b2 Refactor ls 2023-03-07 08:04:08 -05:00
omuretsu
0442f3d5e9 Rework roughlyIs internal function
Now named missingKey, is much faster (approx 4x faster based on testing), and provides better error info when it fails (which property was missing from the provided object).
2023-03-07 06:33:24 -05:00
Snarling
e74dfe9b79 NETSCRIPTSLEEVE: Add cyclesWorked to ns.sleeve.getTask return (#409) 2023-03-07 05:30:15 -05:00
omuretsu
4ebfdcc4a8 Changelog + misc minor changes
Recovery textarea no longer spellchecks, fixed some "as" type assertions that were not necessary.
2023-03-06 11:45:36 -05:00
Snarling
759f86d6e5 NETSCRIPT: Rework script ram updates (#408) 2023-03-05 22:39:42 -05:00
zerbosh
14aafbe0a3 SLEEVES: fix typo in MoneySourceTracker call (#405) 2023-03-03 01:03:09 -05:00
Tyasuh
a01da24c10 Complete partial revert of infinite loop detection (#406) 2023-03-03 01:02:45 -05:00
Snarling
ea8ee743cc NETSCRIPT: Revert infinite loop detection (#404) 2023-03-02 17:29:18 -05:00
Snarling
59389b164a Update electronbuild.yaml 2023-03-01 01:00:35 -05:00
Snarling
89baa19bbf Update package-electron.sh 2023-03-01 00:50:53 -05:00
Snarling
26c7556091 Create test workflow for linux electron build 2023-03-01 00:45:52 -05:00
omuretsu
75481aa195 Fix growthAnalyzeSecurity doc
Also a format fix from a previous sloppy commit
2023-02-28 09:57:02 -05:00
omuretsu
f16246f939 Fix Math Expressions contract
Previously player could submit as many wrong answers in the solution as they wanted, as long as all correct answers were included. Fixed by ensuring length matches actual answer.
2023-02-28 09:14:12 -05:00
omuretsu
45ca94b1dc Fix hackAnalyzeThreads
It was previously returning infinity any time a single thread was calculated to hack less than $1, due to an improper use of Math.floor.
2023-02-28 09:02:14 -05:00
Aditya Hegde
2f4c29fdf0 Clarifying that netscript ports are across servers (#268) 2023-02-28 06:59:37 -05:00
Snarling
ee3c412933 SETTINGS: Add infinite loop detection setting (#402) 2023-02-28 06:54:01 -05:00
lucebac
ae92ea0f94 ns.scp: strip leading slashes from filenames if file is in root (#263) 2023-02-28 06:53:42 -05:00
David Walker
f1793b187b SOURCEFILE: Fix calculation of decMult (#385)
Changed SF1 to apply a 1/incMult multiplier to hacknet costs to match how NFG, SF12, etc. handle it. Previously was calculated as a %reduction.
Changed wording on SF9 to include a %reduction in hacknet costs.
Buffed SF9 effect to 12% base from 8%, to make up for weaker hacknet cost mults from SF1.
2023-02-27 20:41:42 -05:00
T.J. Eckman
33f0150d25 BUGFIX: Memory Leak in NetscriptPorts (#399)
Co-authored-by: Snarling <84951833+Snarling@users.noreply.github.com>
2023-02-27 19:54:04 -05:00
Mughur
9d504b0dfb updated node starting messages actually show up (#397) 2023-02-27 21:46:01 +02:00
CJ Bok
5cef60cd21 Fixed the year for v2.2.2 (#398) 2023-02-26 19:20:04 -05:00
omuretsu
93939431e9 Remove some unused electron code
Verified that steam exits the game even when a link has been opened, no need for utils.openExternal or tracking app_playerOpenedExternalLink.
Also removed some unneeded eslint override comments
2023-02-26 19:18:54 -05:00
Snarling
b9b5a62105 Fix electron link handling (#396) 2023-02-25 17:42:26 -05:00
LiamGeorge1999
3d9993215c Fix double percentage sign in product creation (#395) 2023-02-25 08:20:59 -05:00
LiamGeorge1999
b1af58d6a6 Fixed speechmarks not making numeric terminal arguments into strings (#391) 2023-02-25 08:17:01 -05:00
quacksouls
f50b731846 Fix doc typo for "Sanitize Parentheses in Expression" contract (#389) 2023-02-24 22:31:10 -05:00
quacksouls
18eeb7c4e1 Fix doc typo for ns.stock.getPosition (#390) 2023-02-24 22:27:55 -05:00
Snarling
4166c09bd4 More script editor options (#386)
* Options are responsive again (fix from previous changes)
* Better height control on the monaco container using flexbox.
* Added options for tab size, auto-detect indentation per-file, font family, and font ligatures.
2023-02-24 07:37:29 -05:00
Mughur
ee3b220858 fix typo (#388) 2023-02-24 14:10:57 +02:00
Mughur
6839a456ac doc function updates and additions (#387) 2023-02-24 13:57:17 +02:00
Snarling
71051cde9c Upgrade monaco and bump game version to 2.3.0dev (#369) 2023-02-23 21:43:29 -05:00
omuretsu
211e2bcb95 Fix Electron API server
VSCode integration fix for Electron version
2023-02-23 21:18:29 -05:00
Mughur
57302c953f Merge pull request #376 from Zelow79/BN9-buff
BN9: QoL improvements.
2023-02-23 17:29:52 +02:00
omuretsu
37d2f57e53 Fix atExit loop
atExit clears itself from the WorkerScript before being executed.
2023-02-23 08:39:47 -05:00
Zelow79
eb7b00a688 Update BitNode.tsx 2023-02-22 15:50:29 -05:00
Zelow79
3fde3a1a22 Update BitNode.tsx
Removed PI from BN modifiers and set them back to base/original values as per Mughur request.
2023-02-22 15:47:32 -05:00
Mughur
3c7b0622a5 Merge pull request #375 from Tyasuh/Int-Shock-Recovery-Buff
MISC: Sleeve Int applies to active/passive shock recovery
2023-02-22 14:40:51 +02:00
tyasuh.taeragan@gmail.com
7963158470 Requested Correction 2023-02-20 21:40:47 -05:00
Zelow79
f573092090 Update Prestige.ts
updated comment to be a little more clear
2023-02-19 21:51:06 -05:00
Zelow79
b950c6540f bn9 QoL improvements
Increased BN multipliers for HacknetNodeMoney and WorldDaemonDifficulty to PI (3.14159...). This brings WD required hack to 9424.77796076938 (now the 2nd highest ^-^).
Bn9 now starts with the same node bn9.3 rewards (the idea here is it helps showcase the BNs new feature and just speeds up a lot of what made it so slow early on)
2023-02-19 21:14:22 -05:00
tyasuh.taeragan@gmail.com
b6433786e3 formatter 2023-02-19 05:27:09 -05:00
tyasuh.taeragan@gmail.com
012c5d4f86 Int Buff to shock recovery speed 2023-02-19 01:43:38 -05:00
719 changed files with 16115 additions and 330698 deletions

View File

@@ -7,8 +7,8 @@ module.exports = {
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"plugin:@typescript-eslint/strict",
//"plugin:@typescript-eslint/recommended-requiring-type-checking",
//"plugin:@typescript-eslint/strict",
],
parser: "@typescript-eslint/parser",
parserOptions: {
@@ -20,7 +20,6 @@ module.exports = {
project: ["./tsconfig.json", "./test/tsconfig.json", "./tools/tsconfig.json"],
},
plugins: ["@typescript-eslint"],
extends: ["plugin:@typescript-eslint/recommended"],
rules: {
"@typescript-eslint/no-unused-vars": [
"error",

29
.github/workflows/steamDev.yml vendored Normal file
View File

@@ -0,0 +1,29 @@
# update the steam development version
name: "Steam dev update"
on:
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-20.04
steps:
- name: Setup steamcmd
uses: CyberAndrii/setup-steamcmd@v1
- name: Checkout dev branch
uses: actions/checkout@v3
with:
ref: dev
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 16
- name: Build and deploy
run: |
npm ci
npm run build
npm run electron
steamcmd +login ${{ secrets.STEAM_BUILD_USERNAME }} ${{ secrets.STEAM_BUILD_PASSWORD }} +run_app_build ../tools/steamdev.vdf +quit

7
.gitignore vendored
View File

@@ -11,9 +11,14 @@ Netburner.txt
/test/*.css
/input/bitburner.api.json
dist/bitburner.d.ts
dist/images
.cypress
# folder for bundles images / fonts that are generated by webpack
dist/assets
# Monaco bundle files
dist/*.worker.*
# tmp folder for build and electron
.app
.package

15
FixJSDOMEnvironment.ts Normal file
View File

@@ -0,0 +1,15 @@
import JSDOMEnvironment from "jest-environment-jsdom";
// 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 {
constructor(...args: ConstructorParameters<typeof JSDOMEnvironment>) {
super(...args);
// FIXME https://github.com/nodejs/node/issues/35889
// Add missing importActual() function to mirror requireActual(),
// which lets us work around the ESM bug.
// Wrap the construction of the function in eval, so that transpilers
// don't touch the import() call.
this.global.importActual = eval("url => import(url)");
}
}

File diff suppressed because one or more lines are too long

View File

@@ -1,415 +0,0 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
define('vs/basic-languages/typescript/typescript',["require", "exports", "../fillers/monaco-editor-core"], function (require, exports, monaco_editor_core_1) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.language = exports.conf = void 0;
exports.conf = {
wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\@\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,
comments: {
lineComment: '//',
blockComment: ['/*', '*/']
},
brackets: [
['{', '}'],
['[', ']'],
['(', ')']
],
onEnterRules: [
{
// e.g. /** | */
beforeText: /^\s*\/\*\*(?!\/)([^\*]|\*(?!\/))*$/,
afterText: /^\s*\*\/$/,
action: {
indentAction: monaco_editor_core_1.languages.IndentAction.IndentOutdent,
appendText: ' * '
}
},
{
// e.g. /** ...|
beforeText: /^\s*\/\*\*(?!\/)([^\*]|\*(?!\/))*$/,
action: {
indentAction: monaco_editor_core_1.languages.IndentAction.None,
appendText: ' * '
}
},
{
// e.g. * ...|
beforeText: /^(\t|(\ \ ))*\ \*(\ ([^\*]|\*(?!\/))*)?$/,
action: {
indentAction: monaco_editor_core_1.languages.IndentAction.None,
appendText: '* '
}
},
{
// e.g. */|
beforeText: /^(\t|(\ \ ))*\ \*\/\s*$/,
action: {
indentAction: monaco_editor_core_1.languages.IndentAction.None,
removeText: 1
}
}
],
autoClosingPairs: [
{ open: '{', close: '}' },
{ open: '[', close: ']' },
{ open: '(', close: ')' },
{ open: '"', close: '"', notIn: ['string'] },
{ open: "'", close: "'", notIn: ['string', 'comment'] },
{ open: '`', close: '`', notIn: ['string', 'comment'] },
{ open: '/**', close: ' */', notIn: ['string'] }
],
folding: {
markers: {
start: new RegExp('^\\s*//\\s*#?region\\b'),
end: new RegExp('^\\s*//\\s*#?endregion\\b')
}
}
};
exports.language = {
// Set defaultToken to invalid to see what you do not tokenize yet
defaultToken: 'invalid',
tokenPostfix: '.ts',
keywords: [
// Should match the keys of textToKeywordObj in
// https://github.com/microsoft/TypeScript/blob/master/src/compiler/scanner.ts
'abstract',
'any',
'as',
'asserts',
'bigint',
'boolean',
'break',
'case',
'catch',
'class',
'continue',
'const',
'constructor',
'debugger',
'declare',
'default',
'delete',
'do',
'else',
'enum',
'export',
'extends',
'false',
'finally',
'for',
'from',
'function',
'get',
'if',
'implements',
'import',
'in',
'infer',
'instanceof',
'interface',
'is',
'keyof',
'let',
'module',
'namespace',
'never',
'new',
'null',
'number',
'object',
'package',
'private',
'protected',
'public',
'override',
'readonly',
'require',
'global',
'return',
'set',
'static',
'string',
'super',
'switch',
'symbol',
'this',
'throw',
'true',
'try',
'type',
'typeof',
'undefined',
'unique',
'unknown',
'var',
'void',
'while',
'with',
'yield',
'async',
'await',
'of'
],
operators: [
'<=',
'>=',
'==',
'!=',
'===',
'!==',
'=>',
'+',
'-',
'**',
'*',
'/',
'%',
'++',
'--',
'<<',
'</',
'>>',
'>>>',
'&',
'|',
'^',
'!',
'~',
'&&',
'||',
'??',
'?',
':',
'=',
'+=',
'-=',
'*=',
'**=',
'/=',
'%=',
'<<=',
'>>=',
'>>>=',
'&=',
'|=',
'^=',
'@'
],
// we include these common regular expressions
symbols: /[=><!~?:&|+\-*\/\^%]+/,
escapes: /\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,
digits: /\d+(_+\d+)*/,
octaldigits: /[0-7]+(_+[0-7]+)*/,
binarydigits: /[0-1]+(_+[0-1]+)*/,
hexdigits: /[[0-9a-fA-F]+(_+[0-9a-fA-F]+)*/,
regexpctl: /[(){}\[\]\$\^|\-*+?\.]/,
regexpesc: /\\(?:[bBdDfnrstvwWn0\\\/]|@regexpctl|c[A-Z]|x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4})/,
// The main tokenizer for our languages
tokenizer: {
root: [[/[{}]/, 'delimiter.bracket'], { include: 'common' }],
common: [
// identifiers and keywords
[
/[a-z_$][\w$]*/,
{
cases: {
'@keywords': 'keyword',
'@default': 'identifier'
}
}
],
[/[A-Z][\w\$]*/, 'type.identifier'],
// [/[A-Z][\w\$]*/, 'identifier'],
// whitespace
{ include: '@whitespace' },
// regular expression: ensure it is terminated before beginning (otherwise it is an opeator)
[
/\/(?=([^\\\/]|\\.)+\/([dgimsuy]*)(\s*)(\.|;|,|\)|\]|\}|$))/,
{ token: 'regexp', bracket: '@open', next: '@regexp' }
],
// delimiters and operators
[/[()\[\]]/, '@brackets'],
[/[<>](?!@symbols)/, '@brackets'],
[/!(?=([^=]|$))/, 'delimiter'],
[
/@symbols/,
{
cases: {
'@operators': 'delimiter',
'@default': ''
}
}
],
// numbers
[/(@digits)[eE]([\-+]?(@digits))?/, 'number.float'],
[/(@digits)\.(@digits)([eE][\-+]?(@digits))?/, 'number.float'],
[/0[xX](@hexdigits)n?/, 'number.hex'],
[/0[oO]?(@octaldigits)n?/, 'number.octal'],
[/0[bB](@binarydigits)n?/, 'number.binary'],
[/(@digits)n?/, 'number'],
// delimiter: after number because of .\d floats
[/[;,.]/, 'delimiter'],
// strings
[/"([^"\\]|\\.)*$/, 'string.invalid'],
[/'([^'\\]|\\.)*$/, 'string.invalid'],
[/"/, 'string', '@string_double'],
[/'/, 'string', '@string_single'],
[/`/, 'string', '@string_backtick']
],
whitespace: [
[/[ \t\r\n]+/, ''],
[/\/\*\*(?!\/)/, 'comment.doc', '@jsdoc'],
[/\/\*/, 'comment', '@comment'],
[/\/\/.*$/, 'comment']
],
comment: [
[/[^\/*]+/, 'comment'],
[/\*\//, 'comment', '@pop'],
[/[\/*]/, 'comment']
],
jsdoc: [
[/[^\/*]+/, 'comment.doc'],
[/\*\//, 'comment.doc', '@pop'],
[/[\/*]/, 'comment.doc']
],
// We match regular expression quite precisely
regexp: [
[
/(\{)(\d+(?:,\d*)?)(\})/,
['regexp.escape.control', 'regexp.escape.control', 'regexp.escape.control']
],
[
/(\[)(\^?)(?=(?:[^\]\\\/]|\\.)+)/,
['regexp.escape.control', { token: 'regexp.escape.control', next: '@regexrange' }]
],
[/(\()(\?:|\?=|\?!)/, ['regexp.escape.control', 'regexp.escape.control']],
[/[()]/, 'regexp.escape.control'],
[/@regexpctl/, 'regexp.escape.control'],
[/[^\\\/]/, 'regexp'],
[/@regexpesc/, 'regexp.escape'],
[/\\\./, 'regexp.invalid'],
[
/(\/)([dgimsuy]*)/,
[{ token: 'regexp', bracket: '@close', next: '@pop' }, 'keyword.other']
]
],
regexrange: [
[/-/, 'regexp.escape.control'],
[/\^/, 'regexp.invalid'],
[/@regexpesc/, 'regexp.escape'],
[/[^\]]/, 'regexp'],
[
/\]/,
{
token: 'regexp.escape.control',
next: '@pop',
bracket: '@close'
}
]
],
string_double: [
[/[^\\"]+/, 'string'],
[/@escapes/, 'string.escape'],
[/\\./, 'string.escape.invalid'],
[/"/, 'string', '@pop']
],
string_single: [
[/[^\\']+/, 'string'],
[/@escapes/, 'string.escape'],
[/\\./, 'string.escape.invalid'],
[/'/, 'string', '@pop']
],
string_backtick: [
[/\$\{/, { token: 'delimiter.bracket', next: '@bracketCounting' }],
[/[^\\`$]+/, 'string'],
[/@escapes/, 'string.escape'],
[/\\./, 'string.escape.invalid'],
[/`/, 'string', '@pop']
],
bracketCounting: [
[/\{/, 'delimiter.bracket', '@bracketCounting'],
[/\}/, 'delimiter.bracket', '@pop'],
{ include: 'common' }
]
}
};
});
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
define('vs/basic-languages/javascript/javascript',["require", "exports", "../typescript/typescript"], function (require, exports, typescript_1) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.language = exports.conf = void 0;
exports.conf = typescript_1.conf;
exports.language = {
// Set defaultToken to invalid to see what you do not tokenize yet
defaultToken: 'invalid',
tokenPostfix: '.js',
keywords: [
'break',
'case',
'catch',
'class',
'continue',
'const',
'constructor',
'debugger',
'default',
'delete',
'do',
'else',
'export',
'extends',
'false',
'finally',
'for',
'from',
'function',
'get',
'if',
'import',
'in',
'instanceof',
'let',
'new',
'null',
'return',
'set',
'super',
'switch',
'symbol',
'this',
'throw',
'true',
'try',
'typeof',
'undefined',
'var',
'void',
'while',
'with',
'yield',
'async',
'await',
'of'
],
typeKeywords: [],
operators: typescript_1.language.operators,
symbols: typescript_1.language.symbols,
escapes: typescript_1.language.escapes,
digits: typescript_1.language.digits,
octaldigits: typescript_1.language.octaldigits,
binarydigits: typescript_1.language.binarydigits,
hexdigits: typescript_1.language.hexdigits,
regexpctl: typescript_1.language.regexpctl,
regexpesc: typescript_1.language.regexpesc,
tokenizer: typescript_1.language.tokenizer
};
});

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@@ -2,7 +2,7 @@
## Can I donate to the project?
No, the project does not take donation.
No, the project does not take donations.
If you still want to donate, go donate blood to your local blood bank or donate to the [Electronic Frontier Foundation](https://www.eff.org/) or [Médecins Sans Frontières](https://www.msf.org/)
@@ -27,25 +27,25 @@ You may have created an infinite loop with no sleep. You'll have to restart the
- On Browser: Stick `?noScript` at the end of the URL
- On Steam:
- In the menu, "Reloads" -> "Reload & Kill All Scripts".
- If this does not work, when launching the game, use the kill all script options.
- If this does not work, when launching the game, use the kill all scripts option.
---
## Steam: Where is the save game located?
To maintain compatibility with the web browser version, the save game is not stored as a file on your filesystem. It lives inside the localStorage of the WebKit instance. You may export the save (and should backup it!) in the option menu.
To maintain compatibility with the web browser version, the save game is not stored as a file on your filesystem. It lives inside the localStorage of the WebKit instance. Export the save (and back it up!) in the option menu.
---
## Steam: Game won't stop / Game is shown as "Running"
Due to a limitation with the way Steam tracks the game, if you launch an external link (such as documentation), Steam may keep tracking the game as "Running" even after it is closed. You should simply have to close your web browser to fix this.
Due to a limitation with the way Steam tracks the game, if you launch an external link (such as documentation), Steam may keep tracking the game as "Running" even after it is closed. Simply close the web browser to fix this.
---
## Steam: How do I get to the game files? <a name="game-files"></a>
You can navigate to the game files by right-clicking the game in your library and then go into "Manage" -> "Browse Local Files". The game can be launched directly from that location, if you're having issues with Steam.
Right-click the game in your Steam library, then go into "Manage" -> "Browse Local Files". The game can be launched directly from that location if you're having issues with Steam.
---
@@ -55,13 +55,13 @@ You can navigate to the game files by right-clicking the game in your library an
If the game is installed on a network drive, it will fail to start due to a [limitation in Chromium](https://github.com/electron/electron/issues/27356).
If you cannot move the game to another drive, you'll have to add the `--no-sandbox` launch option. In your Steam Library, Right click the game and hit "Properties". You'll see the launch option section in the "General" window.
If you cannot move the game to another drive, you'll have to add `--no-sandbox` to the launch options. In your Steam Library, right click the game and hit "Properties". You'll see the "launch options" section in the "General" window.
### **On Linux**
The game is built natively, do not use Proton unless native does not work.
The game is built natively. Do not use Proton unless native does not work.
When launching the game, you will be prompted with three options. If the standard launch does not work, you may attempt the `--disable-seccomp-filter-sandbox` or `--no-sandbox` launch option. If this still does not work, the game should be able to start by launching it directly or through the terminal. See [How do I get to the game files?](#game-files).
When launching the game, you will be prompted with three options. If the standard launch does not work, you may attempt the `--disable-seccomp-filter-sandbox` or `--no-sandbox` launch options. If this still does not work, the game should be able to start by launching it directly or through the terminal. See [How do I get to the game files?](#game-files).
---
@@ -69,7 +69,7 @@ When launching the game, you will be prompted with three options. If the standar
### Logs (using [electron-log](https://github.com/megahertz/electron-log#readme))
You may want access the logs to get information about crashes or such.
You may want to access the logs to get information about crashes and such.
- on Linux: `~/.config/bitburner/logs/main.log`
- on macOS: `~/Library/Logs/bitburner/main.log`
@@ -77,7 +77,7 @@ You may want access the logs to get information about crashes or such.
### Config (using [electron-store](https://github.com/sindresorhus/electron-store#readme))
Configuration file will be written to disk in the application data directory.
Configuration files can be found in the application's data directory.
- on Linux: `~/.config/bitburner/config.json`
- on macOS: `~/Library/Application\ Support/bitburner/config.json`
@@ -87,4 +87,4 @@ Configuration file will be written to disk in the application data directory.
## Steam: What is the API Server?
The API Server allows the official [Visual Studio Code Extension](https://github.com/bitburner-official/bitburner-vscode) to push script file from VSCode to your in-game home.
The API Server allows the official [Visual Studio Code Extension](https://github.com/bitburner-official/bitburner-vscode) to push script files from VSCode to your in-game home.

View File

@@ -3,6 +3,4 @@ Hi there, hello
It looks like you found a page that doesn't exist!
If you're looking for documentation of the netscript API. It moved `here <https://github.com/bitburner-official/bitburner-src/blob/dev/markdown/bitburner.ns.md>`_.
That documentation is autogenerated and therefore is much easier to maintain.
If you're looking for documentation of the Netscript API, it moved `here <https://github.com/bitburner-official/bitburner-src/blob/dev/markdown/bitburner.ns.md>`_.

View File

@@ -11,7 +11,7 @@ user's physical and mental faculties.
Augmentations provide persistent upgrades in the form of multipliers.
These multipliers apply to a wide variety of things such as stats,
experience gain, and hacking, just to name a few. The effects of
Autmentations stack multiplicatively. Your multiplierscan be viewed in
Augmentations stack multiplicatively. Your multipliers can be viewed in
the 'Character' page (:ref:`keyboard shortcut <shortcuts>` Alt + c).
How to acquire Augmentations

View File

@@ -249,9 +249,9 @@ The list contains the name of (i.e. the value returned by
| | | the string, the result should be an array with only an empty string. |
| | | |
| | | Examples: |
| | | ()())() -> [()()(), (())()] |
| | | (a)())() -> [(a)()(), (a())()] |
| | | )( -> [""] |
| | | "()())()" -> ["()()()", "(())()"] |
| | | "(a)())()" -> ["(a)()()", "(a())()"] |
| | | ")(" -> [""] |
+-----------------------------------------+------------------------------------------------------------------------------------------+
| Find All Valid Math Expressions | | You are given a string which contains only digits between 0 and 9 as well as a target |
| | | number. Return all possible ways you can add the +, -, and * operators to the string |
@@ -293,7 +293,7 @@ The list contains the name of (i.e. the value returned by
| | | 3Blue1Brown for more information\n", |
| | | Note 3: There's a ~55% chance for an altered Bit. So... MAYBE |
| | | there is an altered Bit 😉\n", |
| | | Extranote for automation: return the decimal value as a string", |
| | | Extra note for automation: return the decimal value as a string", |
+-----------------------------------------+------------------------------------------------------------------------------------------+
| Proper 2-Coloring of a Graph | | You are given data, representing a graph. Note that "graph", as used here, refers to |
| | | the field of graph theory, and has no relation to statistics or plotting. |

View File

@@ -2,7 +2,7 @@
Crimes
======
Commiting crimes is an active gameplay mechanic that allows the player to train
Committing crimes is an active gameplay mechanic that allows the player to train
their stats and potentially earn money. The player can attempt to commit crimes
by visiting 'The Slums' through the 'City' tab (:ref:`Keyboard shortcut <shortcuts>` Alt + w).
'The Slums' is available in every city.
@@ -15,7 +15,7 @@ available crimes. Simply select one of the options to begin attempting that
crime. Attempting to commit a crime takes a certain amount of time. This time
varies between crimes.
While doing criemes, you can click “Do something else simultaneously”
While doing crimes, you can click “Do something else simultaneously”
to be able to do things while you continue to do crimes in the background. There is a
20% penalty to the related gains. Clicking the “Focus” button under the overview
will return you to the current task.

View File

@@ -31,8 +31,16 @@ Many commands and functions act on an executing script
be a way to specify which script you want those commands & functions
to act on.
**A script that is being executed is uniquely identified by both its
name and the arguments that it was run with.**
The best way to identify a script is by its PID (Process IDentifier). This
unique number is returned from :js:func:`run`, :js:func:`exec`, etc., and also
shows in the output of "ps".
A secondary way to identify scripts is by name **and** arguments. However (by
default) you can run a multiple copies of a script with the same arguments, so
this does not necessarily **uniquely** identify a script. In case of multiple
matches, most functions will return an arbitrary one (typically the first one
to be started). An exception is :js:func:`kill`, which will kill all the
matching scripts.
The arguments must be an **exact** match. This means that both
the order and type of the arguments matter.
@@ -78,7 +86,7 @@ with scripts:
Prints the logs of the script specified by the name and arguments to
Terminal. Arguments should be separated by a space. Remember that scripts
are uniquely identified by their arguments as well as their name. For
example, if you ran a script `foo.hs` with the argument `foodnstuff`
example, if you ran a script `foo.js` with the argument `foodnstuff`
then in order to 'check' it you must also add the `foodnstuff` argument
to the check command::
@@ -88,12 +96,12 @@ to the check command::
Shows the current server's RAM usage and availability
**kill [script] [args...]**
**kill [pid]** or **kill [script] [args...]**
Stops a script that is running with the specified script name and
Stops a script that is running with the specified PID, or script name and
arguments. Arguments should be separated by a space. Remember that
scripts are uniquely identified by their arguments as well as
their name. For example, if you ran a script `foo.js` with
scripts are identified by their arguments as well as their name.
For example, if you ran a script `foo.js` with
the argument 1 and 2, then just typing "`kill foo.js`" will
not work. You have to use::
@@ -142,13 +150,13 @@ Run 'foo.js' with 50 threads and a single argument: [foodnstuff]::
$ run foo.js -t 50 foodnstuff
**tail [script] [args...]**
**tail [pid]** or **tail [script] [args...]**
Displays the logs of the script specified by the name and arguments. Note that scripts
are uniquely identified by their arguments as well as their name. For example, if you
ran a script 'foo.js' with the argument 'foodnstuff' then in order to 'tail' it you
must also add the 'foodnstuff' argument to the tail command as so: tail foo.js
foodnstuff
Displays the logs of the script specified by the PID or name and arguments. Note that
scripts are identified by their arguments as well as their name. For example,
if you ran a script 'foo.js' with the argument 'foodnstuff' then in order to
'tail' it you must also add the 'foodnstuff' argument to the tail command as
so: tail foo.js foodnstuff
**top**

View File

@@ -23,7 +23,7 @@ The `free`, `scan-analyze`, and `analyze` Terminal commands
can be used to check how much RAM a server has.
Some servers have some randomized statistics, such as RAM, max Money or
required hacking level. These statistics are randomly genererated from a range of values.
required hacking level. These statistics are randomly generated from a range of values.
Identifying Servers
^^^^^^^^^^^^^^^^^^^

View File

@@ -145,7 +145,7 @@ backdoor
Installs a backdoor on the current server. Root access is required to do this.
Servers will give different bonuses when you install a backdoor.
This can pass faction tests or give bonsues such as discounts from companies.
This can pass faction tests or give bonuses such as discounts from companies.
buy
^^^
@@ -318,7 +318,7 @@ to home and want to kill a script running on n00dles, you have to either use it'
or :code:`connect` to n00dles first and then use the the kill command.
If you are killing the script using its filename and arguments, then each argument
must be separated by a space. Remember that a running script is uniquely identified
must be separated by a space. Remember that a running script is identified
by both its name and the arguments that are used to start it. So, if a script
was ran with the following arguments::
@@ -328,6 +328,9 @@ Then to kill this script the same arguments would have to be used::
$ kill foo.js 50e3 sigma-cosmetics
If there are multiple copies of a script running with the same arguments, all
of them will be killed.
If you are killing the script using its PID, then the PID argument must be numeric.
killall
@@ -543,11 +546,13 @@ Prints whether or not you have root access to the current server.
tail
^^^^
$ tail [pid]
or
$ tail [script name] [args...]
Displays dynamic logs for the script specified by the script name and arguments.
Displays dynamic logs for the script specified by PID or the script name and arguments.
Each argument must be separated by a space. Remember that a running script is
uniquely identified by both its name and the arguments that were used to run
identified by both its name and the arguments that were used to run
it. So, if a script was ran with the following arguments::
$ run foo.js 10 50000
@@ -614,7 +619,7 @@ There are two main points:
Here's an example to show how these rules work. Consider the following script `argType.js`::
export async function main(ns) {
ns.tprint("Number of args: " + args.length);
ns.tprint("Number of args: " + ns.args.length);
for (var i = 0; i < ns.args.length; ++i) {
ns.tprint(typeof ns.args[i]);
}
@@ -642,3 +647,6 @@ with a semicolon (;).
Example::
$ run foo.js; tail foo.js
This does *not* wait for commands with a delay to finish executing, so it
generally doesn't work with things like :code:`hack`, :code:`wget`, etc.

View File

@@ -3,8 +3,183 @@
Changelog
=========
v2.3.1 - Bugfixes 7 June 2023
-----------------------------
v2.2.2 - 21 Feb 2022
NETSCRIPT:
* Added ns.setTitle, which sets the titlebar of a script's tail window (@d0sboots)
* Added ns.getFunctionRamCost, which gets the ramcost of a netscript function (@G4mingJon4s)
* ns.ls results will filter as if the filenames have a leading slash (@Snarling)
GENERAL / MISC:
* Changed tail window buttons into icon buttons, allow setting custom title, and tail window bugfixes. (@d0sboots)
* Terminal no longer scrolls to the bottom constantly while an action is being performed (@bezrodnov)
* Added a close button to modals (@bezrodnov)
* Fixed several issues with script editor tabs (@bezrodnov)
* scp terminal command can copy multiple files at once, like help text indicates (@Snarling)
* Root directory is no longer displayed as ~ in the terminal prompt, it is displayed as / (@Snarling)
* cd with no arguments will change to the root directory (@Snarling)
* Documentation updates (various)
* Nerf noodle bar
HOTFIXES (these were already backported to 2.3.0 before 2.3.1 release):
* Several important fixes for savegame migration issues from older version (@d0sboots)
* Prevent scripts from loading during intial migration to 2.3.0 save format, to prevent a crash that could occur. (@Snarling)
* Fix scp logging (hostname was being logged incorrectly in multiple places and showing as [Object object]) (@Snarling)
* Update terminal parsing logic so that the old syntax for alias works again. (@Snarling)
* Fix clickable script links from ls command not working outside root directory (@Snarling)
* Fix an issue with Find All Valid Math Expressions not accepting empty array when that was the solution. (@Snarling)
* Fix an issue with scan-analyze display when the player had AutoLink.exe (@Snarling)
* Reverted undocumented change that program filenames were case sensitive for ns.fileExists. They are case insensitive again. (@Snarling)
* An issue from pre-2.3 could cause scripts to have the wrong "server" property. This caused issues in 2.3, and a fix now repairs any scripts with a mismatched server property. (@Snarling)
* More fixes to help old savegames load correctly (@Snarling)
* Servers can no longer have infinite time-to-hack. (@Snarling)
SPOILER SECTIONS:
SF2:
* Overall gang respect gain rate now reads accurately, instead of showing ~10x. (@Snarling)
SF3:
* Added "maxProducts" property to ns.corporation.getDivision return value (@kateract)
* Fixed an issue with sell price parsing for materials (@zerbosh)
* Fixed display of market price for materials and products (@zerbosh)
* Fixes for Corp import/export issues, such as -IPROD and Smart Supply not working right (@d0sboots)
* Improvements to the max-affordable-upgrades calculation (@bezrodnov)
* Perform additional validation when setting up an export. Exports are now unique per targeted division+city. (@Snarling)
* ns.corporation.cancelExport no longer requires the exported amount (@Snarling)
* Fix NaN bug that could impact Robot material in Robotics division (@Snarling, @kateract)
* Can no longer commence product development in a city with no office (which would immediately error out the game loop) (@Snarling)
* (Hotfix) Fix issue that could lead to SF3 research desync. (@Snarling)
* (Hotfix) Fix SF3 "Spring Water" industry (@Snarling)
SF4:
* Fixed an issue that could cause singularity run-after-reset callback scripts to not launch correctly (@Snarling)
v2.3.0 - SF3 rework and performance improvements (25 May 2023)
--------------------------------------------------------------
BREAKING CHANGES: These changes may require changes to your scripts.
* Major changes to the SF3 mechanic. See the related section below for more detailed info on the changes.
* The same script filename can now be ran multiple times with the same args. If running a script from another script (ns.run/ns.exec/etc), this limitation can be re-imposed with the preventDuplicates RunOption (see general section for info on RunOptions).
* The same .js script will now be the same js module whether the script was ran directly or used as an import. This means top-level variables (variables defined outside of any function) are shared across all instances of the script.
* The js module for a script will also be reused by any script that has the exact same compiled text, even if that script is on another server or has a different filename. This can lead to unexpected results when using top-level variables.
* Some properties removed from ns.getPlayer and added to a separate function ns.getResetInfo. These are still accessible from getPlayer but will produce a warning message the first time they are accessed per game session.
* hackAnalyzeThreads now returns -1, instead of 0, when no money can be hacked from the targeted server.
* ns.iKnowWhatImDoing has been removed, replaced by ns.tprintRaw for printing custom react content to the terminal (limited support).
PERFORMANCE:
* Minimize impact of unavoidable memory leak when modules are created, by reusing modules as much as possible (@d0sboots)
* Internal data structure changes (@d0sboots, @Snarling)
* Fix memory leak when initializing large number of netscript ports (@Snarling)
* Improve performance while on the Active Scripts page if many scripts are starting/ending. (@d0sboots)
NETSCRIPT GENERAL:
* Remove requirement for script args to be unique. This was also related to performance improvements. (@d0sboots)
* ns.hackAnalyzeThreads no longer indicates infinity any time a single thread would hack less than $1 (@Snarling)
* ns.renamePurchasedServer no longer crashes if player is connected to the server being renamed (@Snarling)
* ns.hackAnalyzeThreads now return -1 (instead of 0) if no money can be hacked from the targeted server. (@d0sboots)
* Fix a possible infinite atExit loop if a script killed itself. (@Snarling)
* Static timestamps of last resets can be obtained via ns.getResetInfo, replacing playtimeSinceLastX from ns.getPlayer (@G4mingJon4s)
* Improved support for printing react content directly to the terminal (ns.tprintRaw) or to a script log (ns.printRaw).
* Added RunOptions, which can optionally replace the "threads" argument for ns.run/ns.exec/ns.spawn. (@d0sboots)
* RunOptions.threads: Provide a thread count (since RunOptions can replace the threads argument)
* RunOptions.temporary: Prevents the script execution from being included in the save file.
* RunOptions.ramOverride: Provide a static ram cost for the script to override what is calculated by the game. Dynamic ram checking is still enforced.
* RunOptions.preventDuplicates: Fail to launch the script if the args are identical to a script already running.
GENERAL / MISC:
* Fixed a bug that could cause the overview skill bars to become desynced (@d0sboots)
* There is now an autoexec setting to specify a script on home to automatically run when loading the game. (@d0sboots)
* Monaco script editor updated to a newer version and has more config options available now. (@Snarling)
* Improve Electron's handling of external links (@Snarling)
* Improved support for ANSI color codes (@d0sboots)
* Improved consistency of file paths. Correct names for files no longer start with a / even if they are in a directory. (@Snarling)
* All Math Expressions contract no longer accepts wrong answers (@Snarling)
* Faction invites now trigger immediately when backdooring a server. (@Snarling)
* Fixed issue where duplicate programs could be created. (@Minzenkatze)
* UI improvements to create program page (@Minzenkatze)
* Fix inconsistency in skill xp to skill level conversion (@hydroflame)
* Updated blood donation counter to reflect number of confirmed blood donations. (@hydroflame)
* Minor improvements to ram calculation process (@Snarling)
* Improved terminal arguments detection (@Snarling)
* Improved display for ls terminal command. (@Snarling)
* Added more internal tests and improved test quality (@d0sboots)
* Various codebase improvements (@Snarling, @d0sboots)
* Documentation improvements (Many contributors)
* Nerf noodle bar
SPOILER SECTIONS:
SF2:
* Corrected the "Next equipment unlock" text for member upgrades. (@LiamGeorge1999)
SF3:
* Many Corporation API changes, due to functionality changes and due to property name changes. See documentation for correct usage.
* Can now have multiple divisions within the same industry. (@Mughur)
* Can now sell a division or sell the entire corporation. (@Mughur)
* Product quality now depends on material quality (@Mughur)
* Product price can be set separately per-city (@Mughur)
* Exports can be set relative to inventory or production (@Mughur)
* ns.corporation.getProduct is city-specific (@Mughur)
* Bulk purchasing is available from the start (@Mughur)
* Can buy multiple upgrades at a time, similar to hacknet node upgrades (@Mughur)
* Various UI changes (@Mughur)
* Removed happiness from employees (@Mughur)
* Coffee renamed to tea (@Mughur)
* Training position renamed to intern (@Mughur)
* More options for SmartSupply (@Mughur)
* Advertising nerf (@Mughur)
* Nerfed investors and reduced effectiveness of "fraud" (@Mughur)
* Fixed React errors, renamed most corp object properties (@Snarling)
* Various other changes (@Mughur, @Snarling)
SF4:
* Faction invites trigger immediately when running ns.singularity.getFactionInvitations (@Snarling)
* Added ns.singularity.getCompanyPositionInfo (@jeek)
SF6:
* Failing a contract or operation now consumes the action (@Zelow79)
SF9:
* The SF9.3 bonus is also given to the player when inside of BN9. (@Zelow79)
* Adjusted the SF1 bonus for hacknet costs (slight nerf), and raised the SF9 bonus to compensate. (@d0sboots)
* Added option to purchase company favor using hashes. (@jeek)
SF10:
* Sleeve shock recovery now scales with intelligence. (@Tyasuh)
* Sleeve kills during crimes count towards numPeopleKilled (@Zelow79)
* Fix a misspelled moneySourceTracker call for sleeves (@zerbosh)
* ns.sleeve.getTask return value now includes cyclesNeeded where applicable (@Snarling)
* Internal type refactoring on Sleeve Work. (@Snarling)
SF12:
* Fix inconsistency in how BN12 multipliers were calculated
SF13:
* Improve performance of Stanek's gift update cycle, and rework (buff) bonus time handling. (@Snarling)
v2.2.2 - 21 Feb 2023
--------------------
PLANNED 2.3 BREAKING CHANGES:

View File

@@ -19,7 +19,7 @@ Then, to fix your script, make sure you have a sleep or any other timed function
await ns.sleep(1000); // Add a 1s sleep to prevent freezing
}
Also make sure that each while loop gets to `awaited` function or `break`, for example the next snippet has a sleep
Also make sure that each while loop gets to the `awaited` function or `break`, for example the next snippet has a sleep
function, but it nor any possible conditional breaks are never reached and therefore will crash the game::
while(true) {
@@ -33,11 +33,11 @@ function, but it nor any possible conditional breaks are never reached and there
}
}
If `n00dles` current money is, for example, 75% of the maximum money, the script will not reach neither `grow` nor `break` and crashes the game.
Adding a sleep like in the first example, or changing the code so that `awaited` function or `break` is always reached, would prevent the crash.
If `n00dles` current money is, for example, 75% of the maximum money, the script will reach neither `grow` nor `break` and the game will crash.
Adding a sleep like in the first example, or changing the code so that the `awaited` function or `break` is always reached, would prevent the crash.
Common infinite loop when translating the server purchasing script in starting guide to :ref:`netscriptjs` is to have a
while loop, that's condition's change is conditional::
while loop, where the condition's change is conditional::
var ram = 8;
var i = 0;
@@ -51,7 +51,7 @@ while loop, that's condition's change is conditional::
}
}
if player does not currently have enough money to purchase a server, the `if`'s condition will be false and `++i` will not be reached.
If the player does not currently have enough money to purchase a server, the `if`'s condition will be false and `++i` will not be reached.
Since the script doesn't have `sleep` and value `i` will not change without the `if` being true, this will crash the game. Adding a `sleep`
that is always reached would prevent the crash.

View File

@@ -860,7 +860,7 @@ startup script. Feel free to adjust it to your liking.
ns.scp("early-hack-template.js", serv);
ns.brutessh(serv);
ns.nuke(serv);
ns.exec("early-hack-template.sj", serv, 12);
ns.exec("early-hack-template.js", serv, 12);
}
}

View File

@@ -38,7 +38,7 @@ Description
From the shadows, they rose.
Organized crime groups quickly filled the void of power left behind from the collapse of
Western government in the 2050s. As society and civlization broke down, people quickly
Western government in the 2050s. As society and civilization broke down, people quickly
succumbed to the innate human impulse of evil and savagery. The organized crime
factions quickly rose to the top of the modern world.
@@ -306,11 +306,11 @@ Source-File
(Note that the Level 3 effect of this Source-File only applies when entering a new BitNode, NOT
when installing Augmentations.)
This Source-File also increases your hacknet multipliers by:
This Source-File also increases hacknet production and reduces hacknet costs by:
* Level 1: 8%
* Level 2: 12%
* Level 3: 14%
* Level 1: 12%
* Level 2: 18%
* Level 3: 21%
Difficulty
Hard

View File

@@ -7,13 +7,13 @@ Welcome to Bitburner's documentation!
=====================================
Bitburner is a programming-based `incremental game <https://en.wikipedia.org/wiki/Incremental_game>`_
that revolves around hacking and cyberpunk themes. The game is currently in the
early beta stage of development. It `can be played here <https://bitburner-official.github.io/bitburner/>`_.
early beta stage of development. It `can be played here <https://danielyxie.github.io/bitburner/>`_.
What is Bitburner?
------------------
Bitburner is a cyberpunk-themed incremental RPG where you, the player, take the role of an unknown hacker in a dark, dystopian world.
When a mysterious hacker called jump3R messages you, he/she confirms your suspicions that there is something wrong with the world around you.
Now, aided by jump3R, you embark on a quest to gain money and power by any means necessary, in the hopes that this will lead to to uncover the
When a mysterious hacker called jump3R messages you, they confirm your suspicions that there is something wrong with the world around you.
Now, aided by jump3R, you embark on a quest to gain money and power by any means necessary, in the hopes that this will lead you to uncover the
secrets that you've been searching for.
.. toctree::

View File

@@ -1,7 +1,7 @@
closeTail() Netscript Function
===============================
.. js:function:: closeTail([scriptPid])
.. js:function:: closeTail([scriptPid = current script])
:RAM cost: 0 GB

View File

@@ -5,7 +5,7 @@ deleteServer() Netscript Function
:RAM cost: 2.25 GB
:param string hostname: Hostname of the server to delete.
:returns: ``true`` if successful, ``false`` otherwise.
:returns: ``true`` if successful.
Deletes the specified purchased server.

View File

@@ -8,12 +8,12 @@ exec() Netscript Function
:param string script: Filename of script to execute.
:param string hostname: Hostname of the target server on which to execute the script.
:param number numThreads: Optional thread count for new script. Set to 1 by
default. Will be rounded to nearest integer
default. Has to be an integer.
:param args...: Additional arguments to pass into the new script that is
being run. Note that if any arguments are being
passed into the new script, then the third argument ``numThreads`` must
be filled in with a value.
:returns: Newly created process id on success, 0 on failure.
:returns: Newly created process id (PID) on success, 0 on failure.
Run a script as a separate process on a specified server. This is similar to
the :doc:`run<run>` function except that it can be used to run a script on any

View File

@@ -1,7 +1,7 @@
fileExists() Netscript Function
===============================
.. js:function:: fileExists(filename[, hostname])
.. js:function:: fileExists(filename[, hostname = current hostname])
:RAM cost: 0.1 GB
@@ -9,9 +9,9 @@ fileExists() Netscript Function
:param string hostname:
Hostname of target server. This is optional. If it is not specified then
the function will use the current server as the target server.
:returns: ``true`` if the file exists, ``false`` if it doesn't.
:returns: ``true`` if the file exists.
The filename for scripts is case-sensitive, but for other types of files it
The filename for scripts and .txt files is case-sensitive, but for other types of files it
is not. For example, ``fileExists("brutessh.exe")`` will work fine, even
though the actual program is named ``BruteSSH.exe``.

View File

@@ -0,0 +1,29 @@
formatRam() Netscript Function
==============================
.. js:function:: formatRam(number[, fractionalDigits = 3[, suffixStart = 1000[, isInteger = false]]])
:RAM cost: 0 GB
:param number number: Number to format.
:param number fractionalDigits: Number of digits to show in the fractional part of the decimal number.
:param number suffixStart: How high a number must be before a suffix will be added.
:param boolean isInteger: Whether the number represents an integer. Integers do not display fractional digits until a suffix is present.
:returns: Formatted string.
Converts a number into a string with formatting.
The format depends on the Numeric Display settings (all options on the "Numeric Display" options page).
Examples:
.. code-block:: javascript
const number = 1.23456789
ns.print(ns.formatNumber(number)); //1.235
ns.print(ns.formatNumber(number,4)); //1.2346
ns.print(ns.formatNumber(number*1e9,3,1e10)); //1234567890
ns.print(ns.formatNumber(number*1e10,5,1e6)); //12.34568b or 1.23457e9
ns.print(ns.formatNumber(number,4,1000, true)); //1.235
ns.print(ns.formatNumber(number,4,1000, false)); //1.2346

View File

@@ -0,0 +1,23 @@
formatPercent() Netscript Function
==============================
.. js:function:: formatPercent(number[, fractionalDigits = 2])
:RAM cost: 0 GB
:param number number: Number to format.
:param number fractionalDigits: Number of digits to show in the fractional part of the decimal number.
:returns: Formatted string.
Converts a number into a string with percent formatting.
The format depends on the Numeric Display settings (all options on the "Numeric Display" options page).
Examples:
.. code-block:: javascript
const number = 1.23456789
ns.print(ns.formatPercent(number)); //123.46%
ns.print(ns.formatPercent(number,4)); //123.4568%

View File

@@ -0,0 +1,26 @@
formatRam() Netscript Function
==============================
.. js:function:: formatRam(number[, fractionalDigits = 2])
:RAM cost: 0 GB
:param number number: Number to format.
:param number fractionalDigits: Number of digits to show in the fractional part of the decimal number.
:returns: Formatted string.
Converts a number into a string with ram formatting.
The format depends on the Numeric Display settings (all options on the "Numeric Display" options page).
Examples:
.. code-block:: javascript
const number = 1.23456789
ns.print(ns.formatRam(number)); //1.23GB or 1.23GiB
ns.print(ns.formatRam(number,0)); //1GB or 1GiB
ns.print(ns.formatRam(number,3)); //1.235GB or 1.235GiB
ns.print(ns.formatRam(2**12,3)); //4.096tB or 4tiB
ns.print(ns.formatRam(2**20,3)); //1.049PB or 1PiB

View File

@@ -1,7 +1,7 @@
getScriptRam() Netscript Function
=================================
.. js:function:: getScriptRam(filename[, hostname])
.. js:function:: getScriptRam(filename[, hostname = current hostname])
:RAM cost: 0.1 GB
:param string filename: Filename of script.

View File

@@ -5,8 +5,9 @@ getSharePower() Netscript Function
:RAM cost: 0.2 GB
Calculate your share power. Based on all the active share calls.
Returns the reputation gain rate multiplier, i.e. 1.5 means +50% rep gain rate.
:returns: Reputation gain rate multiplier from sharing. i.e. 1.5 means +50% rep gain rate.
Calculate your share power, based on all the active share calls.
Examples:

View File

@@ -1,7 +1,7 @@
isRunning() Netscript Function
==============================
.. js:function:: isRunning(filename[, hostname=current hostname[, args...]])
.. js:function:: isRunning(filename[, hostname = current hostname[, args...]])
.. js:function:: isRunning(PID)
:RAM cost: 0.1 GB

View File

@@ -1,8 +1,7 @@
kill() Netscript Function
=========================
.. js:function:: kill(script, [hostname=current hostname, [args...]])
.. js:function:: kill(PID)
.. js:function:: kill(script[, hostname=current hostname[, args...]])
:RAM cost: 0.5 GB
:param string script: Filename of the script to kill.

View File

@@ -1,7 +1,7 @@
killall() Netscript Function
============================
.. js:function:: killall([hostname = current hostname,[safetyguard = true]])
.. js:function:: killall([hostname = current hostname[, safetyguard = true]])
:RAM cost: 0.5 GB
:param string hostname: Hostname of the server on which to kill all scripts.

View File

@@ -1,7 +1,7 @@
moveTail() Netscript Function
===============================
.. js:function:: moveTail(x , y[, pid])
.. js:function:: moveTail(x , y[, pid = current script])
:RAM cost: 0 GB

View File

@@ -1,10 +1,14 @@
mv() Netscript Function
==============================
.. js:function:: mv(serverName, sourceFile, targetFile)
.. js:function:: mv(hostname, sourceFile, targetFile)
:RAM cost: 0 GB
:param string hostname: Hostname of the target server.
:param string sourceFile: Name of the file to be moved/renamed.
:param string targetFile: Target name of the file.
Move the source file to target file on the given server.
This command only works for scripts and text files (.txt). It cannot, however, be used to convert from script to text file, or vice versa.

View File

@@ -7,8 +7,12 @@ nFormat() Netscript Function
:param number number: Number to format.
:param string format: Formatting to use. Read http://numeraljs.com/#format for specifics.
:returns: Formatted string.
onverts a number into a string with the specified formatter.
Deprecated, might be removed in 2.3 version of the game. Use :doc:`formatPercent<formatPercent>` for formatting percentages,
:doc:`formatRam<formatRam>` for formatting ram amounts and :doc:`formatNumber<formatNumber>` for formatting other numbers.
Converts a number into a string with the specified formatter.
This uses the numeral.js library, so the formatters must be compatible with that.
Examples:

View File

@@ -6,7 +6,7 @@ ps() Netscript Function
:RAM cost: 0.2 GB
:param string hostname: Hostname address of the target server.
If not specified, it will be the current server's IP by default.
:returns: array of object
:returns: array of objects
Returns an array with general information about all scripts running on the
specified target server. The information for each server is given in an

View File

@@ -0,0 +1,22 @@
renamePurchasedServer() Netscript Function
===================================
.. js:function:: renamePurchasedServer(hostname, newName)
:RAM cost: 2 GB
:param string hostname: Hostname of the purchased server.
:param string newName: New name for the given server.
:returns: ``true`` if the renaming was succesful.
Upgrades the purchased server with the specified hostname to have specified amount of RAM.
The ``hostname`` argument can be any data type, but it will be converted to
a string and have whitespace removed. New RAM amount has to be higher than the current RAM
and a power of 2. Upgrading a server costs the difference of old RAM server cost and new RAM
server cost.
Example:
.. code-block:: javascript
ns.renamePurchasedServer("server", "old_server");

View File

@@ -1,7 +1,7 @@
resizeTail() Netscript Function
===============================
.. js:function:: resizeTail(width, heigth[, pid])
.. js:function:: resizeTail(width, heigth[, pid = current script])
:RAM cost: 0 GB

View File

@@ -0,0 +1,19 @@
mv() Netscript Function
==============================
.. js:function:: rm(Filename [,hostname = current hostname])
:RAM cost: 0 GB
:param string Filename: Name of the file to be deleted.
:param string hostname: Hostname of the target server.
Delete a file on the given server.
.. warning!:: There is no safetychecks or recycling bins. Deleted files are lost.
Examples:
.. code-block:: javascript
ns.rm("foo.js");

View File

@@ -6,12 +6,12 @@ run() Netscript Function
:RAM cost: 1 GB
:param string script: Filename of script to run
:param number numThreads: Optional thread count for new script. Set to 1 by
default. Will be rounded to nearest integer.
default. Has to be an integer.
:param args...:
Additional arguments to pass into the new script that is being run. Note
that if any arguments are being passed into the new script, then the
second argument ``numThreads`` must be filled in with a value.
:returns: The process id of the new process or 0 on failure.
:returns: The process id (PID) of the new process or 0 on failure.
Run a script as a separate process. This function can only be used to run
scripts located on the current server (the server running the script that

View File

@@ -1,7 +1,7 @@
scan() Netscript Function
=========================
.. js:function:: scan(hostname=current hostname)
.. js:function:: scan(hostname = current hostname)
:RAM cost: 0.2 GB
:param string hostname: Hostname of the server to scan.

View File

@@ -1,7 +1,7 @@
scp() Netscript Function
========================
.. js:function:: scp(files, destination [, source])
.. js:function:: scp(files, destination [, source = current hostname])
:RAM cost: 0.6 GB
:param string/array files: Filename or an array of filenames of script/literature files to copy

View File

@@ -1,7 +1,7 @@
sleep() Netscript Function
==========================
.. js:function:: sleep(n)
.. js:function:: sleep([n = 0])
:RAM cost: 0 GB
:param number n: Number of milliseconds to sleep

View File

@@ -1,12 +1,11 @@
spawn() Netscript Function
==========================
.. js:function:: spawn(script, numThreads[, args...])
.. js:function:: spawn(script[, numThreads = 1[, args...]])
:RAM cost: 2 GB
:param string script: Filename of script to execute
:param number numThreads: Number of threads to spawn new script with. Will
be rounded to nearest integer.
:param number numThreads: Number of threads to spawn new script with. Has to be an integer.
:param args...:
Additional arguments to pass into the new script that is being run.

View File

@@ -1,12 +1,13 @@
tFormat() Netscript Function
==============================
.. js:function:: tFormat(milliseconds[, milliPrecision])
.. js:function:: tFormat(milliseconds[, milliPrecision = false])
:RAM cost: 0 GB
:param string milliseconds: Number of millisecond to format.
:param boolean milliPrecision: Format time with subsecond precision. Defaults to false.
:param boolean milliPrecision: Format time with subsecond precision.
:returns: Formatted string.
Format time to a readable string.

View File

@@ -7,7 +7,7 @@ upgradePurchasedServer() Netscript Function
:param string hostname: Hostname of the purchased server.
:param number ram: Amount of RAM of the purchased server. Must be a power of
2. Maximum value of :doc:`getPurchasedServerMaxRam<getPurchasedServerMaxRam>`
:returns: ``true`` if the upgrade succeeded, ``false`` otherwise
:returns: ``true`` if the upgrade succeeded.
Upgrades the purchased server with the specified hostname to have specified amount of RAM.

View File

@@ -18,6 +18,9 @@ This includes information such as function signatures, what they do, and their r
tprint() <basicfunctions/tprint>
tFormat() <basicfunctions/tFormat>
nFormat() <basicfunctions/nFormat>
formatNumber() <basicfunctions/formatNumber>
formatPercent() <basicfunctions/formatPercent>
formatRam() <basicfunctions/formatRam>
disableLog() <basicfunctions/disableLog>
enableLog() <basicfunctions/enableLog>
isLogEnabled() <basicfunctions/isLogEnabled>
@@ -44,6 +47,7 @@ This includes information such as function signatures, what they do, and their r
ls() <basicfunctions/ls>
ps() <basicfunctions/ps>
mv() <basicfunctions/mv>
rm() <basicfunctions/rm>
hasRootAccess() <basicfunctions/hasRootAccess>
getHostname() <basicfunctions/getHostname>
getHackingLevel() <basicfunctions/getHackingLevel>
@@ -63,6 +67,7 @@ This includes information such as function signatures, what they do, and their r
purchaseServer() <basicfunctions/purchaseServer>
deleteServer() <basicfunctions/deleteServer>
upgradePurchasedServer() <basicfunctions/upgradePurchasedServer>
renamePurchasedServer() <basicfunctions/renamePurchasedServer>
getPurchasedServers() <basicfunctions/getPurchasedServers>
getPurchasedServerLimit() <basicfunctions/getPurchasedServerLimit>
getPurchasedServerMaxRam() <basicfunctions/getPurchasedServerMaxRam>

View File

@@ -7,7 +7,7 @@ Netscript Miscellaneous
Netscript Ports
---------------
Netscript Ports are endpoints that can be used to communicate between scripts.
Netscript Ports are endpoints that can be used to communicate between scripts and across servers.
A port is implemented as a sort of serialized queue, where you can only write
and read one element at a time from the port. Only string and number types may be written to ports. When you read data from a port,
the element that is read is removed from the port.
@@ -15,9 +15,7 @@ the element that is read is removed from the port.
The :js:func:`read`, :js:func:`write`, :js:func:`tryWrite`, :js:func:`clear`, and :js:func:`peek`
Netscript functions can be used to interact with ports.
Right now, there are only 20 ports for Netscript, denoted by the number 1
through 20. When using the functions above, the ports are specified
by passing the number as the first argument and the value as the second.
When using the functions above, the ports are specified by passing the number as the first argument and the value as the second.
The default maximum capacity of a port is 50, but this can be changed in Options > System. Setting this too high can cause the game to use a lot of memory.
.. important:: The data inside ports are not saved! This means if you close and re-open the game, or reload the page then you will lose all of the data in the ports!
@@ -35,7 +33,7 @@ Now assume we ran the following simple script
.. code:: javascript
export async function main(ns) {
for (const i = 0; i < 10; ++i) {
for (var i = 0; i < 10; ++i) {
ns.writePort(1, i); //Writes the value of i to port 1
}
}
@@ -49,7 +47,7 @@ Then, assume we run the following script
.. code:: javascript
export async function main(ns) {
for (const i = 0; i < 3; ++i) {
for (var i = 0; i < 3; ++i) {
ns.print(ns.readPort(1)); //Reads a value from port 1 and then prints it
}
}

View File

@@ -10,7 +10,7 @@ in order to make writing scripts easier, or even use typescript.
To make use of this Remote API through the official server, look here: https://github.com/bitburner-official/typescript-template.
If you want to make your own server, see below for API details.
This API uses the JSON RCP 2.0 protocol. Inputs are in the following form:
This API uses the JSON RPC 2.0 protocol. Inputs are in the following form:
.. code-block:: javascript

View File

@@ -23,7 +23,7 @@ not migrated (require manual changes sometimes):
* getCharacterInformation is deprecated in favor getPlayer
* getServerRam deprecated in favor of getServerMaxRam and getServerUsedRam
* getServerBaseSecurityLevel will be deprecated in favor of nothing, it's not really used.
* sleep can no longer be called simultenaously, a new function called asleep will let you.
* sleep can no longer be called simultaneously, a new function called asleep will let you.
* write returns promise (needs to be await ed).
* scp returns a promise (needs to be await ed).
* free port, write, read

View File

@@ -1,32 +1,32 @@
v2.0.0 Migration Guide
======================
In v2.0.0 a few more API have been broken.
In v2.0.0 a few more APIs have been broken.
Working
-------
Working has been rebuilt from the grounds up. The motivation for that change is that all
Working has been rebuilt from the ground up. The motivation for this change is that all
different types of work all required different cached variables on the main Player object.
This caused a lot of bugs and crashes. It's been reworked in such a way as to prevent bugs
and make it nearly trivial to add new kinds of work.
All work type give their reward immediately. No need to stop work to bank rewards like reputation.
All work types give their reward immediately. No need to stop work to bank rewards like reputation.
Faction and Company work no longer have a time limit.
Company work no longer reduces rep gain by half for quitting early.
Company faction require 400k rep to join (from 200k)
Backdooring company server reduces faction requirement to 300k.
Company factions now require 400k rep to join (up from 200k).
Backdooring a company server reduces faction requirement to 300k.
All types of work generally no longer keep track of cumulative gains like exp and reputation since it's applied instantly.
commitCrime
-----------
crime now loops, meaning after finishing one shoplift you start the next one with no input. While the signature
has not changed its behavior has. It also has a new 'focus' parameters.
Crime now loops, meaning after finishing one shoplift you start the next one with no input. While the signature
has not changed, its behavior has. It also has a new 'focus' parameter.
getPlayer
---------
The following work-related fields are not longer included:
The following work-related fields are no longer included:
* workChaExpGained
* currentWorkFactionName
@@ -55,45 +55,45 @@ getPlayer
* workAgiExpGained
* className
The reason for that is that these fields are all, in one way or another, included in the new work field 'currentWork'.
The reason for this, is that these fields are all, in one way or another, included in the new work field 'currentWork'.
Some of these values are also irrelevant.
Take a look at the new singularity.getCurrentWork function.
Take a look at the new singularity.getCurrentWork function:
All fields ending in _mult have been moved to the 'mults' struct.
For example: getPlayer().hacking_skill_mult => getPlayer().mults.hacking_skill
skills have been moved to the skills struct
skills has been moved to the skills struct
For example: getPlayer().hacking => getPlayer().skills.hacking
exp have been moved to the exp struct
exp has been moved to the exp struct
For example: getPlayer().hacking_exp => getPlayer().exp.hacking
hp have been moved to the hp struct
hp has been moved to the hp struct
For example: getPlayer().max_hp => getPlayer().hp.max or hp.current
hasWseAccount, hasTixApiAccess, has4SData, has4SDataTixApi have been removed and replaced with similar stock functions
hasWseAccount, hasTixApiAccess, has4SData, has4SDataTixApi have been removed and replaced with similar stock functions.
workForCompany
--------------
The argument 'companyName' is now not-optional.
The argument 'companyName' is now required.
getScriptIncome & getScriptExpGain
----------------------------------
Those 2 functions used to have a call where no arguments would return the total for all scripts. This caused weird signature.
If you want to get the total income/exp for all scripts used the new getTotalScriptIncome / getTotalScriptExpGain instead.
These two functions used to have a call where, if no arguments were provided, it would return the total for all scripts. This caused weird signature.
If you want to get the total income/exp for all scripts, use the new getTotalScriptIncome / getTotalScriptExpGain instead.
scp
---
scp has it's 2 last argument reversed, the signature is now scp(files, destination, optional_source)
The last two arguments of spc have been reversed. The signature is now scp(files, destination, optional_source)
Singularity
-----------
A while ago top level singularity function were deprecated in favor of the singularity namespace.
The top level singularity functions were deprecated a while ago in favor of the singularity namespace.
This means calls like 'ns.connect' need to be changed to 'ns.singularity.connect'
@@ -106,4 +106,4 @@ stock.buy, stock.sell, stock.short
corporation.bribe
-----------------
The ability to give shares as bribe has been removed. The signature is now bribe(faction, money)
The ability to give shares as a bribe has been removed. The signature is now bribe(faction, money)

View File

@@ -1,11 +1,10 @@
/* eslint-disable @typescript-eslint/no-var-requires */
const { app, BrowserWindow } = require("electron");
const { app, shell, BrowserWindow } = require("electron");
const log = require("electron-log");
const utils = require("./utils");
const achievements = require("./achievements");
const menu = require("./menu");
const api = require("./api-server");
const cp = require("child_process");
const path = require("path");
const { windowTracker } = require("./windowTracker");
@@ -48,39 +47,15 @@ async function createWindow(killall) {
window.show();
if (debug) window.webContents.openDevTools();
window.webContents.on("new-window", async function (e, url) {
// Let's make sure sure we have a proper url
let parsedUrl;
try {
parsedUrl = new URL(url);
} catch (_) {
// This is an invalid url, let's just do nothing
log.warn(`Invalid url found: ${url}`);
e.preventDefault();
return;
}
// Just use the default handling for file requests, they should be intercepted in main.js file protocol intercept.
if (url.startswith("file://")) return;
if (process.platform === "win32") {
// If we have parameters in the URL, explorer.exe won't register the URL and will open the file explorer instead.
let urlToOpen = parsedUrl.toString();
if (parsedUrl.search) {
log.log(`Cannot open a path with parameters: ${parsedUrl.search}`);
urlToOpen = urlToOpen.replace(parsedUrl.search, "");
// It would be possible to launch an URL with parameter using this, but it would mess up the process again...
// const escapedUri = parsedUrl.href.replace('&', '^&');
// cp.spawn("cmd.exe", ["/c", "start", escapedUri], { detached: true, stdio: "ignore" });
}
cp.spawn("explorer", [urlToOpen], { detached: true, stdio: "ignore" });
} else {
// and open every other protocols on the browser
utils.openExternal(url);
}
e.preventDefault();
window.webContents.setWindowOpenHandler(({ url }) => {
// File protocol is allowed because it will use the file protocol intercept from main.js
if (url.startsWith("file://")) return { action: "allow" };
// Only http and https requests will be forwarded to browser.
// By using shell.openExternal and returning action: "deny"
if (url.startsWith("http://") || url.startsWith("https://")) shell.openExternal(url);
return { action: "deny" };
});
window.webContents.backgroundThrottling = false;
achievements.enableAchievementsInterval(window);

View File

@@ -72,20 +72,6 @@ function setStopProcessHandler(app, window) {
log.error(error);
}
// Because of a steam limitation, if the player has launched an external browser,
// steam will keep displaying the game as "Running" in their UI as long as the browser is up.
// So we'll alert the player to close their browser.
if (global.app_playerOpenedExternalLink) {
await dialog.showMessageBox({
title: "Bitburner",
message: "You may have to close your browser to properly exit the game.",
detail:
'Steam will keep tracking Bitburner as "Running" if any process started within the game is still running.' +
" This includes launching an external link, which opens up your browser.",
type: "warning",
buttons: ["OK"],
});
}
// We'll try to execute javascript on the page to see if we're stuck
let canRunJS = false;
window.webContents.executeJavaScript("window.stop(); document.close()", true).then(() => (canRunJS = true));

View File

@@ -310,7 +310,7 @@ function getMenu(window) {
})
.then(({ response }) => {
if (response === 1) {
utils.openExternal("https://github.com/bitburner-official/bitburner-vscode");
shell.openExternal("https://github.com/bitburner-official/bitburner-vscode");
}
});
},
@@ -369,6 +369,7 @@ function getMenu(window) {
submenu: [
{
label: "Activate",
accelerator: "f12",
click: () => window.webContents.openDevTools(),
},
{

View File

@@ -1,12 +1,12 @@
{
"name": "bitburner",
"version": "1.6.4",
"version": "2.3.1",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "bitburner",
"version": "1.6.4",
"version": "2.3.1",
"dependencies": {
"electron-config": "^2.0.0",
"electron-log": "^4.4.8",

View File

@@ -1,9 +1,9 @@
{
"name": "bitburner",
"version": "1.6.4",
"version": "2.3.1",
"description": "A cyberpunk-themed programming incremental game",
"main": "main.js",
"author": "Daniel Xie & Olivier Gagnon",
"author": "Daniel Xie, Olivier Gagnon, et al.",
"mac": {
"icon": "./public/icons/mac/icon.icns",
"category": "public.app-category.games"

View File

@@ -58,12 +58,10 @@ async function prepareFolders(...folders) {
for (const folder of folders) {
try {
// Making sure the folder exists
// eslint-disable-next-line no-await-in-loop
await fs.stat(folder);
} catch (error) {
if (error.code === "ENOENT") {
log.warn(`'${folder}' not found, creating it...`);
// eslint-disable-next-line no-await-in-loop
await fs.mkdir(folder);
} else {
log.error(error);
@@ -250,13 +248,11 @@ async function saveGameToDisk(window, saveData) {
const fileToRemove = oldestFiles.shift();
log.debug(`Over Quota -> Removing "${fileToRemove}"`);
try {
// eslint-disable-next-line no-await-in-loop
await fs.unlink(fileToRemove);
} catch (error) {
log.error(error);
}
// eslint-disable-next-line no-await-in-loop
saveFolderSizeBytes = await getFolderSizeInBytes(currentFolder);
log.debug(`Save Folder: ${saveFolderSizeBytes} bytes`);
log.debug(

View File

@@ -87,11 +87,6 @@ async function writeToast(window, message, type = "info", duration = 2000) {
await window.webContents.executeJavaScript(`window.appNotifier.toast("${message}", "${type}", ${duration});`, true);
}
function openExternal(url) {
shell.openExternal(url);
global.app_playerOpenedExternalLink = true;
}
function getZoomFactor() {
const configZoom = config.get("zoom", 1);
return configZoom;
@@ -112,7 +107,6 @@ module.exports = {
exportSave,
attachUnresponsiveAppHandler,
detachUnresponsiveAppHandler,
openExternal,
writeTerminal,
writeToast,
getZoomFactor,

View File

@@ -1,10 +1,11 @@
module.exports = {
roots: ["<rootDir>/src/", "<rootDir>/test/"],
moduleFileExtensions: ["ts", "tsx", "js", "jsx"],
transform: {
"^.+\\.(js|jsx|ts|tsx)$": "babel-jest",
},
testPathIgnorePatterns: [".cypress", "node_modules", "dist"],
testEnvironment: "jsdom",
testEnvironment: "./FixJSDOMEnvironment.ts",
moduleNameMapper: {
"\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$":
"<rootDir>/test/__mocks__/fileMock.js",
@@ -12,5 +13,7 @@ module.exports = {
"\\!!raw-loader!.*$": "<rootDir>/test/__mocks__/rawLoader.js",
"@player": "<rootDir>/src/Player",
"@nsdefs": "<rootDir>/src/ScriptEditor/NetscriptDefinitions",
"^monaco-editor$": "<rootDir>/test/__mocks__/monacoMock.js",
"^monaco-vim$": "<rootDir>/test/__mocks__/monacoMock.js",
},
};

View File

@@ -4,7 +4,7 @@
## BasicHGWOptions.additionalMsec property
Number of additional milliseconds that will be spent waiting between the start of the function and when it completes. Experimental in 2.2.2, may be removed in 2.3.
Number of additional milliseconds that will be spent waiting between the start of the function and when it completes.
**Signature:**

View File

@@ -16,7 +16,7 @@ interface BasicHGWOptions
| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| [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. Experimental in 2.2.2, may be removed in 2.3. |
| [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. |
| [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. |

View File

@@ -21,22 +21,10 @@ Array containing current stamina and max stamina.
RAM cost: 4 GB Returns an array with two elements: \* \[Current stamina, Max stamina\]
## Example 1
## Example
```ts
// NS1:
function getStaminaPercentage() {
var res = bladeburner.getStamina();
return res[0] / res[1];
}
```
## Example 2
```ts
// NS2:
```js
function getStaminaPercentage() {
const [current, max] = ns.bladeburner.getStamina();
return current / max;

View File

@@ -32,22 +32,10 @@ RAM cost: 10 GB
Attempts to solve the Coding Contract with the provided solution.
## Example 1
## Example
```js
// NS1
var reward = codingcontract.attempt(yourSolution, filename, hostname);
if (reward) {
tprint("Contract solved successfully! Reward: " + reward)
} else tprint("Failed to solve contract.")
```
## Example 2
```js
// NS2
const reward = codingcontract.attempt(yourSolution, filename, hostname);
if (reward) {
ns.tprint(`Contract solved successfully! Reward: ${reward}`)

View File

@@ -0,0 +1,24 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [CompanyPositionInfo](./bitburner.companypositioninfo.md)
## CompanyPositionInfo interface
Company position requirements and salary.
**Signature:**
```typescript
export interface CompanyPositionInfo
```
## Properties
| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| [name](./bitburner.companypositioninfo.name.md) | | [JobName](./bitburner.jobname.md) | |
| [nextPosition](./bitburner.companypositioninfo.nextposition.md) | | [JobName](./bitburner.jobname.md) \| null | |
| [requiredReputation](./bitburner.companypositioninfo.requiredreputation.md) | | number | |
| [requiredSkills](./bitburner.companypositioninfo.requiredskills.md) | | [Skills](./bitburner.skills.md) | |
| [salary](./bitburner.companypositioninfo.salary.md) | | number | |

View File

@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [CompanyPositionInfo](./bitburner.companypositioninfo.md) &gt; [name](./bitburner.companypositioninfo.name.md)
## CompanyPositionInfo.name property
**Signature:**
```typescript
name: JobName;
```

View File

@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [CompanyPositionInfo](./bitburner.companypositioninfo.md) &gt; [nextPosition](./bitburner.companypositioninfo.nextposition.md)
## CompanyPositionInfo.nextPosition property
**Signature:**
```typescript
nextPosition: JobName | null;
```

View File

@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [CompanyPositionInfo](./bitburner.companypositioninfo.md) &gt; [requiredReputation](./bitburner.companypositioninfo.requiredreputation.md)
## CompanyPositionInfo.requiredReputation property
**Signature:**
```typescript
requiredReputation: number;
```

View File

@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [CompanyPositionInfo](./bitburner.companypositioninfo.md) &gt; [requiredSkills](./bitburner.companypositioninfo.requiredskills.md)
## CompanyPositionInfo.requiredSkills property
**Signature:**
```typescript
requiredSkills: Skills;
```

View File

@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [CompanyPositionInfo](./bitburner.companypositioninfo.md) &gt; [salary](./bitburner.companypositioninfo.salary.md)
## CompanyPositionInfo.salary property
**Signature:**
```typescript
salary: number;
```

View File

@@ -1,11 +0,0 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [CorpConstants](./bitburner.corpconstants.md) &gt; [coffeeCostPerEmployee](./bitburner.corpconstants.coffeecostperemployee.md)
## CorpConstants.coffeeCostPerEmployee property
**Signature:**
```typescript
coffeeCostPerEmployee: number;
```

View File

@@ -19,7 +19,6 @@ interface CorpConstants
| [baseProductProfitMult](./bitburner.corpconstants.baseproductprofitmult.md) | | number | |
| [bribeAmountPerReputation](./bitburner.corpconstants.bribeamountperreputation.md) | | number | |
| [bribeThreshold](./bitburner.corpconstants.bribethreshold.md) | | number | |
| [coffeeCostPerEmployee](./bitburner.corpconstants.coffeecostperemployee.md) | | number | |
| [dividendMaxRate](./bitburner.corpconstants.dividendmaxrate.md) | | number | |
| [employeeRaiseAmount](./bitburner.corpconstants.employeeraiseamount.md) | | number | |
| [employeeSalaryMultiplier](./bitburner.corpconstants.employeesalarymultiplier.md) | | number | Conversion factor for employee stats to initial salary |
@@ -31,7 +30,7 @@ interface CorpConstants
| [marketCyclesPerEmployeeRaise](./bitburner.corpconstants.marketcyclesperemployeeraise.md) | | number | |
| [materialNames](./bitburner.corpconstants.materialnames.md) | | [CorpMaterialName](./bitburner.corpmaterialname.md)<!-- -->\[\] | Names of all materials |
| [maxProductsBase](./bitburner.corpconstants.maxproductsbase.md) | | number | Max products for a division without upgrades |
| [minEmployeeDecay](./bitburner.corpconstants.minemployeedecay.md) | | number | The minimum decay value for happiness/morale/energy |
| [minEmployeeDecay](./bitburner.corpconstants.minemployeedecay.md) | | number | The minimum decay value for morale/energy |
| [officeInitialCost](./bitburner.corpconstants.officeinitialcost.md) | | number | |
| [officeInitialSize](./bitburner.corpconstants.officeinitialsize.md) | | number | |
| [officeSizeUpgradeCostBase](./bitburner.corpconstants.officesizeupgradecostbase.md) | | number | |
@@ -42,6 +41,7 @@ interface CorpConstants
| [sellSharesCooldown](./bitburner.corpconstants.sellsharescooldown.md) | | number | Cooldown for selling shares in game cycles (1 game cycle = 200ms) |
| [sharesPerPriceUpdate](./bitburner.corpconstants.sharesperpriceupdate.md) | | number | When selling large number of shares, price is dynamically updated for every batch of this amount |
| [stateNames](./bitburner.corpconstants.statenames.md) | | [CorpStateName](./bitburner.corpstatename.md)<!-- -->\[\] | Names of all corporation game states |
| [teaCostPerEmployee](./bitburner.corpconstants.teacostperemployee.md) | | number | |
| [unlockNames](./bitburner.corpconstants.unlocknames.md) | | [CorpUnlockName](./bitburner.corpunlockname.md)<!-- -->\[\] | Names of all one-time corporation-wide unlocks |
| [upgradeNames](./bitburner.corpconstants.upgradenames.md) | | [CorpUpgradeName](./bitburner.corpupgradename.md)<!-- -->\[\] | Names of all corporation-wide upgrades |
| [warehouseInitialCost](./bitburner.corpconstants.warehouseinitialcost.md) | | number | |

View File

@@ -4,7 +4,7 @@
## CorpConstants.minEmployeeDecay property
The minimum decay value for happiness/morale/energy
The minimum decay value for morale/energy
**Signature:**

View File

@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [CorpConstants](./bitburner.corpconstants.md) &gt; [teaCostPerEmployee](./bitburner.corpconstants.teacostperemployee.md)
## CorpConstants.teaCostPerEmployee property
**Signature:**
```typescript
teaCostPerEmployee: number;
```

View File

@@ -14,6 +14,6 @@ type CorpEmployeePosition =
| "Business"
| "Management"
| "Research & Development"
| "Training"
| "Intern"
| "Unassigned";
```

View File

@@ -9,12 +9,13 @@
```typescript
type CorpIndustryName =
| "Energy"
| "Spring Water"
| "Water Utilities"
| "Agriculture"
| "Fishing"
| "Mining"
| "Food"
| "Refinery"
| "Restaurant"
| "Tobacco"
| "Chemical"
| "Pharmaceutical"

View File

@@ -9,8 +9,9 @@
```typescript
type CorpMaterialName =
| "Minerals"
| "Ore"
| "Water"
| "Energy"
| "Food"
| "Plants"
| "Metal"

View File

@@ -16,7 +16,7 @@ buyBackShares(amount: number): void;
| Parameter | Type | Description |
| --- | --- | --- |
| amount | number | Amount of shares to buy back. |
| amount | number | Amount of shares to buy back, must be integer and larger than 0 |
**Returns:**

View File

@@ -1,15 +1,15 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [Corporation](./bitburner.corporation.md) &gt; [getUnlockUpgradeCost](./bitburner.corporation.getunlockupgradecost.md)
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [Corporation](./bitburner.corporation.md) &gt; [getUnlockCost](./bitburner.corporation.getunlockcost.md)
## Corporation.getUnlockUpgradeCost() method
## Corporation.getUnlockCost() method
Gets the cost to unlock a one time unlockable upgrade
**Signature:**
```typescript
getUnlockUpgradeCost(upgradeName: string): number;
getUnlockCost(upgradeName: string): number;
```
## Parameters

View File

@@ -1,15 +1,15 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [Corporation](./bitburner.corporation.md) &gt; [hasUnlockUpgrade](./bitburner.corporation.hasunlockupgrade.md)
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [Corporation](./bitburner.corporation.md) &gt; [hasUnlock](./bitburner.corporation.hasunlock.md)
## Corporation.hasUnlockUpgrade() method
## Corporation.hasUnlock() method
Check if you have a one time unlockable upgrade
**Signature:**
```typescript
hasUnlockUpgrade(upgradeName: string): boolean;
hasUnlock(upgradeName: string): boolean;
```
## Parameters

View File

@@ -30,15 +30,15 @@ export interface Corporation extends WarehouseAPI, OfficeAPI
| [getIndustryData(industryName)](./bitburner.corporation.getindustrydata.md) | Get constant industry definition data for a specific industry |
| [getInvestmentOffer()](./bitburner.corporation.getinvestmentoffer.md) | Get an offer for investment based on you companies current valuation |
| [getMaterialData(materialName)](./bitburner.corporation.getmaterialdata.md) | Get constant data for a specific material |
| [getUnlockUpgradeCost(upgradeName)](./bitburner.corporation.getunlockupgradecost.md) | Gets the cost to unlock a one time unlockable upgrade |
| [getUnlockCost(upgradeName)](./bitburner.corporation.getunlockcost.md) | Gets the cost to unlock a one time unlockable upgrade |
| [getUpgradeLevel(upgradeName)](./bitburner.corporation.getupgradelevel.md) | Get the level of a levelable upgrade |
| [getUpgradeLevelCost(upgradeName)](./bitburner.corporation.getupgradelevelcost.md) | Gets the cost to unlock the next level of a levelable upgrade |
| [goPublic(numShares)](./bitburner.corporation.gopublic.md) | Go public |
| [hasCorporation()](./bitburner.corporation.hascorporation.md) | Returns whether the player has a corporation. Does not require API access. |
| [hasUnlockUpgrade(upgradeName)](./bitburner.corporation.hasunlockupgrade.md) | Check if you have a one time unlockable upgrade |
| [hasUnlock(upgradeName)](./bitburner.corporation.hasunlock.md) | Check if you have a one time unlockable upgrade |
| [issueDividends(rate)](./bitburner.corporation.issuedividends.md) | Issue dividends |
| [issueNewShares(amount)](./bitburner.corporation.issuenewshares.md) | Issue new shares |
| [levelUpgrade(upgradeName)](./bitburner.corporation.levelupgrade.md) | Level an upgrade. |
| [purchaseUnlock(upgradeName)](./bitburner.corporation.purchaseunlock.md) | Unlock an upgrade |
| [sellShares(amount)](./bitburner.corporation.sellshares.md) | Sell Shares |
| [unlockUpgrade(upgradeName)](./bitburner.corporation.unlockupgrade.md) | Unlock an upgrade |

View File

@@ -1,15 +1,15 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [Corporation](./bitburner.corporation.md) &gt; [unlockUpgrade](./bitburner.corporation.unlockupgrade.md)
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [Corporation](./bitburner.corporation.md) &gt; [purchaseUnlock](./bitburner.corporation.purchaseunlock.md)
## Corporation.unlockUpgrade() method
## Corporation.purchaseUnlock() method
Unlock an upgrade
**Signature:**
```typescript
unlockUpgrade(upgradeName: string): void;
purchaseUnlock(upgradeName: string): void;
```
## Parameters

View File

@@ -16,7 +16,7 @@ sellShares(amount: number): void;
| Parameter | Type | Description |
| --- | --- | --- |
| amount | number | Amount of shares to sell. |
| amount | number | Amount of shares to sell, must be integer between 1 and 100t |
**Returns:**

View File

@@ -13,7 +13,6 @@ type CorpResearchName =
| "AutoBrew"
| "AutoPartyManager"
| "Automatic Drug Administration"
| "Bulk Purchasing"
| "CPH4 Injections"
| "Drones"
| "Drones - Assembly"
@@ -21,7 +20,6 @@ type CorpResearchName =
| "Go-Juice"
| "HRBuddy-Recruitment"
| "HRBuddy-Training"
| "JoyWire"
| "Market-TA.I"
| "Market-TA.II"
| "Overclock"

View File

@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [Division](./bitburner.division.md) &gt; [maxProducts](./bitburner.division.maxproducts.md)
## Division.maxProducts property
How many products this division can support
**Signature:**
```typescript
maxProducts: number;
```

View File

@@ -21,13 +21,14 @@ interface Division
| [lastCycleExpenses](./bitburner.division.lastcycleexpenses.md) | | number | Expenses last cycle |
| [lastCycleRevenue](./bitburner.division.lastcyclerevenue.md) | | number | Revenue last cycle |
| [makesProducts](./bitburner.division.makesproducts.md) | | boolean | Whether the industry this division is in is capable of making products |
| [maxProducts](./bitburner.division.maxproducts.md) | | number | How many products this division can support |
| [name](./bitburner.division.name.md) | | string | Name of the division |
| [numAdVerts](./bitburner.division.numadverts.md) | | number | Number of times AdVert has been bought |
| [popularity](./bitburner.division.popularity.md) | | number | Popularity of the division |
| [prodMult](./bitburner.division.prodmult.md) | | number | Production multiplier |
| [products](./bitburner.division.products.md) | | string\[\] | Products developed by this division |
| [research](./bitburner.division.research.md) | | number | Amount of research in that division |
| [productionMult](./bitburner.division.productionmult.md) | | number | Production multiplier |
| [products](./bitburner.division.products.md) | | string\[\] | Names of Products developed by this division |
| [researchPoints](./bitburner.division.researchpoints.md) | | number | Amount of research in that division |
| [thisCycleExpenses](./bitburner.division.thiscycleexpenses.md) | | number | Expenses this cycle |
| [thisCycleRevenue](./bitburner.division.thiscyclerevenue.md) | | number | Revenue this cycle |
| [type](./bitburner.division.type.md) | | [CorpIndustryName](./bitburner.corpindustryname.md) | Type of division, like Agriculture |
| [upgrades](./bitburner.division.upgrades.md) | | number\[\] | All research bought |

View File

@@ -1,13 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [Division](./bitburner.division.md) &gt; [upgrades](./bitburner.division.upgrades.md)
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [Division](./bitburner.division.md) &gt; [numAdVerts](./bitburner.division.numadverts.md)
## Division.upgrades property
## Division.numAdVerts property
All research bought
Number of times AdVert has been bought
**Signature:**
```typescript
upgrades: number[];
numAdVerts: number;
```

View File

@@ -1,13 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [Division](./bitburner.division.md) &gt; [prodMult](./bitburner.division.prodmult.md)
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [Division](./bitburner.division.md) &gt; [productionMult](./bitburner.division.productionmult.md)
## Division.prodMult property
## Division.productionMult property
Production multiplier
**Signature:**
```typescript
prodMult: number;
productionMult: number;
```

View File

@@ -4,7 +4,7 @@
## Division.products property
Products developed by this division
Names of Products developed by this division
**Signature:**

View File

@@ -1,13 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [Division](./bitburner.division.md) &gt; [research](./bitburner.division.research.md)
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [Division](./bitburner.division.md) &gt; [researchPoints](./bitburner.division.researchpoints.md)
## Division.research property
## Division.researchPoints property
Amount of research in that division
**Signature:**
```typescript
research: number;
researchPoints: number;
```

View File

@@ -1,13 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [Export](./bitburner.export.md) &gt; [amt](./bitburner.export.amt.md)
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [Export](./bitburner.export.md) &gt; [amount](./bitburner.export.amount.md)
## Export.amt property
## Export.amount property
Amount of material exported
**Signature:**
```typescript
amt: string;
amount: string;
```

View File

@@ -1,13 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [Export](./bitburner.export.md) &gt; [loc](./bitburner.export.loc.md)
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [Export](./bitburner.export.md) &gt; [city](./bitburner.export.city.md)
## Export.loc property
## Export.city property
City the material is being exported to
**Signature:**
```typescript
loc: CityName;
city: CityName;
```

View File

@@ -1,13 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [Export](./bitburner.export.md) &gt; [div](./bitburner.export.div.md)
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [Export](./bitburner.export.md) &gt; [division](./bitburner.export.division.md)
## Export.div property
## Export.division property
Division the material is being exported to
**Signature:**
```typescript
div: string;
division: string;
```

View File

@@ -16,7 +16,7 @@ interface Export
| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| [amt](./bitburner.export.amt.md) | | string | Amount of material exported |
| [div](./bitburner.export.div.md) | | string | Division the material is being exported to |
| [loc](./bitburner.export.loc.md) | | [CityName](./bitburner.cityname.md) | City the material is being exported to |
| [amount](./bitburner.export.amount.md) | | string | Amount of material exported |
| [city](./bitburner.export.city.md) | | [CityName](./bitburner.cityname.md) | City the material is being exported to |
| [division](./bitburner.export.division.md) | | string | Division the material is being exported to |

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