Compare commits

..

261 Commits

Author SHA1 Message Date
hydroflame
f5cdb48497 Merge pull request #681 from azoxey/doc-cleanup
DOC: clean up documentation
2023-07-30 18:21:41 -04:00
Azoxey
ac753dd17f correct more grammatical issues, be more consistent with shortcuts in guide, clean up formatting 2023-07-27 18:49:43 -05:00
Azoxey
2815bf22eb improve readability (in an editing context) of documentation 2023-07-27 16:05:26 -05:00
Azoxey
438568e882 fix editorconfig for markdown 2023-07-27 06:47:55 -05:00
Azoxey
d8a5f038e9 fix typos, grammatical errors, remove outdated info 2023-07-27 06:44:13 -05:00
omuretsu
fb542a596c Fix scan-analyze box drawing
Non-matching up-and-right character made some fonts display scan-analyze oddly.
2023-07-13 08:12:16 -04:00
omuretsu
8b008e1b7a Fix ctrl-click for docs
ctrl-clicking doc links leads to dev branch docs if you are playing on dev branch. Makes this behavior usable before stable branch gets updated.
2023-07-12 19:41:00 -04:00
omuretsu
d943f39401 Update changelog 12 July 2023 2023-07-12 19:28:58 -04:00
omuretsu
5da79d5107 Fix broken link 2023-07-12 19:02:34 -04:00
hydroflame
1a8b9a96ec Documentation added ingame (#667) 2023-07-12 17:10:52 -04:00
G4mingJon4s
6bd5ce38d5 Fixed ram evaluation to include more edge-cases (#665) 2023-07-11 14:09:23 -04:00
omuretsu
61a27fb9c7 Fix default value for hireEmployee
Not providing a position now hires unassigned just like the documentation says
2023-07-11 11:50:55 -04:00
omuretsu
05651aa7f5 Fix faction augmentations screen
* Buying an augmentation rerenders the augmentations page (rerender function passed down through props)
* Each unowned purchasable augmentation rerenders periodically to re-check whether it can be bought.
2023-07-11 11:28:23 -04:00
omuretsu
993f234f48 Fix sleeve faction work from ui
Bandaid fix. I have a much better fix in mind for this, but it will need to wait until 2.4 since it will include some breaking changes.
2023-07-11 11:03:49 -04:00
Snarling
e2655793f4 TYPESAFETY: CompanyName (#650) 2023-07-11 09:23:17 -04:00
G4mingJon4s
e4d3a9020e Fix static ram calculation when exports are renamed (#664) 2023-07-09 08:08:43 -04:00
omuretsu
351a7fc5f8 Update dev changelog 7/7/23 2023-07-07 18:55:25 -04:00
Snarling
006fbd528f DOCS: Add printRaw and tprintRaw docs (#663) 2023-07-07 18:23:26 -04:00
Snarling
3981f72149 Add investment info to API representation of product (#661) 2023-07-05 19:50:29 -04:00
Snarling
312e3eb71f Fix for invalid materials in warehouse (#660) 2023-07-05 19:36:22 -04:00
Snarling
26cdc502bf Fix backwards name for indent option (#659) 2023-07-05 18:18:53 -04:00
Rodney Gauna
e6eb35fabc Fix URL for Speaking JavaScript (#658) 2023-07-04 20:46:06 -04:00
David Walker
babefc5477 BUGFIX: Fix potential double-free in atExit() (#655)
Fixes #654
2023-06-30 18:15:37 -04:00
Snarling
48e7bd6471 CODEBASE: Follow-up for lint rules PR + address some eslint disables (#651) 2023-06-29 13:22:10 -04:00
Meggal
bc00a1c134 Fix bug smaller than a tardigrate (#653) 2023-06-28 16:21:15 -04:00
Aleksei Bezrodnov
1d5a735941 MISC: enforce eslint react checks (#640) 2023-06-26 22:29:44 -04:00
Snarling
91bfb154b6 Better docs for ascension result (#649) 2023-06-26 04:56:58 -04:00
Aleksei Bezrodnov
1af01401d9 UI: Correct behavior of "back" button on faction augs page
Plus router refactoring
2023-06-26 04:24:37 -04:00
Snarling
9a0a843ffc TYPESAFETY: FactionName (#644) 2023-06-25 22:53:35 -04:00
Snarling
1de676972f TEST: Add savegame continuity test (#645) 2023-06-24 10:08:21 -04:00
omuretsu
4c9ca49904 Prettier 2023-06-23 10:14:18 -04:00
omuretsu
6f26fb81e8 Fix NFG display text 2023-06-23 10:13:45 -04:00
Nils Ramstöck
4560fb7250 QUICKFIX: Issue #630 (#635) 2023-06-20 19:00:06 -04:00
omuretsu
21b04bdec0 Regenerate docs 2023-06-20 18:25:27 -04:00
htmlh4cker
d4113e325a DOCS: fix issue in scp .md (#636) 2023-06-20 18:04:06 -04:00
omuretsu
aecdbe8e8f Fix bad aug reinitialization point
This is just a quick fix. Also added some savegame fix code that will soon be removed once the better fix is in.
2023-06-20 07:57:46 -04:00
omuretsu
4b8a4d739b Revert "quickfix: aug list (#629)"
This reverts commit c059c35bca.
2023-06-20 07:35:54 -04:00
Aleksei Bezrodnov
c059c35bca quickfix: aug list (#629) 2023-06-20 07:31:45 -04:00
omuretsu
92c41e60e2 Update changelog 19 Jun 2023 2023-06-19 06:31:39 -04:00
Aleksei Bezrodnov
78ca279df7 FIX: singularity faction donation formula (#619) 2023-06-19 03:55:03 -04:00
Aleksei Bezrodnov
08e3afd125 FIX: show ram calculation error reason to player (#627) 2023-06-19 03:49:32 -04:00
Aleksei Bezrodnov
9e75621cd2 UI: add cursor options to the script editor (#615) 2023-06-18 21:17:15 -04:00
Aleksei Bezrodnov
709875d9ca FIX: script options modal issue #625 (#626) 2023-06-17 17:58:56 -04:00
Snarling
c2dacedcb3 Fix UI regression for crime in progress (#621) 2023-06-16 22:24:32 -04:00
Snarling
a4b826683e TYPESAFETY: Strict internal typing for AugmentationName (#608) 2023-06-16 17:52:42 -04:00
Aleksei Bezrodnov
12b5c00d14 fix RAM calculation on a different server (#612) 2023-06-13 17:19:42 -04:00
Aleksei Bezrodnov
192c1947a6 fix enum value deserialization (#609) 2023-06-13 15:04:56 -04:00
rqzcho
2537ded3c2 TERMINAL: Allow new lines in terminal when empty (#605) 2023-06-13 14:04:21 -04:00
omuretsu
c7d05cae58 Add parens to replacement for IINV and EINV 2023-06-12 16:04:21 -04:00
Aleksei Bezrodnov
61c8026bd0 fix sleeve university job (#604) 2023-06-12 15:19:35 -04:00
omuretsu
70eda40bb6 Changelog update 2023-06-12 01:20:24 -04:00
omuretsu
01e7b2a6a9 Fix possible crash on invalid aug name
Fixes error from #591
2023-06-12 01:13:25 -04:00
Aleksei Bezrodnov
969f3170f1 fix WorkInProgress component warnings (#600)
Also improves WorkInProgress performance by reducing unnecessary rerenders
2023-06-12 01:04:56 -04:00
Aleksei Bezrodnov
b52284806f UI: show all skills in import save comparison tool (#599) 2023-06-12 00:46:54 -04:00
Snarling
6732549196 ENUMS: Initial Enum Helper rework + Reorganization (#596) 2023-06-12 00:34:20 -04:00
Thomas P
6ed8ea9796 DOCS: Fixed broken link (#593) 2023-06-12 00:28:17 -04:00
omuretsu
762f8a23ef Dev changelog 2023-06-10 16:38:09 -04:00
Aleksei Bezrodnov
d0f2398f01 fix: do not scroll log on scroll log window drag (#592) 2023-06-10 16:31:29 -04:00
Aleksei Bezrodnov
174f10d1f5 MISC: tiny corp code style improvement (#586) 2023-06-09 19:34:35 -04:00
tdnzr
8f312ba616 Update renamePurchasedServer.rst (#585) 2023-06-09 04:35:55 -04:00
tdnzr
4fc5a23bf1 Update rm.rst (#584) 2023-06-09 04:34:51 -04:00
omuretsu
325224df27 2.3.2dev start 2023-06-07 15:06:47 -04:00
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
996 changed files with 35453 additions and 350339 deletions

View File

@@ -6,5 +6,5 @@ indent_size = 2
trim_trailing_whitespace = true
insert_final_newline = true
[md]
[*.md]
trim_trailing_whitespace = false

View File

@@ -7,8 +7,10 @@ module.exports = {
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"plugin:@typescript-eslint/strict",
"plugin:react/recommended",
"plugin:react-hooks/recommended",
//"plugin:@typescript-eslint/recommended-requiring-type-checking",
//"plugin:@typescript-eslint/strict",
],
parser: "@typescript-eslint/parser",
parserOptions: {
@@ -20,7 +22,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",
@@ -32,5 +33,6 @@ module.exports = {
],
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/no-explicit-any": "off",
"react/no-unescaped-entities": "off",
},
};

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

@@ -1,19 +0,0 @@
# Minimal makefile for Sphinx documentation
#
# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = python2.7 -msphinx
SOURCEDIR = source
BUILDDIR = build
# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
.PHONY: help Makefile
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

View File

@@ -1,35 +0,0 @@
@ECHO OFF
pushd %~dp0
REM Command file for Sphinx documentation
if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=python -msphinx
)
set SOURCEDIR=source
set BUILDDIR=build
if "%1" == "" goto help
%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The Sphinx module was not found. Make sure you have Sphinx installed,
echo.then set the SPHINXBUILD environment variable to point to the full
echo.path of the 'sphinx-build' executable. Alternatively you may add the
echo.Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.http://sphinx-doc.org/
exit /b 1
)
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
goto end
:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
:end
popd

View File

@@ -1,43 +0,0 @@
!_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/
!_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/
!_TAG_PROGRAM_AUTHOR Darren Hiebert /dhiebert@users.sourceforge.net/
!_TAG_PROGRAM_NAME Exuberant Ctags //
!_TAG_PROGRAM_URL http://ctags.sourceforge.net /official site/
!_TAG_PROGRAM_VERSION 5.8 //
author .\conf.py /^author = 'Bitburner'$/;" v
copyright .\conf-guzzle.py /^copyright = u'2017, Daniel Xie'$/;" v
copyright .\conf.py /^copyright = '2017, Bitburner'$/;" v
exclude_patterns .\conf-guzzle.py /^exclude_patterns = ['_build']$/;" v
exclude_patterns .\conf.py /^exclude_patterns = []$/;" v
extensions .\conf-guzzle.py /^extensions = []$/;" v
extensions .\conf.py /^extensions = ['sphinx.ext.autodoc',$/;" v
guzzle_sphinx_theme .\conf-guzzle.py /^import guzzle_sphinx_theme$/;" i
html_show_sourcelink .\conf-guzzle.py /^html_show_sourcelink = False$/;" v
html_static_path .\conf.py /^html_static_path = ['ystatic']$/;" v
html_theme .\conf-guzzle.py /^html_theme = 'guzzle_sphinx_theme'$/;" v
html_theme .\conf.py /^html_theme = 'agogo'$/;" v
html_theme_options .\conf-guzzle.py /^html_theme_options = {$/;" v
html_theme_path .\conf-guzzle.py /^html_theme_path = guzzle_sphinx_theme.html_theme_path()$/;" v
htmlhelp_basename .\conf.py /^htmlhelp_basename = 'Bitburnerdoc'$/;" v
intersphinx_mapping .\conf.py /^intersphinx_mapping = {'https:\/\/docs.python.org\/': None}$/;" v
language .\conf.py /^language = 'English'$/;" v
latex_documents .\conf.py /^latex_documents = [$/;" v
latex_elements .\conf.py /^latex_elements = {$/;" v
man_pages .\conf.py /^man_pages = [$/;" v
master_doc .\conf-guzzle.py /^master_doc = 'index'$/;" v
master_doc .\conf.py /^master_doc = 'index'$/;" v
os .\conf-guzzle.py /^import sys, os, subprocess$/;" i
project .\conf-guzzle.py /^project = u'Bitburner'$/;" v
project .\conf.py /^project = 'Bitburner'$/;" v
pygments_style .\conf.py /^pygments_style = 'sphinx'$/;" v
release .\conf.py /^release = '1.0'$/;" v
source_suffix .\conf-guzzle.py /^source_suffix = '.rst'$/;" v
source_suffix .\conf.py /^source_suffix = '.rst'$/;" v
subprocess .\conf-guzzle.py /^import sys, os, subprocess$/;" i
sys .\conf-guzzle.py /^import sys, os, subprocess$/;" i
templates_path .\conf-guzzle.py /^templates_path = ['_templates']$/;" v
templates_path .\conf.py /^templates_path = ['ytemplates']$/;" v
texinfo_documents .\conf.py /^texinfo_documents = [$/;" v
todo_include_todos .\conf.py /^todo_include_todos = True$/;" v
version .\conf-guzzle.py /^version = '1.0.0'$/;" v
version .\conf.py /^version = '1.0'$/;" v

View File

@@ -1,8 +0,0 @@
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.

View File

@@ -1,16 +0,0 @@
Advanced Gameplay
=================
This section documents Bitburner gameplay elements that are **not** immediately
available and/or accessible to the player. These gameplay mechanics
must be unlocked.
.. toctree::
:maxdepth: 5
:caption: Elements:
BitNodes <advancedgameplay/bitnodes>
Source-Files <advancedgameplay/sourcefiles>
Intelligence <advancedgameplay/intelligence>
Sleeves <advancedgameplay/sleeves>
Grafting <advancedgameplay/grafting>
Hacking algorithms <advancedgameplay/hackingalgorithms>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

View File

@@ -1,60 +0,0 @@
.. _gameplay_bitnodes:
.. warning:: This page contains spoilers regarding the game's story/plot-line.
BitNodes
========
A BitNode is an important part of the game's storyline. In the game, you discover
what BitNodes are by following the trail of clues left by the mysterious jump3r
(essentially a minimal questline).
What is a BitNode
^^^^^^^^^^^^^^^^^
A BitNode is the complex simulated reality in which you reside. By following the messages
from jump3r, you discover that humanity was enslaved by an advanced alien race, called
the Enders, using virtual simulations that trapped the minds of humans.
However, the Enders didn't just create a single virtual reality to enslave humans, but many
different simulations. In other words, there are many different BitNodes that exist.
These BitNode are very different from each other.
jump3r tells you that the only hope for humanity is to destroy all of these BitNodes.
Therefore, the end goal for the player is to enter and then destroy each BitNode at least once.
Destroying a BitNode resets most of the player's progress but grants the player a
powerful second-tier persistent upgrade called a :ref:`Source-File <gameplay_sourcefiles>`.
Different BitNodes grant different Source-Files.
Each BitNode has unique characteristics that are related to varying backstories. For example,
in one BitNode the world is in the middle of a financial catastrophe with a collapsing
market. In this BitNode, most forms of income such as working at a company or Hacknet
Nodes are significantly less profitable. Servers have less money on them and lowered
growth rates, but it is easier to lower their security level using the weaken() Netscript function.
Furthermore, some BitNodes introduce new content and mechanics. For example there is one
BitNode that grants access to the `Singularity API <https://github.com/bitburner-official/bitburner-src/blob/dev/markdown/bitburner.singularity.md>`_.
There is another BitNode in which you can manage a gang to earn money and reputation.
.. _gameplay_bitnodes_howtodestroy:
How to destroy a BitNode
^^^^^^^^^^^^^^^^^^^^^^^^
Initially, the only way to destroy a BitNode is to join the Daedalus :ref:`Daedalus <gameplay_factions>`.
From Daedalus, the player can obtain an Augmentation called 'The Red Pill', which doesn't cost any money
but does require a good amount of faction reputation.
After installing 'The Red Pill', the player must search for and then manually hack a
server called 'w0r1d_d43m0n'. This server requires a hacking level of 3000 in order
to successfully hack it. This will destroy the player's current BitNode.
There is a second method of destroying a BitNode, but it must be unlocked by first
destroying BitNode-6 or BitNode-7 (Bladeburners).
.. todo:: Link to Bladeburner documentation page here
When the player destroys a BitNode, most of his/her progress will be reset. This includes things
such as Augmentations and RAM upgrades on the home computer. The only things that will persist
through destroying BitNodes is:
* Source-Files
* Scripts on the home computer

View File

@@ -1,18 +0,0 @@
.. _gameplay_grafting:
Grafting
========
Grafting is an experimental process through which you can obtain the benefits of
Augmentations, without needing to reboot your body.
Grafting can be done at VitaLife in New Tokyo, where you'll find a shady researcher with
questionable connections. From there, you can spend a sum of money to begin grafting
Augmentations. This will take some time. When done, the Augmentation will be applied to
your character without needing to install.
Be warned, some who have tested grafting have reported an unidentified malware. Dubbed
"Entropy", this virus seems to grow in potency as more Augmentations are grafted,
causing unpredictable affects to the victim.
Note that when crafting an Augmentation, cancelling will **not** save your progress,
and the money spent will **not** be returned.

View File

@@ -1,124 +0,0 @@
Hacking algorithms
==================
There are three primary families of hacking algorithms. This guide will go over each of them and advise on how they can be implemented.
Self-contained algorithms
-------------------------
**Difficulty**: Easy
Pros:
* Easy to implement
* Does not require other scripts to work
* Works at any stage of the game
Cons:
* Limits income generation
* Extremely RAM inefficient
* Utilizes script online time poorly
* Risk of over hacking
Self-contained algorithms are the simplest family of hacking algorithms to implement. Each script is tasked with choosing which function to execute based on the status of the target server. Because of this, they guarantee a consistent, but relatively small, flow of money.
The general logic goes like this:
.. code-block:: javascript
loop forever {
if security is not minimum {
await ns.weaken(target)
} else if money is not maximum {
await ns.grow(target)
} else {
await ns.hack(target)
}
}
This algorithm is perfectly capable of paving the way through the majority of the game, but it has a few significant issues.
- It tends to make all your scripts on every server do the same thing. (e.g. If the target is 0.01 security above the minimum, all scripts will decide to weaken, when only a handful of threads should be devoted to the task)
- At higher thread counts, these scripts have the potential to hack the server to $0, or maximum security, requiring a long setup time while the scripts return the server to the best stats.
- Requires function calls such as `getServerSecurityLevel()` and `getServerMoneyAvailable()`, as well as calling all three hacking functions, increasing RAM cost which is multiplied by the number of allocated threads
Loop algorithms
---------------
**Difficulty**: Easy to Medium
Pros:
* Simple to understand
* Works at any stage of the game
* Maximize RAM usage
Cons:
* Requires a script that handles deployment
By splitting our hack, weaken, and grow functions into three separate scripts, we can both remove our reliance on functions such as `getServerSecurityLevel()` as well as removing functions that cannot work concurrently, reducing RAM requirements, and thus increasing our thread limits. Loop scripts are formatted like this:
.. code-block:: javascript
loop forever {
await ns.hack(target) // or grow, or weaken
}
Now we can take the total amount of threads available and split it and allocate, for example:
- 1 part to the hack scripts
- 10 parts to the grow scripts
- 2 parts to the weaken scripts
Meaning if we have space for 100 threads across the entire network 7 threads will go to the hack scripts, 76 threads will go to the grow scripts and 15 threads will go to the weaken scripts. The ratios described here are arbitrary and can be greatly improved through the use of the analyze functions, and later, through the use of Formulas.exe.
When utilizing this strategy, monitor the amount of money and security on the target server, if the money is not hovering around maximum and the security around the minimum, the ratios should be tweaked until that is the case.
Utilizing `sleep()` or `asleep()` to ensure that your scripts do not all start at the same time can decrease the chance of issues associated with overhacking occurring. Both functions have a ram cost of zero.
Batch algorithms (HGW, HWGW, or Cycles)
---------------------------------------
**Difficulty**: Hard
Pros:
* Maximum potential income
Cons:
* Very difficult to implement without prior programming knowledge
* Very difficult to make work on servers with less than 1TB of RAM
Batch algorithms utilize a master script that uses `exec()` many scripts which utilize a relevant hacking function in batches.
The scripts used to execute the hacking functions are even simpler than the previous algorithms but a complex controller is required to calculate the effect, time taken, and the necessary delay.
.. code-block:: javascript
await ns.sleep(a bit)
await ns.hack(target) // or grow, or weaken
A few things need to be known before this algorithm can be implemented:
- The effects of hack and grow depend on the server security level, a higher security level results in a reduced effect. You only want these effects to occur when the security level is minimized.
- The time taken to execute hack, grow, or weaken is determined when the function is called and is based on the security level of the target server and your hacking level. You only want these effects to start when the security level is minimized.
- The effects of hack, grow, and weaken, are determined when the time is completed, rather than at the beginning. Hack should finish when security is minimum and money is maximum. Grow should finish when security is minimum, shortly after a hack occurred. Weaken should occur when security is not at a minimum due to a hack or grow increasing it.
A single batch consists of four actions:
1. A hack script removes a predefined, precalculated amount of money from the target server.
2. A weaken script counters the security increase of the hack script.
3. A grow script counters the money decrease caused by the hack script.
4. A weaken script counters the security increase caused by the grow script.
It is also important that these 4 scripts finish in the order specified above, and all of their effects be precalculated to optimize the ratios between them. This is the reason for the delay in the scripts.
It is possible to create batches with 3 scripts (HGW) but the efficiency of grow will be harmed by the security increase caused by the hack scripts.
The following is an image demonstrating batches in action:
.. image:: batch.png
Batches only function predictably when the target server is at minimum security and maximum money, so your script must also handle preparing a server for your batches. You can utilize batches to prepare a server by using no hack threads during preparation.
Depending on your computer's performance as well as a few other factors, the necessary delay between script execution times may range between 20ms and 200ms, you want to fine-tune this value to be as low as possible while also avoiding your scripts finishing out of order. Anything lower than 20ms will not work due to javascript limitations.

View File

@@ -1,19 +0,0 @@
.. _gameplay_intelligence:
Intelligence
============
Intelligence is a :ref:`stat <gameplay_stats>` that is unlocked by having
:ref:`Source-File 5 <gameplay_sourcefiles>` (i.e. Destroying BitNode-5).
Intelligence is unique because it is permanent and persistent. It never gets reset
back to 1. However, gaining Intelligence experience is extremely slow. It is a stat
that gradually builds up as you continue to play the game.
Intelligence will boost your production for many actions in the game, including:
* Hacking
* Infiltration
* Crime success rate
* Bladeburner
* Reputation gain for companies & factions
* Augmentation grafting speed

View File

@@ -1,94 +0,0 @@
.. _gameplay_sleeves:
Sleeves
=======
When VitaLife unveiled their Persona Core technology that allowed people to digitize
and transfer their consciousness into other vessels, human bodies became nothing more
than 'sleeves' for the human consciousness. This technology thus became known as
"Sleeve technology".
Sleeve technology unlocks two different gameplay features:
* Duplicate Sleeves
* Grafting
Sleeve technology is unlocked in :ref:`BitNode-10 <gameplay_bitnodes>`.
.. _gameplay_duplicatesleeves:
Duplicate Sleeves
^^^^^^^^^^^^^^^^^
Duplicate Sleeves are MK-V Synthoids (synthetic androids) into which your consciousness
has been copied. In other words, these Synthoids contain a perfect duplicate of your mind.
Duplicate Sleeves are essentially clones which you can use to perform work-type actions,
such as working for a company/faction or committing a crime. When sleeves perform these tasks,
they will earn money, experience, and reputation.
Sleeves are their own individuals, which means they each have their own experience and stats.
When a sleeve earns experience, it earns experience for itself, the player's
original consciousness, as well as all of the player's other sleeves.
Duplicate Sleeves are **not** reset when installing Augmentations, but they are reset
when switching BitNodes.
Obtaining Duplicate Sleeves
~~~~~~~~~~~~~~~~~~~~~~~~~~~
There are two methods of obtaining Duplicate Sleeves:
1. Destroy BitNode-10. Each completion gives you one additional Duplicate Sleeve.
2. Purchase Duplicate Sleeves from :ref:`the faction The Covenant <gameplay_factions>`.
This is only available in BitNode-10. Sleeves purchased this way are **permanent** (they persist
through BitNodes). You can purchase up to 5 Duplicate Sleeves from The Covenant.
Synchronization
~~~~~~~~~~~~~~~
Synchronization is a measure of how aligned your consciousness is with that of your
Duplicate Sleeves. It is a numerical value between 1 and 100, and it affects how much experience
is earned when the sleeve is performing a task.
Synchronization can be increased by assigning sleeves to the 'Synchronize' task.
Sleeve Shock
~~~~~~~~~~~~
Sleeve shock is a measure of how much trauma the sleeve has due to being placed in a new
body. It is a numerical value between 0 and 99, where 99 indicates full shock and 0 indicates
no shock. Shock affects the amount of experience earned by the sleeve.
Sleeve shock slowly decreases over time. You can further increase the rate at which
it decreases by assigning sleeves to the 'Shock Recovery' task.
Let X be the sleeve's shock and Y be the sleeve's synchronization. When the sleeve earns experience by performing
a task, the sleeve gains X% of the amount of experience normally earned by the task. players original host consciousness and all of the player's other sleeves
earn Y% of the experience that the sleeve gained, or X*Y % of the normal experience amount.
Augmentations
~~~~~~~~~~~~~
You can purchase :ref:`Augmentations <gameplay_augmentations>` for your Duplicate
Sleeves. In order to do this, the sleeve's shock must be at 0. Any Augmentation
that is currently available to you through a faction is also available for your
Duplicate Sleeves. There are a few Augmentations, such as NeuroFlux Governor and
Bladeburner-specific ones, that cannot be purchased for a Duplicate Sleeve.
When you purchase an Augmentation for a Duplicate Sleeve, it is instantly installed.
When this happens, the sleeve's stats are instantly reset back to 0, similar to
when you normally install Augmentations.
The cost of purchasing an Augmentation for a Duplicate Sleeve is **not** affected
by how many Augmentations you have purchased for yourself, and vice versa.
Memory
~~~~~~
Sleeve memory dictates what a sleeve's synchronization will be when it is reset by
switching BitNodes. For example, if a sleeve has a memory of 10, then when you
switch BitNodes its synchronization will initially be set to 10, rather than 1.
Memory can only be increased by purchasing upgrades from The Covenant. Just like
the ability to purchase additional sleeves, this is only available in BitNode-10.
Memory is a persistent stat, meaning it never gets reset back to 1.
The maximum possible value for a sleeve's memory is 100.
Buying memory has no instant affect on synchronization,
memory affects only the starting synchronization upon entering a BitNode.

View File

@@ -1,62 +0,0 @@
.. _gameplay_sourcefiles:
.. warning:: This page contains spoilers for the game
Source-Files
============
Source-Files are a type of persistent upgrade that is more powerful than Augmentations.
Source-Files are received by :ref:`destroying a BitNode <gameplay_bitnodes_howtodestroy>`. There are many different BitNodes
in the game and each BitNode will grant a different Source-File when it is destroyed.
A Source-File can be upgraded by destroying its corresponding BitNode a second or
third time (AKA playing through that BitNode again). It can be upgraded to a maximum
of level 3, with the exception of source-file 12, which has no hard limit.
List of all Source-Files
^^^^^^^^^^^^^^^^^^^^^^^^
+-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| BitNode-1: Source Genesis | * Let the player start with 32 GB of RAM on the home computer. |
| | * Increases all of the player's multipliers by 16%/24%/28%. |
+-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| BitNode-2: Rise of the Underworld | * Let the player create Gangs in other BitNodes (although some BitNodes will disable this mechanic). |
| | * Increases the player's crime success rate, crime money, and charisma multipliers by 24%/36%/42%. |
+-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| BitNode-3: Corporatocracy | * Let the player create Corporations in other BitNodes (although some BitNodes will disable this mechanic). |
| | * Increases the player's charisma and company salary multipliers by 8%/12%/14%. |
+-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| BitNode-4: The Singularity | * Let the player access and use Netscript Singularity Functions in other BitNodes. |
| | * Each level of this Source-File reduces the RAM cost of singularity functions. |
+-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| BitNode-5: Artificial Intelligence | * Unlocks :ref:`gameplay_intelligence`. |
| | * Unlocks :js:func:`getBitNodeMultipliers` and grants permanent access to Formulas.exe. |
| | * Increases all of the player's hacking-related multipliers by 8%/12%/14%. |
+-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| BitNode-6: Bladeburners | * Unlocks the Bladeburner feature in other BitNodes. |
| | * Increases all of the player's level and experience gain rate multipliers for combat stats by 8%/12%/14%. |
+-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| BitNode-7: Bladeburners 2079 | * Allows the player to access the `Bladeburner API <https://github.com/bitburner-official/bitburner-src/blob/dev/markdown/bitburner.bladeburner.md>`_ in other BitNodes. |
| | * Increases all of the player's Bladeburner multipliers by 8%/12%/14%. |
+-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| BitNode-8: Ghost of Wall Street | * Increases the player's hacking growth multiplier by 12%/18%/21%. |
| | * Level 1 grants permanent access to :ref:`WSE <gameplay_stock_market>` and the `TIX <https://github.com/bitburner-official/bitburner-src/blob/dev/markdown/bitburner.tix.md>`_ API. |
| | * Level 2 grants permanent access to shorting stocks. |
| | * Level 3 grants permanent access to use limit/stop orders. |
+-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| BitNode-9: Hacktocracy | * Level 1 permanently unlocks the Hacknet Server in other BitNodes. |
| | * Level 2 lets the player start with 128 GB of RAM on the home computer. |
| | * Level 3 grants a highly-upgraded Hacknet Server when entering a new BitNode (it will be lost after installing augments). |
+-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| BitNode-10: Digital Carbon | * Each level of this grants a Duplicate Sleeve. |
| | * Allows the player to access the `Sleeve API <https://github.com/bitburner-official/bitburner-src/blob/dev/markdown/bitburner.sleeve.md>`_ in other BitNodes. |
| | * Grants the player access to the VitaLife secret laboratory in other BitNodes. Also grants access to the Grafting API. |
+-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| BitNode-11: The Big Crash | * Company favor increases both the player's salary and reputation gain at that company by 1% per favor (rather than just the reputation gain). |
| | * Increases the player's company salary and reputation gain multipliers by 32%/48%/56%. |
| | * This Source-File reduces the price increase for every aug bought by 4%/5%/7%. |
+-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| BitNode-12: The Recursion | * There is no maximum level for this Source-File. |
| | * Let the player start with Neuroflux Governor equal to the level of this Source-File. |
+-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| BitNode-13: They're lunatics | * This Source-File lets the Church of the Machine God appear in other BitNodes. |
| | * Each level of this Source-File increases the size of Stanek's Gift. |
+-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+

View File

@@ -1,22 +0,0 @@
Basic Gameplay
==============
This section documents Bitburner gameplay elements that are immediately
available and/or accessible to the player.
.. toctree::
:maxdepth: 5
:caption: Elements:
Stats <basicgameplay/stats>
Terminal <basicgameplay/terminal>
Servers <basicgameplay/servers>
Hacking <basicgameplay/hacking>
Scripts <basicgameplay/scripts>
World <basicgameplay/world>
Factions <basicgameplay/factions>
Augmentations <basicgameplay/augmentations>
Companies <basicgameplay/companies>
Crimes <basicgameplay/crimes>
Infiltration <basicgameplay/infiltration>
Stock Market <basicgameplay/stockmarket>
Coding Contracts <basicgameplay/codingcontracts>

View File

@@ -1,82 +0,0 @@
.. _gameplay_augmentations:
Augmentations
=============
Advances in science and medicine have led to powerful new technologies
that allow people to augment themselves beyond normal human capabilities.
There are many different types of Augmentations, ranging from cybernetic
to genetic to biological. Acquiring these Augmentations enhances the
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
the 'Character' page (:ref:`keyboard shortcut <shortcuts>` Alt + c).
How to acquire Augmentations
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Because of how powerful Augmentations are, the technology behind them
is kept private and secret by the corporations and organizations that
create them. Therefore, the only way for the player to obtain
Augmentations is through Factions. After joining a Faction and earning
enough reputation in it, you will be able to purchase its Augmentations.
Different Factions offer different Augmentations. Augmentations must be
purchased in order to be installed, and they are fairly expensive.
.. _gameplay_augmentations_installing:
Installing Augmentations
^^^^^^^^^^^^^^^^^^^^^^^^
You will not gain the benefits of your purchased Augmentations until you
actually install them. You can choose to install Augmentations through
the 'Augmentations' menu tab (Found under 'Character'. Alternatively,
use the keyboard shortcut Alt + a).
Unfortunately, installing Augmentations has side effects. You will lose
most of the progress you've made, including your skills, stats, and
money. You will have to start over, but you will have all of the
Augmentations you have installed to help you progress. This is the
game's "soft reset" or "prestige" mechanic.
To summarize, here is a list of everything you will LOSE when you install
an Augmentation:
* Stats/Skills
* Money
* Scripts on all servers EXCEPT your home computer
* Purchased servers
* Hacknet Nodes
* Company/faction reputation
* Jobs and Faction memberships
* Programs
* Stocks
* TOR router
Here is everything you will KEEP when you install an Augmentation:
* Every Augmentation you have installed
* Scripts on your home computer
* RAM/Core Upgrades on your home computer
* World Stock Exchange account and TIX API Access
* Previously installed Augmentations
.. _gameplay_augmentations_purchasingmultiple:
Purchasing Multiple Augmentations
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
You do not have to install an Augmentation right after you purchase it.
You can purchase as many Augmentations as you'd like before you choose to
install them. When you install your purchased Augmentations they will ALL
get installed.
There are a few drawbacks to this, however. First, obviously, you won't
gain the benefits of your purchased Augmentations until after you install
them. Second, purchasing multiple Augmentations before installing them
will cause the Augmentations to get progressively more expensive. When
you purchase an Augmentation, the price of purchasing another Augmentation
doubles. This multiplier stacks for each Augmentation you
purchase. Once you install your purchased Augmentations, their costs
are reset back to the original prices. You can only purchase each augmentation
once, with the exception of NeuroFlux Governor, which can be purchased infinitely
at increasing cost.

View File

@@ -1,417 +0,0 @@
.. _codingcontracts:
Coding Contracts
================
Coding Contracts are a mechanic that lets players earn rewards in
exchange for solving programming problems.
Coding Contracts are files with the ".cct" extensions. They can
be accessed through the :ref:`terminal` or through scripts using
the `Coding Contract API <https://github.com/bitburner-official/bitburner-src/blob/dev/markdown/bitburner.codingcontract.md>`_
Each contract has a limited number of attempts. If you
provide the wrong answer too many times and exceed the
number of attempts, the contract will self destruct (delete itself)
Currently, Coding Contracts are randomly generated and
spawned over time. They can appear on any server (including your
home computer), except for your purchased servers.
Running in Terminal
^^^^^^^^^^^^^^^^^^^
To run a Coding Contract in the Terminal, simply use the
:ref:`run_terminal_command` command::
$ run some-contract.cct
Doing this will bring up a popup. The popup will display
the contract's problem, the number of attempts remaining, and
an area to provide an answer.
Interacting through Scripts
^^^^^^^^^^^^^^^^^^^^^^^^^^^
See the `Coding Contract API <https://github.com/bitburner-official/bitburner-src/blob/dev/markdown/bitburner.codingcontract.md>`_.
Interacting with Coding Contracts via the Terminal can be tedious the more
contracts you solve. Consider using the API to automate various aspects of
your solution. For example, some contracts have long solutions while others
have even longer solutions. You might want to use the API to automate the
process of submitting your solution rather than copy and paste a long
solution into an answer box.
However, using the API comes at a cost. Like most functions in other APIs,
each function in the Coding Contract API has a RAM cost. Depending on which
function you use, the initial RAM on your home server might not be enough
to allow you to use various API functions. Plan on upgrading the RAM on your
home server if you want to use the Coding Contract API.
Submitting Solutions
^^^^^^^^^^^^^^^^^^^^
Different contract problem types will require different types of
solutions. Some may be numbers, others may be strings or arrays.
If a contract asks for a specific solution format, then
use that. Otherwise, follow these rules when submitting solutions:
* String-type solutions should **not** have quotation marks surrounding
the string (unless specifically asked for). Only quotation
marks that are part of the actual string solution should be included.
* Array-type solutions should be submitted with each element
in the array separated by commas. Brackets are optional. For example,
both of the following are valid solution formats::
1,2,3
[1,2,3]
However, if the solution is a multidimensional array, then
all arrays that are not the outer-most array DO require the brackets.
For example, an array of arrays can be submitted as one of the following::
[1,2],[3,4]
[[1,2],[3,4]]
* Numeric solutions should be submitted normally, as expected
Rewards
^^^^^^^
There are currently four possible rewards for solving a Coding Contract:
* Faction Reputation for a specific Faction
* Faction Reputation for all Factions that you are a member of
* Company reputation for a specific Company
* Money
The 'amount' of reward varies based on the difficulty of the problem
posed by the Coding Contract. There is no way to know what a
Coding Contract's exact reward will be until it is solved.
Notes
^^^^^
* The *scp* Terminal command does not work on Coding Contracts
List of all Problem Types
^^^^^^^^^^^^^^^^^^^^^^^^^
The following is a list of all of the problem types that a Coding Contract can contain.
The list contains the name of (i.e. the value returned by
:js:func:`getContractType`) and a brief summary of the problem it poses.
+-----------------------------------------+------------------------------------------------------------------------------------------+
| Name | Problem Summary |
+=========================================+==========================================================================================+
| Find Largest Prime Factor | | Given a number, find its largest prime factor. A prime factor |
| | | is a factor that is a prime number. |
+-----------------------------------------+------------------------------------------------------------------------------------------+
| Subarray with Maximum Sum | | Given an array of integers, find the contiguous subarray (containing |
| | | at least one number) which has the largest sum and return that sum. |
+-----------------------------------------+------------------------------------------------------------------------------------------+
| Total Ways to Sum | | Given a number, how many different distinct ways can that number be written as |
| | | a sum of at least two positive integers? |
+-----------------------------------------+------------------------------------------------------------------------------------------+
| Total Ways to Sum II | | You are given an array with two elements. The first element is an integer n. |
| | | The second element is an array of numbers representing the set of available integers. |
| | | How many different distinct ways can that number n be written as |
| | | a sum of integers contained in the given set? |
| | | You may use each integer in the set zero or more times. |
+-----------------------------------------+------------------------------------------------------------------------------------------+
| Spiralize Matrix | | Given an array of array of numbers representing a 2D matrix, return the |
| | | elements of that matrix in clockwise spiral order. |
| | | |
| | | Example: The spiral order of |
| | | |
| | | [1, 2, 3, 4] |
| | | [5, 6, 7, 8] |
| | | [9, 10, 11, 12] |
| | | |
| | | is [1, 2, 3, 4, 8, 12, 11, 10, 9, 5, 6, 7] |
+-----------------------------------------+------------------------------------------------------------------------------------------+
| Array Jumping Game | | You are given an array of integers where each element represents the |
| | | maximum possible jump distance from that position. For example, if you |
| | | are at position i and your maximum jump length is n, then you can jump |
| | | to any position from i to i+n. |
| | | |
| | | Assuming you are initially positioned at the start of the array, determine |
| | | whether you are able to reach the last index of the array. |
+-----------------------------------------+------------------------------------------------------------------------------------------+
| Array Jumping Game II | | You are given an array of integers where each element represents the |
| | | maximum possible jump distance from that position. For example, if you |
| | | are at position i and your maximum jump length is n, then you can jump |
| | | to any position from i to i+n. |
| | | |
| | | Assuming you are initially positioned at the start of the array, determine |
| | | the minimum number of jumps to reach the end of the array. |
| | | |
| | | If it's impossible to reach the end, then the answer should be 0. |
+-----------------------------------------+------------------------------------------------------------------------------------------+
| Merge Overlapping Intervals | | Given an array of intervals, merge all overlapping intervals. An interval |
| | | is an array with two numbers, where the first number is always less than |
| | | the second (e.g. [1, 5]). |
| | | |
| | | The intervals must be returned in ASCENDING order. |
| | | |
| | | Example: |
| | | [[1, 3], [8, 10], [2, 6], [10, 16]] |
| | | merges into [[1, 6], [8, 16]] |
+-----------------------------------------+------------------------------------------------------------------------------------------+
| Generate IP Addresses | | Given a string containing only digits, return an array with all possible |
| | | valid IP address combinations that can be created from the string. |
| | | |
| | | An octet in the IP address cannot begin with '0' unless the number itself |
| | | is actually 0. For example, "192.168.010.1" is NOT a valid IP. |
| | | |
| | | Examples: |
| | | 25525511135 -> [255.255.11.135, 255.255.111.35] |
| | | 1938718066 -> [193.87.180.66] |
+-----------------------------------------+------------------------------------------------------------------------------------------+
| Algorithmic Stock Trader I | | You are given an array of numbers representing stock prices, where the |
| | | i-th element represents the stock price on day i. |
| | | |
| | | Determine the maximum possible profit you can earn using at most one |
| | | transaction (i.e. you can buy an sell the stock once). If no profit |
| | | can be made, then the answer should be 0. Note that you must buy the stock |
| | | before you can sell it. |
+-----------------------------------------+------------------------------------------------------------------------------------------+
| Algorithmic Stock Trader II | | You are given an array of numbers representing stock prices, where the |
| | | i-th element represents the stock price on day i. |
| | | |
| | | Determine the maximum possible profit you can earn using as many transactions |
| | | as you'd like. A transaction is defined as buying and then selling one |
| | | share of the stock. Note that you cannot engage in multiple transactions at |
| | | once. In other words, you must sell the stock before you buy it again. If no |
| | | profit can be made, then the answer should be 0. |
+-----------------------------------------+------------------------------------------------------------------------------------------+
| Algorithmic Stock Trader III | | You are given an array of numbers representing stock prices, where the |
| | | i-th element represents the stock price on day i. |
| | | |
| | | Determine the maximum possible profit you can earn using at most two |
| | | transactions. A transaction is defined as buying and then selling one share |
| | | of the stock. Note that you cannot engage in multiple transactions at once. |
| | | In other words, you must sell the stock before you buy it again. If no profit |
| | | can be made, then the answer should be 0. |
+-----------------------------------------+------------------------------------------------------------------------------------------+
| Algorithmic Stock Trader IV | | You are given an array with two elements. The first element is an integer k. |
| | | The second element is an array of numbers representing stock prices, where the |
| | | i-th element represents the stock price on day i. |
| | | |
| | | Determine the maximum possible profit you can earn using at most k transactions. |
| | | A transaction is defined as buying and then selling one share of the stock. |
| | | Note that you cannot engage in multiple transactions at once. In other words, |
| | | you must sell the stock before you can buy it. If no profit can be made, then |
| | | the answer should be 0. |
+-----------------------------------------+------------------------------------------------------------------------------------------+
| Minimum Path Sum in a Triangle | | You are given a 2D array of numbers (array of array of numbers) that represents a |
| | | triangle (the first array has one element, and each array has one more element than |
| | | the one before it, forming a triangle). Find the minimum path sum from the top to the |
| | | bottom of the triangle. In each step of the path, you may only move to adjacent |
| | | numbers in the row below. |
+-----------------------------------------+------------------------------------------------------------------------------------------+
| Unique Paths in a Grid I | | You are given an array with two numbers: [m, n]. These numbers represent a |
| | | m x n grid. Assume you are initially positioned in the top-left corner of that |
| | | grid and that you are trying to reach the bottom-right corner. On each step, |
| | | you may only move down or to the right. |
| | | |
| | | |
| | | Determine how many unique paths there are from start to finish. |
+-----------------------------------------+------------------------------------------------------------------------------------------+
| Unique Paths in a Grid II | | You are given a 2D array of numbers (array of array of numbers) representing |
| | | a grid. The 2D array contains 1's and 0's, where 1 represents an obstacle and |
| | | |
| | | 0 represents a free space. |
| | | |
| | | Assume you are initially positioned in top-left corner of that grid and that you |
| | | are trying to reach the bottom-right corner. In each step, you may only move down |
| | | or to the right. Furthermore, you cannot move onto spaces which have obstacles. |
| | | |
| | | Determine how many unique paths there are from start to finish. |
+-----------------------------------------+------------------------------------------------------------------------------------------+
| Shortest Path in a Grid | | You are given a 2D array of numbers (array of array of numbers) representing |
| | | a grid. The 2D array contains 1's and 0's, where 1 represents an obstacle and |
| | | 0 represents a free space. |
| | | |
| | | Assume you are initially positioned in top-left corner of that grid and that you |
| | | are trying to reach the bottom-right corner. In each step, you may move to the up, |
| | | down, left or right. Furthermore, you cannot move onto spaces which have obstacles. |
| | | |
| | | Determine if paths exist from start to destination, and find the shortest one. |
| | | |
| | | Examples: |
| | | [[0,1,0,0,0], |
| | | [0,0,0,1,0]] -> "DRRURRD" |
| | | [[0,1], |
| | | [1,0]] -> "" |
| | | |
+-----------------------------------------+------------------------------------------------------------------------------------------+
| Sanitize Parentheses in Expression | | Given a string with parentheses and letters, remove the minimum number of invalid |
| | | parentheses in order to validate the string. If there are multiple minimal ways |
| | | to validate the string, provide all of the possible results. |
| | | |
| | | The answer should be provided as an array of strings. If it is impossible to validate |
| | | the string, the result should be an array with only an empty string. |
| | | |
| | | Examples: |
| | | ()())() -> [()()(), (())()] |
| | | (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 |
| | | of digits such that it evaluates to the target number. |
| | | |
| | | The answer should be provided as an array of strings containing the valid expressions. |
| | | |
| | | NOTE: Numbers in an expression cannot have leading 0's |
| | | NOTE: The order of evaluation expects script operator precedence |
| | | |
| | | Examples: |
| | | Input: digits = "123", target = 6 |
| | | Output: [1+2+3, 1*2*3] |
| | | |
| | | Input: digits = "105", target = 5 |
| | | Output: [1*0+5, 10-5] |
+-----------------------------------------+------------------------------------------------------------------------------------------+
| HammingCodes: Integer to Encoded Binary | | You are given a decimal value. |
| | | Convert it into a binary string and encode it as a 'Hamming-Code'. eg: |
| | | Value 8 will result into binary '1000', which will be encoded |
| | | with the pattern 'pppdpddd', where p is a paritybit and d a databit. The encoding of |
| | | 8 is 11110000. As another example, '10101' (Value 21) will result into (pppdpdddpd) |
| | | '1001101011'. |
| | | NOTE: You need an parity Bit on Index 0 as an 'overall'-paritybit. |
| | | NOTE 2: You should watch the HammingCode-video from 3Blue1Brown, which |
| | | explains the 'rule' of encoding, |
| | | including the first Index parity-bit mentioned on the first note. |
| | | Now the only one rule for this encoding: |
| | | It's not allowed to add additional leading '0's to the binary value |
| | | That means, the binary value has to be encoded as it is |
+-----------------------------------------+------------------------------------------------------------------------------------------+
| HammingCodes: Encoded Binary to Integer | | You are given an encoded binary string. |
| | | Treat it as a Hammingcode with 1 'possible' error on an random Index. |
| | | Find the 'possible' wrong bit, fix it and extract the decimal value, which is |
| | | hidden inside the string.\n\n", |
| | | Note: The length of the binary string is dynamic, but its encoding/decoding is |
| | | following Hammings 'rule'\n", |
| | | Note 2: Index 0 is an 'overall' parity bit. Watch the Hammingcode-video from |
| | | 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", |
+-----------------------------------------+------------------------------------------------------------------------------------------+
| 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. |
| | | |
| | | The first element of the data represents the number of vertices in the graph. Each |
| | | vertex is a unique number between 0 and ${data[0] - 1}. The next element of the data |
| | | represents the edges of the graph. |
| | | |
| | | Two vertices u,v in a graph are said to be adjacent if there exists an edge [u,v]. |
| | | Note that an edge [u,v] is the same as an edge [v,u], as order does not matter. |
| | | |
| | | You must construct a 2-coloring of the graph, meaning that you have to assign each |
| | | vertex in the graph a "color", either 0 or 1, such that no two adjacent vertices have |
| | | the same color. Submit your answer in the form of an array, where element i |
| | | represents the color of vertex i. If it is impossible to construct a 2-coloring of |
| | | the given graph, instead submit an empty array. |
| | | |
| | | Examples: |
| | | |
| | | Input: [4, [[0, 2], [0, 3], [1, 2], [1, 3]]] |
| | | Output: [0, 0, 1, 1] |
| | | |
| | | Input: [3, [[0, 1], [0, 2], [1, 2]]] |
| | | Output: [] |
+-----------------------------------------+------------------------------------------------------------------------------------------+
| Compression I: RLE Compression | | Run-length encoding (RLE) is a data compression technique which encodes data as a |
| | | series of runs of a repeated single character. Runs are encoded as a length, followed |
| | | by the character itself. Lengths are encoded as a single ASCII digit; runs of 10 |
| | | characters or more are encoded by splitting them into multiple runs. |
| | | |
| | | You are given a string as input. Encode it using run-length encoding with the minimum |
| | | possible output length. |
| | | |
| | | Examples: |
| | | aaaaabccc -> 5a1b3c |
| | | aAaAaA -> 1a1A1a1A1a1A |
| | | 111112333 -> 511233 |
| | | zzzzzzzzzzzzzzzzzzz -> 9z9z1z (or 9z8z2z, etc.) |
+-----------------------------------------+------------------------------------------------------------------------------------------+
| Compression II: LZ Decompression | | Lempel-Ziv (LZ) compression is a data compression technique which encodes data using |
| | | references to earlier parts of the data. In this variant of LZ, data is encoded in two |
| | | types of chunk. Each chunk begins with a length L, encoded as a single ASCII digit |
| | | from 1 - 9, followed by the chunk data, which is either: |
| | | |
| | | 1. Exactly L characters, which are to be copied directly into the uncompressed data. |
| | | 2. A reference to an earlier part of the uncompressed data. To do this, the length |
| | | is followed by a second ASCII digit X: each of the L output characters is a copy |
| | | of the character X places before it in the uncompressed data. |
| | | |
| | | For both chunk types, a length of 0 instead means the chunk ends immediately, and the |
| | | next character is the start of a new chunk. The two chunk types alternate, starting |
| | | with type 1, and the final chunk may be of either type. |
| | | |
| | | You are given an LZ-encoded string. Decode it and output the original string. |
| | | |
| | | Example: decoding '5aaabb450723abb' chunk-by-chunk |
| | | 5aaabb -> aaabb |
| | | 5aaabb45 -> aaabbaaab |
| | | 5aaabb450 -> aaabbaaab |
| | | 5aaabb45072 -> aaabbaaababababa |
| | | 5aaabb450723abb -> aaabbaaababababaabb |
+-----------------------------------------+------------------------------------------------------------------------------------------+
| Compression III: LZ Compression | | Lempel-Ziv (LZ) compression is a data compression technique which encodes data using |
| | | references to earlier parts of the data. In this variant of LZ, data is encoded in two |
| | | types of chunk. Each chunk begins with a length L, encoded as a single ASCII digit |
| | | from 1 - 9, followed by the chunk data, which is either: |
| | | |
| | | 1. Exactly L characters, which are to be copied directly into the uncompressed data. |
| | | 2. A reference to an earlier part of the uncompressed data. To do this, the length |
| | | is followed by a second ASCII digit X: each of the L output characters is a copy |
| | | of the character X places before it in the uncompressed data. |
| | | |
| | | For both chunk types, a length of 0 instead means the chunk ends immediately, and the |
| | | next character is the start of a new chunk. The two chunk types alternate, starting |
| | | with type 1, and the final chunk may be of either type. |
| | | |
| | | You are given a string as input. Encode it using Lempel-Ziv encoding with the minimum |
| | | possible output length. |
| | | |
| | | Examples (some have other possible encodings of minimal length): |
| | | abracadabra -> 7abracad47 |
| | | mississippi -> 4miss433ppi |
| | | aAAaAAaAaAA -> 3aAA53035 |
| | | 2718281828 -> 627182844 |
| | | abcdefghijk -> 9abcdefghi02jk |
| | | aaaaaaaaaaaa -> 3aaa91 |
| | | aaaaaaaaaaaaa -> 1a91031 |
| | | aaaaaaaaaaaaaa -> 1a91041 |
+-----------------------------------------+------------------------------------------------------------------------------------------+
| Encryption I: Caesar Cipher | | Caesar cipher is one of the simplest encryption technique. It is a type of |
| | | substitution cipher in which each letter in the plaintext is replaced by a letter some |
| | | fixed number of positions down the alphabet. For example, with a left shift of 3, D |
| | | would be replaced by A, E would become B, and A would become X (because of rotation). |
| | | You are given an array with two elements. The first element is the plaintext, the |
| | | second element is the left shift value. Return the ciphertext as uppercase string. |
| | | Spaces remains the same. |
+-----------------------------------------+------------------------------------------------------------------------------------------+
| Encryption II: Vigenère Cipher | | Vigenère cipher is a type of polyalphabetic substitution. It uses the Vigenère square |
| | | to encrypt and decrypt plaintext with a keyword. |
| | | Vignenère square: |
| | | A B C D E F G H I J K L M N O P Q R S T U V W X Y Z |
| | | +---------------------------------------------------- |
| | | A | A B C D E F G H I J K L M N O P Q R S T U V W X Y Z |
| | | B | B C D E F G H I J K L M N O P Q R S T U V W X Y Z A |
| | | C | C D E F G H I J K L M N O P Q R S T U V W X Y Z A B |
| | | D | D E F G H I J K L M N O P Q R S T U V W X Y Z A B C |
| | | E | E F G H I J K L M N O P Q R S T U V W X Y Z A B C D |
| | | ... |
| | | Y | Y Z A B C D E F G H I J K L M N O P Q R S T U V W X |
| | | Z | Z A B C D E F G H I J K L M N O P Q R S T U V W X Y |
| | | For encryption each letter of the plaintext is paired with the corresponding letter of |
| | | a repeating keyword. For example, the plaintext DASHBOARD is encrypted with the |
| | | keyword LINUX: |
| | | Plaintext: DASHBOARD |
| | | Keyword: LINUXLINU |
| | | So, the first letter D is paired with the first letter of the key L. Therefore, row D |
| | | and column L of the Vigenère square are used to get the first cipher letter O. This |
| | | must be repeated for the whole ciphertext. |
| | | You are given an array with two elements. The first element is the plaintext, the |
| | | second element is the keyword. Return the ciphertext as uppercase string. |
+-----------------------------------------+------------------------------------------------------------------------------------------+

View File

@@ -1,17 +0,0 @@
.. _gameplay_companies:
Companies
=========
When exploring the :ref:`world <gameplay_world>`, you can visit various companies. At
these companies, you can apply for jobs.
Working a job lets you earn money, experience, and reputation with that company.
While working for a company, you can click "Do something else simultaneously" to be able
to do things while you continue to work 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 work.
If you've been hired to do a job you can click that "Apply for X Job" button again to get a
promotion if you meet the requirements. You can see the requirements by hovering your cursor
over the button. Higher positions give increased rewards.

View File

@@ -1,58 +0,0 @@
.. _gameplay_crimes:
Crimes
======
Commiting 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.
Basic Mechanics
^^^^^^^^^^^^^^^
When you visit the 'Slums' you will see a list of buttons that show all of the
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”
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.
Crimes are not always successful. Your rate of success is determined by your
stats (and Augmentation multipliers) and can be seen on the crime-selection
page. If you are unsuccessful at committing a crime you will gain EXP,
but you will not earn money. If you are successful at committing the crime
you will gain extra EXP (4x of what an unsuccessful attempt would give)
and earn money.
Harder crimes are typically more profitable, and also give more EXP.
Crime details
^^^^^^^^^^^^^
Available crimes, and their descriptions, which all begin with "attempt to..."
Shoplift …shoplift from a low-end retailer
Rob store …commit armed robbery on a high-end store
Mug someone …mug a random person on the street
Larceny …rob property from someone's house
Deal Drugs …deal drugs
Bond Forgery …forge corporate bonds
Traffick illegal Arms …smuggle illegal arms into the city
Homicide …murder a random person on the street
Grand theft Auto …commit grand theft auto
Kidnap and Ransom …kidnap and ransom a high-profile-target
Assassinate …assassinate a high-profile target
Heist …pull off the ultimate heist

View File

@@ -1,255 +0,0 @@
.. _gameplay_factions:
Factions
========
.. warning:: This page contains spoilers regarding the game's story/plot-line.
Throughout the game you may receive invitations from factions. There are
many different factions, and each faction has different criteria for
determining its potential members. Joining a faction and furthering
its cause is crucial to progressing in the game and unlocking endgame
content.
It is possible to join multiple factions if you receive invitations from
them. However, note that joining a faction may prevent you from joining
other rival factions. (Don't worry, this usually isn't the case. Also,
it would only be temporary since resetting the game by installing
:ref:`gameplay_augmentations` will clear all your factions)
The 'Factions' link on the menu brings up a list of all factions that
you have joined. You can select a Faction on this list to go to that
Faction page. This page displays general information about the Faction
and also lets you perform work for the faction. Working for a Faction
is similar to working for a company except that you don't get paid a
salary. You will only earn reputation in your Faction and train your
stats. Also, cancelling work early when working for a Faction does
**not** result in reduced reputation earnings.
Earning reputation for a Faction unlocks powerful Augmentations.
Purchasing and installing these Augmentations will upgrade your
abilities. The Augmentations that are available to unlock vary
from faction to faction.
List of Factions and their Requirements
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. raw:: html
<details><summary><a>Early Game Factions</a></summary>
.. _gameplay_factions::
+---------------------+--------------------+-----------------------------------------+-------------------------------+
| Early Game | Faction Name | Requirements | Joining this Faction prevents |
| Factions | | | you from joining: |
+ +--------------------+-----------------------------------------+-------------------------------+
| | CyberSec | * Install a backdoor on the CSEC server | |
+ +--------------------+-----------------------------------------+-------------------------------+
| | Tian Di Hui | * $1m | |
| | | * Hacking Level 50 | |
| | | * Be in Chongqing, New Tokyo, or Ishima | |
+ +--------------------+-----------------------------------------+-------------------------------+
| | Netburners | * Hacking Level 80 | |
| | | * Total Hacknet Levels of 100 | |
| | | * Total Hacknet RAM of 8 | |
| | | * Total Hacknet Cores of 4 | |
+ +--------------------+-----------------------------------------+-------------------------------+
| | Shadows of Anarchy | * Successfully infiltrate a company | |
+---------------------+--------------------+-----------------------------------------+-------------------------------+
.. raw:: html
</details>
<details><summary><a>City Factions</a></summary>
.. _gameplay_factions::
+---------------------+----------------+-----------------------------------------+-------------------------------+
| City Factions | Faction Name | Requirements | Joining this Faction prevents |
| | | | you from joining: |
+ +----------------+-----------------------------------------+-------------------------------+
| | Sector-12 | * Be in Sector-12 | * Chongqing |
| | | * $15m | * New Tokyo |
| | | | * Ishima |
| | | | * Volhaven |
+ +----------------+-----------------------------------------+-------------------------------+
| | Chongqing | * Be in Chongqing | * Sector-12 |
| | | * $20m | * Aevum |
| | | | * Volhaven |
+ +----------------+-----------------------------------------+-------------------------------+
| | New Tokyo | * Be in New Tokyo | * Sector-12 |
| | | * $20m | * Aevum |
| | | | * Volhaven |
+ +----------------+-----------------------------------------+-------------------------------+
| | Ishima | * Be in Ishima | * Sector-12 |
| | | * $30m | * Aevum |
| | | | * Volhaven |
+ +----------------+-----------------------------------------+-------------------------------+
| | Aevum | * Be in Aevum | * Chongqing |
| | | * $40m | * New Tokyo |
| | | | * Ishima |
| | | | * Volhaven |
+ +----------------+-----------------------------------------+-------------------------------+
| | Volhaven | * Be in Volhaven | * Sector-12 |
| | | * $50m | * Aevum |
| | | | * Chongqing |
| | | | * New Tokyo |
| | | | * Ishima |
+---------------------+----------------+-----------------------------------------+-------------------------------+
.. raw:: html
</details>
<details><summary><a>Hacking Groups</a></summary>
.. _gameplay_factions::
+---------------------+----------------+-----------------------------------------+-------------------------------+
| Hacking | Faction Name | Requirements | Joining this Faction prevents |
| Groups | | | you from joining: |
+ +----------------+-----------------------------------------+-------------------------------+
| | NiteSec | * Install a backdoor on the avmnite-02h | |
| | | server | |
| | | | |
+ +----------------+-----------------------------------------+-------------------------------+
| | The Black Hand | * Install a backdoor on the I.I.I.I | |
| | | server | |
| | | | |
+ +----------------+-----------------------------------------+-------------------------------+
| | BitRunners | * Install a backdoor on the run4theh111z| |
| | | server | |
| | | | |
+---------------------+----------------+-----------------------------------------+-------------------------------+
.. raw:: html
</details>
<details><summary><a>Megacorporations</a></summary>
.. _gameplay_factions::
+---------------------+----------------+-----------------------------------------+-------------------------------+
| Megacorporations | Faction Name | Requirements | Joining this Faction prevents |
| | | | you from joining: |
+ +----------------+-----------------------------------------+-------------------------------+
| | ECorp | * Have 400k reputation with | |
| | | the Corporation | |
+ +----------------+-----------------------------------------+-------------------------------+
| | MegaCorp | * Have 400k reputation with | |
| | | the Corporation | |
+ +----------------+-----------------------------------------+-------------------------------+
| | KuaiGong | * Have 400k reputation with | |
| | International | the Corporation | |
+ +----------------+-----------------------------------------+-------------------------------+
| | Four Sigma | * Have 400k reputation with | |
| | | the Corporation | |
+ +----------------+-----------------------------------------+-------------------------------+
| | NWO | * Have 400k reputation with | |
| | | the Corporation | |
+ +----------------+-----------------------------------------+-------------------------------+
| | Blade | * Have 400k reputation with | |
| | Industries | the Corporation | |
+ +----------------+-----------------------------------------+-------------------------------+
| | OmniTek | * Have 400k reputation with | |
| | Incorporated | the Corporation | |
+ +----------------+-----------------------------------------+-------------------------------+
| | Bachman & | * Have 400k reputation with | |
| | Associates | the Corporation | |
+ +----------------+-----------------------------------------+-------------------------------+
| | Clarke | * Have 400k reputation with | |
| | Incorporated | the Corporation | |
+ +----------------+-----------------------------------------+-------------------------------+
| | Fulcrum Secret | * Have 400k reputation with | |
| | Technologies | the Corporation | |
| | | * Install a backdoor on the | |
| | | fulcrumassets server | |
+---------------------+----------------+-----------------------------------------+-------------------------------+
.. raw:: html
</details>
<details><summary><a>Criminal Organizations</a></summary>
.. _gameplay_factions::
+---------------------+----------------+-----------------------------------------+-------------------------------+
| Criminal | Faction Name | Requirements | Joining this Faction prevents |
| Organizations | | | you from joining: |
+ +----------------+-----------------------------------------+-------------------------------+
| | Slum Snakes | * All Combat Stats of 30 | |
| | | * -9 Karma | |
| | | * $1m | |
+ +----------------+-----------------------------------------+-------------------------------+
| | Tetrads | * Be in Chongqing, New Tokyo, or Ishima | |
| | | * All Combat Stats of 75 | |
| | | * -18 Karma | |
+ +----------------+-----------------------------------------+-------------------------------+
| | Silhouette | * CTO, CFO, or CEO of a company | |
| | | * $15m | |
| | | * -22 Karma | |
+ +----------------+-----------------------------------------+-------------------------------+
| | Speakers for | * Hacking Level 100 | |
| | the Dead | * All Combat Stats of 300 | |
| | | * 30 People Killed | |
| | | * -45 Karma | |
| | | * Not working for CIA or NSA | |
+ +----------------+-----------------------------------------+-------------------------------+
| | The Dark Army | * Hacking Level 300 | |
| | | * All Combat Stats of 300 | |
| | | * Be in Chongqing | |
| | | * 5 People Killed | |
| | | * -45 Karma | |
| | | * Not working for CIA or NSA | |
+ +----------------+-----------------------------------------+-------------------------------+
| | The Syndicate | * Hacking Level 200 | |
| | | * All Combat Stats of 200 | |
| | | * Be in Aevum or Sector-12 | |
| | | * $10m | |
| | | * -90 Karma | |
| | | * Not working for CIA or NSA | |
+---------------------+----------------+-----------------------------------------+-------------------------------+
.. raw:: html
</details>
<details><summary><a>Midgame Factions</a></summary>
.. _gameplay_factions::
+---------------------+----------------+-----------------------------------------+-------------------------------+
| Midgame | Faction Name | Requirements | Joining this Faction prevents |
| Factions | | | you from joining: |
+ +----------------+-----------------------------------------+-------------------------------+
| | The Covenant | * 20 Augmentations | |
| | | * $75b | |
| | | * Hacking Level of 850 | |
| | | * All Combat Stats of 850 | |
+ +----------------+-----------------------------------------+-------------------------------+
| | Daedalus | * 30 Augmentations | |
| | | * $100b | |
| | | * Hacking Level of 2500 OR All Combat | |
| | | Stats of 1500 | |
+ +----------------+-----------------------------------------+-------------------------------+
| | Illuminati | * 30 Augmentations | |
| | | * $150b | |
| | | * Hacking Level of 1500 | |
| | | * All Combat Stats of 1200 | |
+---------------------+----------------+-----------------------------------------+-------------------------------+
.. raw:: html
</details>
<details><summary><a>Endgame Factions</a></summary>
.. _gameplay_factions::
+---------------------+----------------+--------------------------------------------------------------+-------------------------------+
| Endgame | Faction Name | Requirements | Joining this Faction prevents |
| Factions | | | you from joining: |
+ +----------------+--------------------------------------------------------------+-------------------------------+
| | Bladeburners | * Join Bladeburner Division | |
| | | * Have 25 Rank | |
| | | * Be in BitNode 6 or 7 | |
| | | * or have Source-File 6 or 7 | |
+ +----------------+--------------------------------------------------------------+-------------------------------+
| | Church of the | * Have not installed any augmentations in the current BitNode| |
| | Machine God | * Be in BitNode 13 | |
| | | * or have Source-File 13 | |
+---------------------+----------------+--------------------------------------------------------------+-------------------------------+
.. raw:: html
</details><br>

View File

@@ -1,120 +0,0 @@
.. _gameplay_hacking:
Hacking
=======
In the year 2077, currency has become digital and decentralized.
People and corporations store their money on servers. By hacking
these servers, you can steal their money and gain experience.
Gaining Root Access
^^^^^^^^^^^^^^^^^^^
The first step to hacking a server is to gain root access to that server.
This can be done using the NUKE virus (NUKE.exe). You start the
game with a copy of the NUKE virus on your home computer. The
NUKE virus attacks the target server's open ports using buffer
overflow exploits. When successful, you are granted root
administrative access to the machine.
In order for the NUKE virus to succeed, the target server
needs to have enough open ports. Some servers have no
security and will not need any ports opened. Some will have very high
security and will need many ports opened. In order to open ports on
another server, you will need to run programs that attack the server
to open specific ports. These programs can be coded once your hacking
skill gets high enough, or they can be purchased if you can find a seller.
**There are two ways to execute port-opening programs and the NUKE virus:**
1. Connect to the target server through the :ref:`terminal` and use the
:ref:`run_terminal_command` Terminal command::
$ run [programName]
2. Use a :ref:`Netscript Function <netscriptfunctions>`:
* :js:func:`nuke`
* :js:func:`brutessh`
* :js:func:`ftpcrack`
* :js:func:`relaysmtp`
* :js:func:`httpworm`
* :js:func:`sqlinject`
**There are two ways to determine how many ports need to be opened
on a server in order to successfully NUKE it:**
1. Connect to that server through the :ref:`terminal` and use the
:ref:`analyze_terminal_command` command
2. Use the :js:func:`getServerNumPortsRequired` Netscript function
Once you have enough ports opened on a server and have ran the NUKE virus
to gain root access, you will be able to hack it.
.. _gameplay_hacking_generalhackingmechanics:
General Hacking Mechanics
^^^^^^^^^^^^^^^^^^^^^^^^^
When you execute the hack command, either manually through the terminal
or automatically through a script, you attempt to hack the server.
This action takes time. The more advanced a server's security is,
the more time it will take. Your hacking skill level also affects
the hacking time, with a higher hacking skill leading to shorter
hacking times. Also, running the hack command manually through terminal
is faster than hacking from a script.
Your attempt to hack a server will not always succeed. The chance you
have to successfully hack a server is also determined by the server's
security and your hacking skill level. Even if your hacking attempt
is unsuccessful, you will still gain experience points.
When you successfully hack a server. You steal a certain percentage
of that server's total money. This percentage is, once again, determined by the
server's security and your hacking skill level. The amount of money
on a server is not limitless. So, if you constantly hack a server
and deplete its money, then you will encounter diminishing returns
in your hacking (since you are only hacking a certain percentage).
You can increase the amount of money on a server using a script and
the :js:func:`grow` function in Netscript.
.. _gameplay_hacking_serversecurity:
Server Security
^^^^^^^^^^^^^^^
Each server has a security level, typically between 1 and 100.
A higher number means the server has stronger security. It is
possible for a server to have a security of level 100 or higher, in
which case hacking that server will become impossible (0% chance for
hack to succeed).
As mentioned above, a server's security level is an important factor
to consider when hacking. You can check a server's security level
using the :ref:`analyze_terminal_command` Terminal command. You can
also check a server's security in
a script, using the :js:func:`getServerSecurityLevel` Netscript
Function. See the Netscript documentation for more details.
Whenever a server is hacked manually or through a script, its security
level increases by a small amount. Calling the :js:func:`grow` function in a
script will also increase security level of the target server. These
actions will make it harder for you to hack the server, and decrease
the amount of money you can steal. You can lower a server's security
level in a script using the :js:func:`weaken` function in Netscript. See
the Netscript documentation for more details
A server has a minimum security level that is equal to one third of its
starting security, rounded to the nearest integer. To be more precise::
server.minSecurityLevel = Math.max(1, Math.round(server.startingSecurityLevel / 3))
This means that a server's security level will not fall below this
value if you are trying to weaken() it.
Backdoors
^^^^^^^^^
Servers that can be hacked can also have backdoors installed. These backdoors
will provide you with a benefit; the services may be cheaper, penalties may
be reduced or there may be other results. Honeypots exist and will let factions
know when you have succeeded at backdooring their system. Once you have a
backdoor installed, you can connect to that server directly.
When you visit a location in the city and see that the name is partially scrambled,
this indicates that you have backdoored the server related to the location.

View File

@@ -1,70 +0,0 @@
.. _gameplay_infiltration:
Infiltration
============
Infiltration is a gameplay mechanic that allows you to infiltrate a
company's facility to try and steal the company's classified secrets.
These secrets can be sold for money or for reputation with a faction.
Overview
^^^^^^^^
Many companies have facilities that you can attempt to infiltrate.
By infiltrating, you can steal classified company secrets and then sell
these for money or for faction reputation. To try and infiltrate a company,
visit a company through the 'World' menu. There will be an option that
says 'Infiltrate Company'.
When infiltrating a company you will be presented with short active challenges.
None of the challenges use the mouse.
The difficulty at the top lowers with better combat stats and charisma. It is not recommended
to attempt infiltrations above mid-normal.
The "maximum level" is the number of challenges you will need to pass to receive
the infiltration reward.
Every time you fail an infiltration challenge, you will take damage based on the
difficulty of the infiltration. If you are reduced to 0 hp or below, the
infiltration will immediately end.
* Most use spacebar as "action"
* Some use WASD or arrows interchangeably.
* A few others use the rest of the keyboard.
** Slash when his guard is down! **
Press space when the guard is preparing to attack you.
There's 3 phases
The first is guarding, where attacking back will result in failure.
The 2nd is preparing, where attacking will result in a victory.
The 3rd is attack, where the guard will attack you resulting in failure.
** Close the brackets **
Enter all the matching brackets in reverse order.
** Type it backward **
Type the words that are written backward.
** Say something nice about the guard. **
Use the arrows to find a compliment for the guard.
** Enter the Code! **
Match the arrows as they appears.
** Match the symbols! **
Move the cursor to the matching symbol and press space to confirm.
** Remember all the mines! **
At first the cursor cannot be moved, remember the positions of the X.
Then move the cursor and press space to mark the mines on the board.
** Cut the wires **
Follow the instructions and press the numbers 1 through 9 to cut the appropriate
wires.

View File

@@ -1,188 +0,0 @@
.. _gameplay_scripts:
Scripts
=======
Scripts are programs that can be used to automate the hacking process
and almost every other part of the game. Scripts must be written
in the :ref:`netscript` language.
It is highly recommended that you have a basic background in programming
to start writing scripts. You by no means need to be an expert. All you
need is some familiarity with basic programming constructs like
for/while loops, conditionals (if/else), functions, variables, etc.
If you'd like to learn a little bit about programming, see
:ref:`netscriptlearntoprogram`.
Script Arguments
^^^^^^^^^^^^^^^^
When running a script, you can choose to pass arguments to that script.
The script's logic can access and act on these arguments. This allows
for flexibility in your scripts. For more details, see
:ref:`netscript_script_arguments`.
For information on how to run scripts with arguments, see
:ref:`gameplay_working_with_scripts_in_terminal` and
:ref:`gameplay_working_with_scripts_in_netscript` below.
Identifying a Script
^^^^^^^^^^^^^^^^^^^^
Many commands and functions act on an executing script
(i.e. a script that is running). Therefore, there must
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 arguments must be an **exact** match. This means that both
the order and type of the arguments matter.
.. _gameplay_scripts_multithreadingscripts:
Multithreading scripts
^^^^^^^^^^^^^^^^^^^^^^
A script can be run with multiple threads. This is also called multithreading.
The effect of multithreading is that every call to the
:js:func:`hack`, :js:func:`grow`, and :js:func:`weaken` Netscript functions
will have their results multiplied by the number of threads.
For example, if a normal single-threaded script
is able to hack $10,000, then running the same script with 5 threads would
yield $50,000.
(This is the **only** affect of running a script with multiple threads.
Scripts will not actually become multithreaded in the real-world
sense.)
When multithreading a script, the total RAM cost can be calculated by
simply multiplying the base RAM cost of the script with the number of
threads, where the base cost refers to the amount of RAM required to
run the script single-threaded. In the terminal, you can run the
:ref:`mem_terminal_command` Terminal command to see how much RAM a script
requires with `n` threads::
$ mem [scriptname] -t n
.. _gameplay_working_with_scripts_in_terminal:
Working with Scripts in Terminal
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Running a script requires RAM. The more complex a script is, the more
RAM it requires to run. Scripts can be run on any server you have root
access to.
Here are some :ref:`terminal` commands that are useful when working
with scripts:
**check [script] [args...]**
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`
then in order to 'check' it you must also add the `foodnstuff` argument
to the check command::
$ check foo.js foodnstuff
**free**
Shows the current server's RAM usage and availability
**kill [script] [args...]**
Stops a script that is running with the specified 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
the argument 1 and 2, then just typing "`kill foo.js`" will
not work. You have to use::
$ kill foo.js 1 2
**mem [script] [-t] [n]**
Check how much RAM a script requires to run with n threads
**nano [script]**
Create/Edit a script. The name of the script must end with a valid
extension: .script, or .js
**ps**
Displays all scripts that are actively running on the current server
**rm [script]**
Delete a script from the server. This is permanent
**run [script] [-t] [n] [args...]**
Run a script with n threads and the specified arguments. Each argument should
be separated by a space. Both the arguments and thread specification are
optional. If neither are specified, then the script will be run single-threaded
with no arguments.
Examples:
Run 'foo.js' single-threaded with no arguments::
$ run foo.js
Run 'foo.js' with 10 threads and no arguments::
$ run foo.js -t 10
Run 'foo.js' single-threaded with three arguments: [foodnstuff, sigma-cosmetics, 10]::
$ run foo.js foodnstuff sigma-cosmetics 10
Run 'foo.js' with 50 threads and a single argument: [foodnstuff]::
$ run foo.js -t 50 foodnstuff
**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
**top**
Displays all active scripts and their RAM usage
.. _gameplay_working_with_scripts_in_netscript:
Working with Scripts in Netscript
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TODO/Coming Soon...
Notes about how Scripts Work Offline
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The scripts that you write and execute are interpreted in Javascript.
For this reason, it is not possible for these scripts to run while
offline (when the game is closed). It is important to note that for
this reason, conditionals such as if/else statements and certain
commands such as purchaseHacknetNode() or nuke() will not work while
the game is offline.
However, Scripts WILL continue to generate money and hacking exp
for you while the game is offline. This offline production is based
off of the scripts' production while the game is online.
grow() and weaken() are two Netscript commands that will also be
applied when the game is offline, although at a slower rate compared
to if the game was open. This is done by having each script keep
track of the rate at which the grow() and weaken() commands are called
when the game is online. These calculated rates are used to determine
how many times these function calls would be made while the game is
offline.
Also, note that because of the way the Netscript interpreter is
implemented, whenever you reload or re-open the game all of the
scripts that you are running will start running from the BEGINNING
of the code. The game does not keep track of where exactly the
execution of a script is when it saves/loads.

View File

@@ -1,79 +0,0 @@
.. _gameplay_servers:
Servers
=======
In this game, a server refers to a computer that can be connected to,
accessed, and manipulated through the Terminal. All servers in the
game are connected to each other to form a large, global network.
To learn about how to navigate this network and connect to other
servers, see the :ref:`Terminal` page.
Server Statistics
^^^^^^^^^^^^^^^^^
Each server has it's own statistics, such as RAM, required hacking level and number of
ports required to successfully NUKE it.
Perhaps the most important property of a server to make note of is its RAM,
which refers to how much memory is available on that machine. RAM is
important because it is required to run Scripts. More RAM allows
the user to run more powerful and complicated scripts as well as executing
a script with :ref:`more threads <gameplay_scripts_multithreadingscripts>`.
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.
Identifying Servers
^^^^^^^^^^^^^^^^^^^
A server is identified by its hostname.
A hostname is a label assigned to a server.
A hostname will usually give you a general idea of what the server
is. For example, the company Nova Medical might have a server with
the hostname "nova-med".
Hostnames are unique. This means that if one
server has the the hostname "some-server", then no other server
in the game can have that that hostname.
There are many :ref:`Netscript Functions <netscriptfunctions>`
and :ref:`terminal` commands in the game
that will require you to target a specific server by hostname.
Player-owned Servers
^^^^^^^^^^^^^^^^^^^^
The player starts with a single server: his/her home computer.
This server will have the hostname "home." The player's home
computer is special for a variety of reasons:
1. The home computer's RAM can be upgraded. This can be done by visiting
certain locations in the World.
2. The home computer persists through Augmentation Installations. This means
that you will not lose any RAM upgrades or Scripts on your
home computer when you install :ref:`gameplay_augmentations` (you will
however, lose programs and messages on your home computer).
The player can also purchase additional servers. This can be
done by visiting certain locations in the World, or it can be
done automatically through a script using the :js:func:`purchaseServer`
Netscript Function. The advantage of purchased servers is that,
in terms of RAM, they are cheaper than upgrading your home
computer. The disadvantage is that your purchased servers
are lost when you install Augmentations.
Hackable Servers
^^^^^^^^^^^^^^^^
Most servers that are not owned by the player can be hacked for money
and exp. See the :ref:`gameplay_hacking` page for more details.
Different servers have different levels of security, but also offer
different rewards when being hacked.
Server Connections
^^^^^^^^^^^^^^^^^^
The servers are in a randomly organized tree-structure. The distance from
the home computer to each server is fixed, but the exact route to them is
randomized when you install :ref:`gameplay_augmentations`. In general the
further away from home computer a server is the higher it's statistics are.

View File

@@ -1,116 +0,0 @@
.. _gameplay_stats:
Stats
=====
The player has several stats that can be increased in order to progress
in the game.
Hacking
^^^^^^^
Represents the player's ability to code and hack.
Affects:
* Time it takes to hack a server
* Time it takes to execute the grow() and weaken() Netscript function
* Chance to successfully hack a server
* Percent money stolen when hacking a server
* Success rate of certain crimes
* Time it takes to create a program
* Faction reputation gain when carrying out Hacking Contracts or Field Work
* Company reputation gain for certain jobs
Gain experience by:
* Manually hacking servers through Terminal
* Executing hack(), grow(), or weaken() through a script
* Committing certain crimes
* Carrying out Hacking Contracts or doing Field work for Factions
* Working certain jobs at a company
* Studying at a university
Strength
^^^^^^^^
Represents the player's physical offensive power
Affects:
* Success rate of certain crimes
* Faction reputation gain for Security and Field Work
* Company reputation gain for certain jobs
Gain experience by:
* Committing certain crimes
* Working out at a gym
* Doing Security/Field Work for a faction
* Working certain jobs at a company
Defense
^^^^^^^
Represents the player's ability to withstand damage
Affects:
* Success rate of certain crimes
* The player's HP
* Faction reputation gain for Security and Field Work
* Company reputation gain for certain jobs
Gain experience by:
* Committing certain crimes
* Working out at a gym
* Doing Security/Field Work for a faction
* Working certain jobs at a company
Dexterity
^^^^^^^^^
Represents the player's skill and adeptness in performing certain tasks
Affects:
* Success rate of certain crimes
* Faction reputation gain for Security and Field Work
* Company reputation gain for certain jobs
Gain experience by:
* Committing certain crimes
* Working out at a gym
* Doing Security/Field Work for a faction
* Working certain jobs at a company
Agility
^^^^^^^
Represents the player's speed and ability to move
Affects:
* Success rate of certain crimes
* Faction reputation gain for Security and Field Work
* Company reputation gain for certain jobs
Gain experience by:
* Committing certain crimes
* Working out at a gym
* Doing Security/Field Work for a faction
* Working certain jobs at a company
Charisma
^^^^^^^^
Represents the player's social abilities
Affects:
* Success rate of certain crimes
* Faction reputation gain for Field Work
* Company reputation gain for most jobs
Gain experience by:
* Committing certain crimes
* Studying at a university
* Working a relevant job at a company
* Doing Field work for a Faction

View File

@@ -1,208 +0,0 @@
.. _gameplay_stock_market:
Stock Market
============
The Stock Market refers to the World Stock Exchange (WSE), through which you can
buy and sell stocks in order to make money.
The WSE can be found in the 'City' tab, and is accessible in every city.
Fundamentals
------------
The Stock Market is not as simple as "buy at price X and sell at price Y". The following
are several fundamental concepts you need to understand about the stock market.
.. note:: For those that have experience with finance/trading/investing, please be aware
that the game's stock market does not function exactly like it does in the real
world. So these concepts below should seem similar, but won't be exactly the same.
Positions: Long vs Short
^^^^^^^^^^^^^^^^^^^^^^^^
When making a transaction on the stock market, there are two types of positions:
Long and Short. A Long position is the typical scenario where you buy a stock and
earn a profit if the price of that stock increases. Meanwhile, a Short position
is the exact opposite. In a Short position you purchase shares of a stock and
earn a profit if the price of that stock decreases. This is also called 'shorting'
a stock.
.. note:: Shorting stocks is not available immediately, and must be unlocked later in the
game.
Forecast & Second-Order Forecast
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
A stock's forecast is its likelihood of increasing or decreasing in value. The
forecast is typically represented by its probability of increasing in either
a decimal or percentage form. For example, a forecast of 70% means the stock
has a 70% chance of increasing and a 30% chance of decreasing.
A stock's second-order forecast is the target value that its forecast trends towards.
For example, if a stock has a forecast of 60% and a second-order forecast of 70%,
then the stock's forecast should slowly trend towards 70% over time. However, this is
determined by RNG so there is a chance that it may never reach 70%.
Both the forecast and the second-order forecast change over time.
A stock's forecast can be viewed after purchasing Four Sigma (4S) Market Data
access. This lets you see the forecast info on the Stock Market UI. If you also
purchase access to the 4S Market Data TIX API, then you can view a stock's forecast
using the :js:func:`getStockForecast` function.
A stock's second-order forecast is always hidden.
.. _gameplay_stock_market_spread:
Spread (Bid Price & Ask Price)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The **bid price** is the maximum price at which someone will buy a stock on the
stock market.
The **ask price** is the minimum price that a seller is willing to receive for a stock
on the stock market
The ask price will always be higher than the bid price (This is because if a seller
is willing to receive less than the bid price, that transaction is guaranteed to
happen). The difference between the bid and ask price is known as the **spread**.
A stock's "price" will be the average of the bid and ask price.
The bid and ask price are important because these are the prices at which a
transaction actually occurs. If you purchase a stock in the long position, the cost
of your purchase depends on that stock's ask price. If you then try to sell that
stock (still in the long position), the price at which you sell is the stock's
bid price. Note that this is reversed for a short position. Purchasing a stock
in the short position will occur at the stock's bid price, and selling a stock
in the short position will occur at the stock's ask price.
Transactions Influencing Stock Forecast
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Buying or selling a large number of shares
of a stock will influence that stock's forecast & second-order forecast.
The forecast is the likelihood that the stock will increase or decrease in price.
The magnitude of this effect depends on the number of shares being transacted.
More shares will have a bigger effect.
The effect that transactions have on a stock's second-order forecast is
significantly smaller than the effect on its forecast.
.. _gameplay_stock_market_order_types:
Order Types
^^^^^^^^^^^
There are three different types of orders you can make to buy or sell stocks on the exchange:
Market Order, Limit Order, and Stop Order.
.. note:: Limit Orders and Stop Orders are not available immediately, and must be unlocked
later in the game.
When you place a Market Order to buy or sell a stock, the order executes immediately at
whatever the current price of the stock is. For example if you choose to short a stock
with 5000 shares using a Market Order, you immediately purchase those 5000 shares in a
Short position at whatever the current market price is for that stock.
A Limit Order is an order that only executes under certain conditions. A Limit Order is
used to buy or sell a stock at a specified price or better. For example, lets say you
purchased a Long position of 100 shares of some stock at a price of $10 per share. You
can place a Limit Order to sell those 100 shares at $50 or better. The Limit Order will
execute when the price of the stock reaches a value of $50 or higher.
A Stop Order is the opposite of a Limit Order. It is used to buy or sell a stock at a
specified price (before the price gets 'worse'). For example, lets say you purchased a
Short position of 100 shares of some stock at a price of $100 per share. The current
price of the stock is $80 (a profit of $20 per share). You can place a Stop Order to
sell the Short position if the stock's price reaches $90 or higher. This can be used
to lock in your profits and limit any losses.
Here is a summary of how each order works and when they execute:
**In a LONG Position:**
A Limit Order to buy will execute if the stock's price <= order's price
A Limit Order to sell will execute if the stock's price >= order's price
A Stop Order to buy will execute if the stock's price >= order's price
A Stop Order to sell will execute if the stock's price <= order's price
**In a SHORT Position:**
A Limit Order to buy will execute if the stock's price >= order's price
A Limit Order to sell will execute if the stock's price <= order's price
A Stop Order to buy will execute if the stock's price <= order's price
A Stop Order to sell will execute if the stock's price >= order's price.
.. _gameplay_stock_market_player_actions_influencing_stock:
Player Actions Influencing Stocks
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
It is possible for your actions elsewhere in the game to influence the stock market.
Hacking
If a server has a corresponding stock (e.g. *foodnstuff* server -> FoodNStuff
stock), then hacking that server can decrease the stock's second-order
forecast. This causes the corresponding stock's forecast to trend downwards in value
over time.
This effect only occurs if you set the *stock* option to
true when calling the :js:func:`hack` function. The chance that hacking a
server will cause this effect is based on what percentage of the
server's total money you steal.
A single hack will have a minor
effect, but continuously hacking a server for lots of money over time
will have a noticeable effect in making the stock's forecast trend downwards.
Growing
If a server has a corresponding stock (e.g. *foodnstuff* server -> FoodNStuff
stock), then growing that server's money can increase the stock's
second-order forecast. This causes the corresponding stock's
forecast to trend upwards in value over time.
This effect only occurs if you set the *stock* option to true when calling the
:js:func:`grow` function. The chance that growing a server will cause this
effect is based on what percentage of the server's total money to add to it.
A single grow operation will have a minor effect, but continuously growing
a server for lots of money over time will have a noticeable effect in making
the stock's forecast trend upwards.
Working for a Company
If a company has a corresponding stock, then working for that company will
increase the corresponding stock's second-order forecast. This will
cause the stock's forecast to (slowly) trend upwards in value
over time.
The potency of this effect is based on how "effective" you are when you work
(i.e. its based on your stats and multipliers).
Automating the Stock Market
---------------------------
You can write scripts to perform automatic and algorithmic trading on the Stock Market.
See `TIX API <https://github.com/bitburner-official/bitburner-src/blob/dev/markdown/bitburner.tix.md>`_ for more details.
Under the Hood
--------------
Stock prices are updated every ~6 seconds.
Whether a stock's price moves up or down is determined by RNG. However,
stocks have properties that can influence the way their price moves. These properties
are hidden, although some of them can be made visible by purchasing the
Four Sigma (4S) Market Data upgrade. Some examples of these properties are:
* Volatility
* Likelihood of increasing or decreasing (i.e. the stock's forecast)
* Likelihood of forecast increasing or decreasing (i.e. the stock's second-order forecast)
* How easily a stock's price/forecast is influenced by transactions
* Spread percentage
* Maximum price (not a real maximum, more of a "soft cap")
Each stock has its own unique values for these properties.
Offline Progression
-------------------
The Stock Market does not change or process anything while the game has closed.
However, it does accumulate time when offline. This accumulated time allows
the stock market to run 50% faster when the game is opened again. This means
that stock prices will update every ~4 seconds instead of 6.

View File

@@ -1,644 +0,0 @@
.. _terminal:
Terminal
========
The Terminal is a console emulator program that lets you interface with all of the
Servers in the game. The Terminal can be accessed by clicking the 'Terminal' tab
on the navigation menu on the left-hand side of the game (you may need to expand
the 'Hacking' header in order to see the 'Terminal' tab). Alternatively, the :ref:`keyboard
shortcut <shortcuts>` Alt + t can be used to open the Terminal.
.. _terminal_filesystem:
Filesystem (Directories)
------------------------
The Terminal contains a **very** basic filesystem that allows you to store and
organize your files into different directories. Note that this is **not** a true
filesystem implementation. Instead, it is done almost entirely using string manipulation.
For this reason, many of the nice & useful features you'd find in a real
filesystem do not exist.
Here are the Terminal commands you'll commonly use when dealing with the filesystem.
* :ref:`ls_terminal_command`
* :ref:`cd_terminal_command`
* :ref:`mv_terminal_command`
Directories
^^^^^^^^^^^
In order to create a directory, simply name a file using a full absolute Linux-style path::
/scripts/myScript.js
This will automatically create a "directory" called :code:`scripts`. This will also work
for subdirectories::
/scripts/hacking/helpers/myHelperScripts.js
Files in the root directory do not need to begin with a forward slash::
thisIsAFileInTheRootDirectory.txt
Note that there is no way to manually create or remove directories. The creation and
deletion of directories is automatically handled as you name/rename/delete
files.
Absolute vs Relative Paths
^^^^^^^^^^^^^^^^^^^^^^^^^^
Many Terminal commands accept both absolute and relative paths for specifying a
file.
An absolute path specifies the location of the file from the root directory (/).
Any path that begins with the forward slash is an absolute path::
$ nano /scripts/myScript.js
$ cat /serverList.txt
A relative path specifies the location of the file relative to the current working directory.
Any path that does **not** begin with a forward slash is a relative path. Note that the
Linux-style dot symbols will work for relative paths::
. (a single dot) - represents the current directory
.. (two dots) - represents the parent directory
$ cd ..
$ nano ../scripts/myScript.js
$ nano ../../helper.js
Netscript
^^^^^^^^^
Note that in order to reference a file, :ref:`netscript` functions require the
**full** absolute file path. For example
.. code:: javascript
ns.run("/scripts/hacking/helpers.myHelperScripts.js");
ns.rm("/logs/myHackingLogs.txt");
ns.rm("thisIsAFileInTheRootDirectory.txt");
.. note:: A full file path **must** begin with a forward slash (/) if that file
is not in the root directory.
Missing Features
^^^^^^^^^^^^^^^^
These features that are typically in Linux filesystems have not yet been added to the game:
* Tab autocompletion does not work with relative paths
* :code:`mv` only accepts full filepaths for the destination argument. It does not accept directories
Commands
--------
alias
^^^^^
$ alias [-g] [name="value"]
Create or display aliases. An alias enables a replacement of a word with another
string. It can be used to abbreviate a commonly used command, or commonly used
parts of a command. The NAME of an alias defines the word that will be
replaced, while the VALUE defines what it will be replaced by. For example,
you could create the alias 'nuke' for the Terminal command 'run NUKE.exe'
using the following::
$ alias nuke="run NUKE.exe"
Then, to run the NUKE.exe program you would just have to enter 'nuke' in
Terminal rather than the full command. It is important to note that 'default'
aliases will only be substituted for the first word of a Terminal command. For
example, if the following alias was set::
$ alias worm="HTTPWorm.exe"
and then you tried to run the following terminal command::
$ run worm
This would fail because the worm alias is not the first word of a Terminal
command. To allow an alias to be substituted anywhere in a Terminal command,
rather than just the first word, you must set it to be a global alias using the -g flag::
$ alias -g worm="HTTPWorm.exe"
Now, the 'worm' alias will be substituted anytime it shows up as an individual word in
a Terminal command.
Entering just the command 'alias' without any arguments prints the list of all
defined aliases in the reusable form 'alias NAME=VALUE' on the Terminal.
The :ref:`unalias_terminal_command` Terminal command can be used to remove aliases.
.. _analyze_terminal_command:
analyze
^^^^^^^
Prints details and statistics about the current server. The information that is
printed includes basic server details such as the hostname, whether the player
has root access, what ports are opened/closed, and also hacking-related information
such as an estimated chance to successfully hack, an estimate of how much money is
available on the server, etc.
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.
buy
^^^
$ buy [-l/-a/program]
Purchase a program through the Dark Web. Requires a TOR Router to use.
If this command is ran with the '-l' flag, it will display a list of all programs
that can be purchased through the Dark Web, as well as their costs.
If this command is ran with the '-a' flag, it will attempt to buy all programs
that can be purchased through the Dark Web and if the player can't afford all of them
none will be bought.
Otherwise, the name of the program must be passed in as a parameter. This name
is NOT case-sensitive::
$ buy brutessh.exe
Note that you do not need to be connected to the actual dark web server in order
to run this command. You can use this command at any time on the Terminal.
cat
^^^
$ cat [filename]
Display a message (.msg), literature (.lit), or text (.txt) file::
$ cat j1.msg
$ cat foo.lit
$ cat servers.txt
.. _cd_terminal_command:
cd
^^
$ cd [dir]
Change to the specified directory.
See :ref:`terminal_filesystem` for details on directories.
Note that this command works even for directories that don't exist. If you change
to a directory that doesn't exist, it will not be created. A directory is only created
once there is a file in it::
$ cd scripts/hacking
$ cd /logs
$ cd ..
check
^^^^^
$ check [script name] [args...]
Print the logs of the script specified by the script name and arguments to the Terminal.
Each argument must be separated by a space.
**Remember that a running script is uniquely identified both by its name and the arguments that are used to start it**. So,
if a script was ran with the following arguments::
$ run foo.js 1 2 foodnstuff
Then to run the 'check' command on this script you would have to pass the same arguments in::
$ check foo.js 1 2 foodnstuff
clear/cls
^^^^^^^^^
Clear the Terminal screen, deleting all of the text. Note that this does not
delete the user's command history, so using the up and down arrow keys is
still valid. Also note that this is permanent and there is no way to undo this.
Both 'clear' and 'cls' do the same thing::
$ clear
$ cls
.. _connect_terminal_command:
connect
^^^^^^^
$ connect [hostname/ip]
Connect to a remote server. The hostname of the remote server must
be given as the argument to this command. Note that only servers that are immediately
adjacent to the current server in the network can be connected to. To see which
servers can be connected to, use the 'scan' command.
download
^^^^^^^^
Downloads a script or text file to your computer (your real-life computer)::
$ download masterScript.script
$ download importantInfo.txt
You can also download all of your scripts/text files as a zip file using the following
Terminal commands::
$ download *
$ download *.script
$ download *.txt
expr
^^^^
$ expr [math expression]
Evaluate a mathematical expression. The expression is evaluated in JavaScript,
and therefore all JavaScript operators should be supported.
Examples::
$ expr 5.6 * 10 - 123
$ expr 3 ** 3
free
^^^^
Display's the memory usage on the current machine. Print the amount of RAM that
is available on the current server as well as how much of it is being used.
hack
^^^^
Attempt to hack the current server. Requires root access in order to be run.
Related: Hacking Mechanics :ref:`hacking`
help
^^^^
$ help [command]
Display Terminal help information. Without arguments, 'help' prints a list of all
valid Terminal commands and a brief description of their functionality. You can
also pass the name of a Terminal command as an argument to 'help' to print more
detailed information about the Terminal command. Examples::
$ help alias
$ help scan-analyze
.. _home_terminal_command:
home
^^^^
Connect to your home computer. This will work no matter what server you are currently connected to.
hostname
^^^^^^^^
Prints the hostname of the server you are currently connected to.
kill
^^^^
$ kill [script name] [args...]
$ kill [pid]
Kill the script specified by the script filename and arguments OR by its PID. If
filename and arguments are used the kill is server-specific, so if you're connected
to home and want to kill a script running on n00dles, you have to either use it's PID
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
by both its name and the arguments that are used to start it. So, if a script
was ran with the following arguments::
$ run foo.js 50e3 sigma-cosmetics
Then to kill this script the same arguments would have to be used::
$ kill foo.js 50e3 sigma-cosmetics
If you are killing the script using its PID, then the PID argument must be numeric.
killall
^^^^^^^
Kills all scripts on the current server.
.. _ls_terminal_command:
ls
^^
$ ls [dir] [--grep pattern]
Prints files and directories on the current server to the Terminal screen.
If this command is run with no arguments, then it prints all files and directories on the current
server to the Terminal screen. Directories will be printed first in alphabetical order,
followed by the files (also in alphabetical order).
The :code:`dir` optional parameter allows you to specify the directory for which to display
files.
The :code:`--grep pattern` optional parameter allows you to only display files and directories
with a certain pattern in their names.
The :code:`-l` optional parameter allows you to force each item onto a single line.
Examples::
// List files/directories with the '.script' extension in the current directory
$ ls -l --grep .script
// List files/directories with the '.js' extension in the root directory
$ ls / -l --grep .js
// List files/directories with the word 'purchase' in the name, in the 'scripts' directory
$ ls scripts -l --grep purchase
lscpu
^^^^^
Prints the number of CPU cores the current server has.
.. _mem_terminal_command:
mem
^^^
$ mem [script name] [-t] [num threads]
Displays the amount of RAM needed to run the specified script with a single
thread. The command can also be used to print the amount of RAM needed to run
a script with multiple threads using the '-t' flag. If the '-t' flag is
specified, then an argument for the number of threads must be passed in
afterwards. Examples::
$ mem foo.js
$ mem foo.js -t 50
The first example above will print the amount of RAM needed to run 'foo.js'
with a single thread. The second example above will print the amount of RAM needed
to run 'foo.js' with 50 threads.
.. _mv_terminal_command:
mv
^^
$ mv [source] [destination]
Move the source file to the specified destination in the filesystem.
See :ref:`terminal_filesystem` for more details about the Terminal's filesystem.
This command only works for scripts and text files (.txt). It cannot, however, be used
to convert from script to text file, or vice versa.
This function can also be used to rename files.
.. note:: Unlike the Linux :code:`mv` command, the *destination* argument must be the
full filepath. It cannot be a directory.
Examples::
$ mv hacking.script scripts/hacking.script
$ mv myScript.js myOldScript.js
nano
^^^^
$ nano [filename]
Opens up the specified file in the Text Editor. Only scripts (.script, .js) and
text files (.txt) can be edited. If the file does not already exist, then a new
empty file will be created.
ps
^^
$ ps [-g, --grep pattern]
Prints all scripts that are currently running on the current server.
The :code:`-g, --grep pattern` option will only output running scripts where the name matches the provided pattern.
rm
^^
$ rm [filename]
Removes the specified file from the current server. This works for every file type
except literature files (.lit).
**WARNING: This is permanent and cannot be undone**
.. _run_terminal_command:
run
^^^
$ run [file name] [-t] [num threads] [args...]
Execute a program, script, or :ref:`codingcontracts`.
The '[-t]', '[num threads]', and '[args...]' arguments are only valid when
running a script. The '-t' flag is used to indicate that the script should
be run with the specified integer number of threads. If the flag is omitted,
the script will be run with a single thread by default. If the '-t' flag is
used, then it MUST come immediately after the script name, and the
[num threads] argument MUST come immediately afterwards.
[args...] represents a variable number of arguments that will be passed into
the script. See the documentation about script arguments. Each specified
argument must be separated by a space.
**Examples**
Run a program::
$ run BruteSSH.exe
Run *foo.js* with 50 threads and the arguments [1e3, 0.5, foodnstuff]::
$ run foo.js -t 50 1e3 0.5 foodnstuff
Run a Coding Contract::
$ run foo-contract.cct
scan
^^^^
Prints all immediately-available network connections. This will print a list
of all servers that you can currently connect to using the 'connect' Terminal command.
.. _scan_analyze_terminal_command:
scan-analyze
^^^^^^^^^^^^
$ scan-analyze [depth]
Prints detailed information about all servers up to *[depth]* nodes away on the
network. Calling 'scan-analyze 1' will display information for the same servers
that are shown by the 'scan' Terminal command. This command also shows the
relative paths to reach each server.
By default, the maximum depth that can be specified for 'scan-analyze' is 3.
However, once you have the *DeepscanV1.exe* and *DeepscanV2.exe* programs, you can
execute 'scan-analyze' with a depth up to 5 and 10, respectively.
The information 'scan-analyze' displays about each server includes whether or
not you have root access to it, its required hacking level, the number of open
ports required to run NUKE.exe on it, and how much RAM it has. When used the
information is structured like:
n00dles
--Root Access: YES, Required hacking skill: 1
--Number of open ports required to NUKE: 0
--RAM: 4.00GB
----zer0
------Root Access: NO, Required hacking skill: 75
------Number of open ports required to NUKE: 1
------RAM: 32.00GB
foodnstuff
--Root Access: NO, Required hacking skill: 1
--Number of open ports required to NUKE: 0
--RAM: 16.00GB
In this case :code:`n00dles` and :code:`foodnstuff` are connected to the current server
and :code:`zer0` is connected to :code:`n00dles`.
.. _scp_terminal_command:
scp
^^^
$ scp [script name] [target server]
Copies the specified script from the current server to the target server.
The second argument passed in must be the hostname or IP of the target server.
sudov
^^^^^
Prints whether or not you have root access to the current server.
.. _tail_terminal_command:
tail
^^^^
$ tail [script name] [args...]
Displays dynamic logs for the script specified by 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
it. So, if a script was ran with the following arguments::
$ run foo.js 10 50000
Then in order to check its logs with 'tail' the same arguments must be used::
$ tail foo.js 10 50000
top
^^^
Prints a list of all scripts running on the current server as well as their
thread count and how much RAM they are using in total.
.. _unalias_terminal_command:
unalias
^^^^^^^
$ unalias "[alias name]"
Deletes the specified alias. Note that the double quotation marks are required.
As an example, if an alias was declared using::
$ alias r="run"
Then it could be removed using::
$ unalias "r"
It is not necessary to differentiate between global and non-global aliases when using 'unalias'
wget
^^^^
$ wget [url] [target file]
Retrieves data from a url and downloads it to a file on the current server.
The data can only be downloaded to a script (.script, .js) or a text file
(.txt). If the target file already exists, it will be overwritten by this command.
Note that will not be possible to download data from many websites because they
do not allow cross-origin resource sharing (CORS). This includes websites such
as gist and pastebin. One notable site it will work on is rawgithub. Example::
$ wget https://raw.githubusercontent.com/bitburner-official/bitburner-src/master/README.md game_readme.txt
Argument Parsing
----------------
When evaluating a terminal command, arguments are initially parsed based on whitespace (usually spaces).
Each whitespace character signifies the end of an argument, and potentially the start
of new one. For most terminal commands, this is all you need to know.
When running scripts, however, it is important to know in more detail how arguments are parsed.
There are two main points:
1. Quotation marks can be used to wrap a single argument and force it to be parsed as
a string. Any whitespace inside the quotation marks will not cause a new argument
to be parsed.
2. Anything that can represent a number is automatically cast to a number, unless its
surrounded by quotation marks.
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);
for (var i = 0; i < ns.args.length; ++i) {
ns.tprint(typeof ns.args[i]);
}
}
Then if we run the following terminal command::
$ run argType.js 123 1e3 "5" "this is a single argument"
We'll see the following in the Terminal::
Running script with 1 thread(s) and args: [123, 1000, "5", "this is a single argument"].
May take a few seconds to start up the process...
argType.js: Number of args: 4
argType.js: number
argType.js: number
argType.js: string
argType.js: string
Chaining Commands
-----------------
You can run multiple Terminal commands at once by separating each command
with a semicolon (;).
Example::
$ run foo.js; tail foo.js

View File

@@ -1,16 +0,0 @@
.. _gameplay_world:
World
=====
In Bitburner, the world consists of six different cities:
* Sector-12 (this is where you start out)
* Aevum
* Ishima
* New Tokyo
* Chongqing
* Volhaven
Each city has it's own map and :ref:`faction`. Each city also
offers different services, such as gyms, universities, hardware
stores and places of work.

File diff suppressed because it is too large Load Diff

View File

@@ -1,25 +0,0 @@
import sys, os, subprocess
project = u'Bitburner'
copyright = u'2017, Daniel Xie'
master_doc = 'index'
templates_path = ['_templates']
extensions = []
source_suffix = '.rst'
version = '1.0.0'
exclude_patterns = ['_build']
# -- HTML theme settings ------------------------------------------------
html_show_sourcelink = False
import guzzle_sphinx_theme
extensions.append("guzzle_sphinx_theme")
html_theme_path = guzzle_sphinx_theme.html_theme_path()
html_theme = 'guzzle_sphinx_theme'
# Guzzle theme options (see theme.conf for more information)
html_theme_options = {
"project_nav_name": "Bitburner",
}

View File

@@ -1,192 +0,0 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Bitburner documentation build configuration file, created by
# sphinx-quickstart on Wed Oct 4 15:03:07 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented out
# serve to show the default.
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
# import os
# import sys
# sys.path.insert(0, os.path.abspath('.'))
# -- General configuration ------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here.
#
# needs_sphinx = '1.0'
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = ['sphinx.ext.autodoc',
'sphinx.ext.doctest',
'sphinx.ext.intersphinx',
'sphinx.ext.todo',
'sphinx.ext.coverage',
'sphinx.ext.mathjax',
'sphinx.ext.ifconfig',
'sphinx.ext.viewcode',
'sphinx.ext.githubpages']
# Add any paths that contain templates here, relative to this directory.
templates_path = ['ytemplates']
# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
# source_suffix = ['.rst', '.md']
source_suffix = '.rst'
# The master toctree document.
master_doc = 'index'
# General information about the project.
project = 'Bitburner'
author = 'Bitburner'
copyright = '2016, {0}'.format(author)
documentation_title = '{0} Documentation'.format(project)
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = '2.2'
# The full version, including alpha/beta/rc tags.
release = '2.2.2'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = 'en'
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This patterns also effect to html_static_path and html_extra_path
exclude_patterns = []
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = True
# -- Options for HTML output ----------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
#html_theme = 'agogo'
html_theme = "sphinx_rtd_theme"
html_theme_options = {
"navigation_depth": 5,
}
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#
#html_theme_options = {'stickysidebar':'true'}
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['ystatic']
# Custom sidebar templates, must be a dictionary that maps document names
# to template names.
#
# This is required for the alabaster theme
# refs: http://alabaster.readthedocs.io/en/latest/installation.html#sidebars
# html_sidebars = {
# '**': [
# 'about.html',
# 'navigation.html',
# 'relations.html', # needs 'show_related': True theme option to display
# 'searchbox.html',
# 'donate.html',
# ]
# }
# -- Options for HTMLHelp output ------------------------------------------
# Output file base name for HTML help builder.
htmlhelp_basename = '{0}doc'.format(project)
# -- Options for LaTeX output ---------------------------------------------
latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',
# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',
# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
}
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, '{0}.tex'.format(project), documentation_title,
author, 'manual'),
]
# -- Options for manual page output ---------------------------------------
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, project.lower(), documentation_title,
[author], 1)
]
# -- Options for Texinfo output -------------------------------------------
# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, project, documentation_title,
author, project, 'One line description of project.',
'Miscellaneous'),
]
# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {'https://docs.python.org/': None}
def setup(app):
print("Initializing (setup())");
app.add_stylesheet('maxwidthoverride.css')
app.add_stylesheet('dark_theme.css')

View File

@@ -1,73 +0,0 @@
Game Frozen or Stuck?
=====================
Infinite Loop in NetscriptJS
----------------------------
If your game is frozen or stuck in any way, then the most likely culprit is an
infinitely running loop in :ref:`netscriptjs`. To get past the freezing, run the game with
`?noScripts` in the URL:
`https://bitburner-official.github.io/bitburner/?noScripts <https://bitburner-official.github.io/bitburner/?noScripts>`_
Then, to fix your script, make sure you have a sleep or any other timed function like `hack()` or
`grow()` in any infinite loops::
while(true) {
// This is an infinite loop that does something
...
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
function, but it nor any possible conditional breaks are never reached and therefore will crash the game::
while(true) {
let currentMoney = ns.getServerMoneyAvailable("n00dles");
let maxMoney = ns.getServerMaxMoney("n00dles");
if (currentMoney < maxMoney/2){
await ns.grow("n00dles");
}
if (currentMoney === maxMoney){
break;
}
}
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.
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::
var ram = 8;
var i = 0;
while (i < ns.getPurchasedServerLimit()) {
if (ns.getServerMoneyAvailable("home") > ns.getPurchasedServerCost(ram)) {
var hostname = ns.purchaseServer("pserv-" + i, ram);
ns.scp("early-hack-template.script", hostname);
ns.exec("early-hack-template.script", hostname, 3);
++i;
}
}
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.
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.
Blackscreen
-----------
If the game window becomes a black screen without the game itself crashing, this is caused by
the game running too many concurrent scripts (the game runs on a browser and each tab can only
use so much ram until it crashes). Depending on which scripts are running and your hardware,
this number can vary between 50000 to 100000 instances (in version 2.0.2. In prior versions this number
was about 1/5th of that). To prevent this from happening make sure to :ref:`multithread<gameplay_scripts_multithreadingscripts>`
the scripts as much as possible.
Bug
---
Otherwise, the game is probably frozen/stuck due to a bug. To report a bug, follow
the guidelines `here <https://github.com/bitburner-official/bitburner-src/blob/master/doc/CONTRIBUTING.md#reporting-bugs>`_.

View File

@@ -1,12 +0,0 @@
Guides & Tips
=============
Getting Started Guide for Intermediate Programmers
Beginners FAQ
.. toctree::
:maxdepth: 3
Getting Started Guide for Beginner Programmers <guidesandtips/gettingstartedguideforbeginnerprogrammers>
What BitNode should I do?<guidesandtips/recommendedbitnodeorder>

View File

@@ -1,902 +0,0 @@
Getting Started Guide for Beginner Programmers
==============================================
.. note:: Note that the scripts and strategies given in this guide aren't necessarily
optimal. They're just meant to introduce you to the game and help you get
started.
This is an introductory guide to getting started with Bitburner. It is not meant to be a
comprehensive guide for the entire game, only the early stages. If you are confused
or overwhelmed by the game, especially the programming and scripting aspects, this
guide is perfect for you!
Note that this guide is tailored towards those with minimal programming experience.
Introduction
------------
Bitburner is a cyberpunk-themed incremental RPG. The player progresses by raising
their :ref:`gameplay_stats`, earning money, and :ref:`climbing the corporate ladder <gameplay_companies>`.
Eventually, after reaching certain criteria, the player will begin receiving invitations
from :ref:`gameplay_factions`. Joining these factions and working for them will unlock
:ref:`gameplay_augmentations`. Purchasing and installing Augmentations provide persistent
upgrades and are necessary for progressing in the game.
The game has a minimal story/quest-line that can be followed to reach the end of the game.
Since this guide is only about getting started with Bitburner, it will not cover the
entire "quest-line".
First Steps
-----------
I'm going to assume you followed the introductory tutorial when you first began the game.
In this introductory tutorial you created a script called :code:`n00dles.js` and ran it
on the :code:`n00dles` server. Right now, we'll kill this script. There are two ways
to do this:
1. You can go to the Terminal and enter::
$ kill n00dles.js
2. You can go to the :code:`Active Scripts` page (|Keyboard shortcut| Alt + s) and
press the "Kill Script" button for :code:`n00dles.js`.
If you skipped the introductory tutorial, then ignore the part above. Instead, go to the
:code:`Hacknet Nodes` page (|Keyboard shortcut| Alt + h) and purchase a
Hacknet Node to start generating some passive income.
Creating our First Script
-------------------------
Now, we'll create a generic hacking script that can be used early on in the game (or throughout the
entire game, if you want).
Before we write the script, here are some things you'll want to familiarize yourself with:
* :ref:`gameplay_hacking_generalhackingmechanics`
* :ref:`gameplay_hacking_serversecurity`
* :js:func:`hack`
* :js:func:`grow`
* :js:func:`weaken`
* :js:func:`brutessh`
* :js:func:`nuke`
To briefly summarize the information from the links above: Each server has a
security level that affects how difficult it is to hack. Each server also has a
certain amount of money, as well as a maximum amount of money it can hold. Hacking a
server steals a percentage of that server's money. The :js:func:`hack` Netscript function
is used to hack a server. The :js:func:`grow` Netscript function is used to increase
the amount of money available on a server. The :js:func:`weaken` Netscript function is
used to decrease a server's security level.
Now let's move on to actually creating the script.
Go to your home computer and then create a script called :code:`early-hack-template.js` by
going to Terminal and entering the following two commands::
$ home
$ nano early-hack-template.js
This will take you to the script editor, which you can use to code and create
:ref:`gameplay_scripts`. It will be helpful to consult the :ref:`netscript` documentation.
Specifically, you'll want to take a look at :ref:`netscriptfunctions`.
Enter the following code in the script editor:
.. code:: javascript
/** @param {NS} ns */
export async function main(ns) {
// Defines the "target server", which is the server
// that we're going to hack. In this case, it's "n00dles"
const target = "n00dles";
// Defines how much money a server should have before we hack it
// In this case, it is set to 75% of the server's max money
const moneyThresh = ns.getServerMaxMoney(target) * 0.75;
// Defines the maximum security level the target server can
// have. If the target's security level is higher than this,
// we'll weaken it before doing anything else
const securityThresh = ns.getServerMinSecurityLevel(target) + 5;
// If we have the BruteSSH.exe program, use it to open the SSH Port
// on the target server
if (ns.fileExists("BruteSSH.exe", "home")) {
ns.brutessh(target);
}
// Get root access to target server
ns.nuke(target);
// Infinite loop that continously hacks/grows/weakens the target server
while(true) {
if (ns.getServerSecurityLevel(target) > securityThresh) {
// If the server's security level is above our threshold, weaken it
await ns.weaken(target);
} else if (ns.getServerMoneyAvailable(target) < moneyThresh) {
// If the server's money is less than our threshold, grow it
await ns.grow(target);
} else {
// Otherwise, hack it
await ns.hack(target);
}
}
}
The script above contains comments that document what it does, but let's go through it
step-by-step anyways.
.. code:: javascript
const target = "n00dles";
This first command defines a string which contains our target server. That's the server
that we're going to hack. For now, it's set to `n00dles` because that's the only
server with a required hacking level of 1. If you want to hack a different server,
simply change this
variable to be the hostname of another server.
.. code:: javascript
const moneyThresh = ns.getServerMaxMoney(target) * 0.75;
This second command defines a numerical value representing the minimum
amount of money that must be available on the target server in order for our script
to hack it. If the money available on the target server is less than this value,
then our script will :js:func:`grow` the server rather than hacking it.
It is set to 75% of the maximum amount of money that can be available on the server.
The :js:func:`getServerMaxMoney` Netscript function is used to find this value
.. code:: javascript
const securityThresh = ns.getServerMinSecurityLevel(target) + 5;
This third command defines a numerical value representing the maximum security level
the target server can have. If the target server's security level is higher than
this value, then our script will :js:func:`weaken` the script before doing anything else.
.. code:: javascript
if (ns.fileExists("BruteSSH.exe", "home")) {
ns.brutessh(target);
}
ns.nuke(target);
This section of code is used to gain root access on the target server. This is
necessary for hacking. See :ref:`here for more details <gameplay_hacking>`.
.. code:: javascript
while (true) {
if (ns.getServerSecurityLevel(target) > securityThresh) {
// If the server's security level is above our threshold, weaken it
await ns.weaken(target);
} else if (ns.getServerMoneyAvailable(target) < moneyThresh) {
// Otherwise, if the server's money is less than our threshold, grow it
await ns.grow(target);
} else {
// Otherwise, hack it
await ns.hack(target);
}
}
This is the main section that drives our script. It dictates the script's logic
and carries out the hacking operations. The `while (true)` creates an infinite loop
that will continuously run the hacking logic until the the script is killed.
The await keyword is needed for `hack` / `grow` / `weaken` because these commands take
time to execute, unlike the others. If you forget to await these commands, you will get
an exception saying you tried to do multiple things at once, because your code will
immediately finish the function call without waiting for the operation to be done. Also
important is that await can only be used in functions marked async (which main() is).
Running our Scripts
-------------------
Now we want to start running our hacking script so that it can start earning us
money and experience. Our home computer only has 8GB of RAM and we'll be using it for
something else later. So instead, we'll take advantage of the RAM on other machines.
Go to |Terminal| and enter the following command::
$ scan-analyze 2
This will show detailed information about some servers on the network. The
**network is randomized so it will be different for every person**.
Here's what mine showed at the time I made this::
[home ~]> scan-analyze 2
~~~~~~~~~~ Beginning scan-analyze ~~~~~~~~~~
n00dles
--Root Access: YES, Required hacking skill: 1
--Number of open ports required to NUKE: 0
--RAM: 4.00GB
----zer0
------Root Access: NO, Required hacking skill: 75
------Number of open ports required to NUKE: 1
------RAM: 32.00GB
foodnstuff
--Root Access: NO, Required hacking skill: 1
--Number of open ports required to NUKE: 0
--RAM: 16.00GB
sigma-cosmetics
--Root Access: NO, Required hacking skill: 5
--Number of open ports required to NUKE: 0
--RAM: 16.00GB
joesguns
--Root Access: NO, Required hacking skill: 10
--Number of open ports required to NUKE: 0
--RAM: 16.00GB
----max-hardware
------Root Access: NO, Required hacking skill: 80
------Number of open ports required to NUKE: 1
------RAM: 32.00GB
----CSEC
------Root Access: NO, Required hacking skill: 54
------Number of open ports required to NUKE: 1
------RAM: 8.00GB
hong-fang-tea
--Root Access: NO, Required hacking skill: 30
--Number of open ports required to NUKE: 0
--RAM: 16.00GB
----nectar-net
------Root Access: NO, Required hacking skill: 20
------Number of open ports required to NUKE: 0
------RAM: 16.00GB
harakiri-sushi
--Root Access: NO, Required hacking skill: 40
--Number of open ports required to NUKE: 0
--RAM: 16.00GB
iron-gym
--Root Access: NO, Required hacking skill: 100
--Number of open ports required to NUKE: 1
--RAM: 32.00GB
Take note of the following servers:
* |sigma-cosmetics|
* |joesguns|
* |nectar-net|
* |hong-fang-tea|
* |harakiri-sushi|
All of these servers have 16GB of RAM. Furthermore, all of these servers do not require
any open ports in order to NUKE. In other words, we can gain root access to all of these
servers and then run scripts on them.
First, let's determine how many threads of our hacking script we can run.
:ref:`Read more about multithreading scripts here <gameplay_scripts_multithreadingscripts>`
The script we wrote
uses 2.6GB of RAM. You can check this using the following |Terminal| command::
$ mem early-hack-template.js
This means we can run 6 threads on a 16GB server. Now, to run our scripts on all of these
servers, we have to do the following:
1. Use the :ref:`scp_terminal_command` |Terminal| command to copy our script to each server.
2. Use the :ref:`connect_terminal_command` |Terminal| command to connect to a server.
3. Use the :ref:`run_terminal_command` |Terminal| command to run the `NUKE.exe` program and
gain root access.
4. Use the :ref:`run_terminal_command` |Terminal| command again to run our script.
5. Repeat steps 2-4 for each server.
Here's the sequence of |Terminal| commands I used in order to achieve this::
$ home
$ scp early-hack-template.js n00dles
$ scp early-hack-template.js sigma-cosmetics
$ scp early-hack-template.js joesguns
$ scp early-hack-template.js nectar-net
$ scp early-hack-template.js hong-fang-tea
$ scp early-hack-template.js harakiri-sushi
$ connect n00dles
$ run NUKE.exe
$ run early-hack-template.js -t 1
$ home
$ connect sigma-cosmetics
$ run NUKE.exe
$ run early-hack-template.js -t 6
$ home
$ connect joesguns
$ run NUKE.exe
$ run early-hack-template.js -t 6
$ home
$ connect hong-fang-tea
$ run NUKE.exe
$ run early-hack-template.js -t 6
$ home
$ connect harakiri-sushi
$ run NUKE.exe
$ run early-hack-template.js -t 6
$ home
$ connect hong-fang-tea
$ connect nectar-net
$ run NUKE.exe
$ run early-hack-template.js -t 6
.. note::
Pressing the :code:`Tab` key in the middle of a Terminal command will attempt to
auto-complete the command. For example, if you type in :code:`scp ea` and then
hit :code:`Tab`, the rest of the script's name should automatically be filled in.
This works for most commands in the game!
The :ref:`home_terminal_command` |Terminal| command is used to connect to the home
computer. When running our scripts with the :code:`run early-hack-template.js -t 6`
command, the :code:`-t 6` specifies that the script should be run with 6 threads.
Note that the |nectar-net| server isn't in the home computer's immediate network.
This means you can't directly connect to it from home. You will have to search for it
inside the network. The results of the `scan-analyze 2` command we ran before
will show where it is. In my case, I could connect to it by going from
`hong-fang-tea -> nectar-net`. However, this will probably be different for you.
After running all of these |Terminal| commands, our scripts are now up and running.
These will earn money and hacking experience over time. These gains will be
really slow right now, but they will increase once our hacking skill rises and
we start running more scripts.
Increasing Hacking Level
------------------------
There are many servers besides |n00dles| that can be hacked, but they have
higher required hacking levels. Therefore, we should raise our hacking level. Not only
will this let us hack more servers, but it will also increase the effectiveness of our hacking
against |n00dles|.
The easiest way to train your hacking level is to visit Rothman University. You can do this by
clicking the `City` tab on the left-hand navigation menu, or you can use the
:ref:`keyboard shortcut <shortcuts>` Alt + w. Rothman University should be one of the buttons
near the top. Click the button to go to the location.
Once you go to Rothman University, you should see a screen with several options. These
options describe different courses you can take. You should click the first button, which
says: "Study Computer Science (free)".
After you click the button, you will start studying and earning hacking experience. While you
are doing this, you cannot interact with any other part of the game until you click the button
that says "Stop taking course".
Right now, we want a hacking level of 10. You need approximately 174 hacking experience to reach
level 10. You can check how much hacking experience you have by clicking the `Stats` tab
on the left-hand navigation menu, or by using |Keyboard shortcut| Alt + c.
Since studying at Rothman University earns you 1 experience per second, this will take
174 seconds, or approximately 3 minutes. Feel free to do something in the meantime!
Editing our Hacking Script
--------------------------
Now that we have a hacking level of 10, we can hack the :code:`joesguns` server. This server
will be slightly more profitable than :code:`n00dles`. Therefore, we want to change our hacking
script to target :code:`joesguns` instead of :code:`n00dles`.
Go to |Terminal| and edit the hacking script by entering::
$ home
$ nano early-hack-template.js
At the top of the script, change the `target` variable to be `joesguns`:
.. code:: javascript
const target = "joesguns";
Note that this will **NOT** affect any instances of the script that are already running.
This will only affect instances of the script that are ran from this point forward.
Creating a New Script to Purchase New Servers
---------------------------------------------
Next, we're going to create a script that automatically purchases additional servers. These
servers will be used to run many scripts. Running this script will initially be very
expensive since purchasing a server costs money, but it will pay off in the long run.
In order to create this script, you should familiarize yourself with the following
Netscript functions:
* :js:func:`purchaseServer`
* :js:func:`getPurchasedServerCost`
* :js:func:`getPurchasedServerLimit`
* :js:func:`getServerMoneyAvailable`
* :js:func:`scp`
* :js:func:`exec`
Create the script by going to |Terminal| and typing::
$ home
$ nano purchase-server-8gb.js
Paste the following code into the script editor:
.. code:: javascript
/** @param {NS} ns */
export async function main(ns) {
// How much RAM each purchased server will have. In this case, it'll
// be 8GB.
const ram = 8;
// Iterator we'll use for our loop
let i = 0;
// Continuously try to purchase servers until we've reached the maximum
// amount of servers
while (i < ns.getPurchasedServerLimit()) {
// Check if we have enough money to purchase a server
if (ns.getServerMoneyAvailable("home") > ns.getPurchasedServerCost(ram)) {
// If we have enough money, then:
// 1. Purchase the server
// 2. Copy our hacking script onto the newly-purchased server
// 3. Run our hacking script on the newly-purchased server with 3 threads
// 4. Increment our iterator to indicate that we've bought a new server
let hostname = ns.purchaseServer("pserv-" + i, ram);
ns.scp("early-hack-template.js", hostname);
ns.exec("early-hack-template.js", hostname, 3);
++i;
}
//Make the script wait for a second before looping again.
//Removing this line will cause an infinite loop and crash the game.
await ns.sleep(1000);
}
}
This code uses a while loop to purchase the maximum amount of servers using the
:js:func:`purchaseServer` Netscript function. Each of these servers will have
8GB of RAM, as defined in the :code:`ram` variable. Note that the script uses the command
:code:`getServerMoneyAvailable("home")` to get the amount of money you currently have.
This is then used to check if you can afford to purchase a server.
Whenever the script purchases a new server, it uses the :js:func:`scp` function to copy
our script onto that new server, and then it uses the :js:func:`exec` function to
execute it on that server.
To run this script, go to |Terminal| and type::
$ run purchase-server-8gb.js
This purchase will continuously run until it has purchased the maximum number of servers.
When this happens, it'll mean that you have a bunch of new servers that are all running
hacking scripts against the :code:`joesguns` server!
.. note::
The reason we're using so many scripts to hack :code:`joesguns` instead of targeting other
servers is because it's more effective. This early in the game, we don't have enough RAM
to efficiently hack multiple targets, and trying to do so would be slow as we'd be spread
too thin. You should definitely do this later on, though!
Note that purchasing a server is fairly expensive, and purchasing the maximum amount of
servers even more so. At the time of writing this guide, the script above requires
$11 million in order to finish purchasing all of the 8GB servers.
Therefore, we need to find additional ways to make money to speed
up the process! These are covered in the next section.
Additional Sources of Income
----------------------------
There are other ways to gain money in this game besides scripts & hacking.
Hacknet Nodes
^^^^^^^^^^^^^
If you completed the introductory tutorial, you were already introduced to this method: Hacknet Nodes.
Once you have enough money, you can start upgrading your Hacknet Nodes in order to increase
your passive income stream. This is completely optional. Since each Hacknet Node upgrade
takes a certain amount of time to "pay itself off", it may not necessarily be in your best
interest to use these.
Nonetheless, Hacknet Nodes are a good source of income early in the game, although
their effectiveness tapers off later on. If you do wind up purchasing and upgrading Hacknet Nodes,
I would suggest only upgrading their levels for now. I wouldn't bother with RAM and Core
upgrades until later on.
Crime
^^^^^
The best source of income right now is from :ref:`committing crimes <gameplay_crimes>`.
This is because it not only gives you a large amount of money, but it also raises your
hacking level. To commit crimes, click on the :code:`City` tab on the left-hand
navigation menu or use the |Keyboard shortcut| Alt + w.
Then, click on the link that says :code:`The Slums`.
In the Slums, you can attempt to commit a variety of crimes, each of which gives certain
types of experience and money if successful. See :ref:`gameplay_crimes` for more details.
.. note::
You are not always successful when you attempt to commit a crime. Nothing bad happens
if you fail a crime, but you won't earn any money and the experience gained will be
reduced. Raising your stats improves your chance of successfully committing a crime.
Right now, the best option is the :code:`Rob Store` crime. This takes 60 seconds to attempt
and gives $400k if successful. I suggest this crime because you don't have to click or check
in too often since it takes a whole minute to attempt. Furthermore, it gives hacking experience,
which is very important right now.
Alternatively, you can also use the :code:`Shoplift` crime. This takes 2 seconds to attempt
and gives $15k if successful. This crime is slightly easier and is more profitable
than :code:`Rob Store`, but it requires constant clicking and it doesn't give
hacking experience.
Work for a Company
^^^^^^^^^^^^^^^^^^
If you don't want to constantly check in on the game to commit crimes, there's another option
that's much more passive: working for a :ref:`company <gameplay_companies>`.
This will not be nearly as profitable as crimes, but it's completely passive.
Go to the :code:`City` tab on the left-hand navigation menu and then go to
:code:`Joe's Guns`. At :code:`Joe's Guns`, there will be an option that says
:code:`Apply to be an Employee`. Click this to get the job. Then, a new option
will appear that simply says :code:`Work`. Click this to start working.
Working at :code:`Joe's Guns` earns $110 per second and also grants some experience
for every stat except hacking.
Working for a company is completely passive. You can choose to focus on your work, do
something else simultaneously, or switch between those two. While you focus on work,
you will not be able to do anything else in the game. If you do something else meanwhile,
you will not gain reputation at the same speed. You can cancel working at any time.
You'll notice that cancelling your work early causes you to lose out on some reputation
gains, but you shouldn't worry about this. Company reputation isn't important right now.
Once your hacking hits level 75, you can visit :code:`Carmichael Security` in the city
and get a software job there. This job offers higher pay and also earns you
hacking experience.
There are many more companies in the |City tab| that offer more pay and also more gameplay
features. Feel free to explore!
After you Purchase your New Servers
-----------------------------------
After you've made a total of $11 million, your automatic server-purchasing script should
finish running. This will free up some RAM on your home computer. We don't want this RAM
to go to waste, so we'll make use of it. Go to |Terminal| and enter the following commands::
$ home
$ run early-hack-template.js -t 3
Reaching a Hacking Level of 50
------------------------------
Once you reach a hacking level of 50, two new important parts of the game open up.
Creating your first program: BruteSSH.exe
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
On the left-hand navigation menu you will notice a :code:`Create Programs` tab with a
red notification icon. This indicates that there are programs available to be created.
Click on that tab (or use |Keyboard shortcut| Alt + p) and you'll see a
list of all the programs you can currently create. Hovering over a program will give a
brief description of its function. Simply click on a program to start creating it.
Right now, the program we want to create is :code:`BruteSSH.exe`. This program is used
to open up SSH ports on servers. This will allow you to hack more servers,
as many servers in the game require a certain number of opened ports in order for
:code:`NUKE.exe` to gain root access.
When you are creating a program, you cannot interact with any other part of the game.
Feel free to cancel your work on creating a program at any time, as your progress will
be saved and can be picked back up later. :code:`BruteSSH.exe` takes about
10 minutes to complete.
Optional: Create AutoLink.exe
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
On the :code:`Create Programs` page, you will notice another program you can create
called :code:`AutoLink.exe`. If you don't mind waiting another 10-15 minutes, you should
go ahead and create this program. It makes it much less tedious to connect to other servers,
but it's not necessary for progressing.
Joining your first faction: CyberSec
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Shortly after you reached level 50 hacking, you should have received a message that
said this::
Message received from unknown sender:
We've been watching you. Your skills are very impressive. But you're wasting
your talents. If you join us, you can put your skills to good use and change
the world for the better. If you join us, we can unlock your full potential.
But first, you must pass our test. Find and hack our server using the Terminal.
-CyberSec
This message was saved as csec-test.msg onto your home computer.
If you didn't, or if you accidentally closed it, that's okay! Messages get saved onto
your home computer. Enter the following |Terminal| commands to view the message::
$ home
$ cat csec-test.msg
This message is part of the game's main "quest-line". It is a message from the
|CyberSec faction| that is asking you to pass their test.
Passing their test is simple, you just have to find their server and hack it through
the |Terminal|. Their server is called :code:`CSEC`.
To do this, we'll use the :ref:`scan_analyze_terminal_command`
Terminal command, just like we did before::
$ home
$ scan-analyze 2
This will show you the network for all servers that are up to 2 "nodes" away from
your home computer. Remember that the network is randomly generated so it'll look
different for everyone. Here's the relevant part of my :code:`scan-analyze` results::
>iron-gym
--Root Access: NO, Required hacking skill: 100
--Number of open ports required to NUKE: 1
--RAM: 32
---->zer0
------Root Access: NO, Required hacking skill: 75
------Number of open ports required to NUKE: 1
------RAM: 32
---->CSEC
------Root Access: NO, Required hacking skill: 54
------Number of open ports required to NUKE: 1
------RAM: 8
This tells me that I can reach :code:`CSEC` by going through :code:`iron-gym`::
$ connect iron-gym
$ connect CSEC
.. note::
If you created the :code:`AutoLink.exe` program earlier, then there is an easier
method of connecting to :code:`CSEC`. You'll notice that in the :code:`scan-analyze`
results, all of the server hostnames are white and underlined. You can simply
click one of the server hostnames in order to connect to it. So, simply click
:code:`CSEC`!
.. note::
Make sure you notice the required hacking skill for the :code:`CSEC` server.
This is a random value between 51 and 60. Although you receive the message
from CSEC once you hit 50 hacking, you cannot actually pass their test
until your hacking is high enough to install a backdoor on their server.
After you are connected to the :code:`CSEC` server, you can backdoor it. Note that this
server requires one open port in order to gain root access. We can open the SSH port
using the :code:`BruteSSH.exe` program we created earlier. In |Terminal|::
$ run BruteSSH.exe
$ run NUKE.exe
$ backdoor
After you successfully install the backdoor, you should receive a faction
invitation from |CyberSec| shortly afterwards. Accept it. If you accidentally
reject the invitation, that's okay. Just go to the :code:`Factions` tab
(|Keyboard shortcut| Alt + f) and you should see an option that lets you
accept the invitation.
Congrats! You just joined your first faction. Don't worry about doing anything
with this faction yet, we can come back to it later.
Using Additional Servers to Hack Joesguns
-----------------------------------------
Once you have the |BruteSSH| program, you will be able to gain root access
to several additional servers. These servers have more RAM that you can use to
run scripts. We'll use the RAM on these servers to run more scripts that target
:code:`joesguns`.
Copying our Scripts
^^^^^^^^^^^^^^^^^^^
The server's we'll be using to run our scripts are:
* :code:`neo-net`
* :code:`zer0`
* :code:`max-hardware`
* :code:`iron-gym`
All of these servers have 32GB of RAM. You can use the |Terminal| command
:code:`scan-analyze 3` to see for yourself. To copy our hacking scripts onto these servers,
go to |Terminal| and run::
$ home
$ scp early-hack-template.js neo-net
$ scp early-hack-template.js zer0
$ scp early-hack-template.js max-hardware
$ scp early-hack-template.js iron-gym
Since each of these servers has 32GB of RAM, we can run our hacking script with 12 threads
on each server. By now, you should know how to connect to servers. So find and connect to
each of the servers above using the :code:`scan-analyze 3` |Terminal| command. Then, use
following |Terminal| command to run our hacking
script with 12 threads::
$ run early-hack-template.js -t 12
Remember that if you have the |AutoLink| program, you can simply click on the hostname of a server
after running :ref:`scan_analyze_terminal_command` to connect to it.
Profiting from Scripts & Gaining Reputation with CyberSec
---------------------------------------------------------
Now it's time to play the waiting game. It will take some time for your scripts to start
earning money. Remember that most of your scripts are targeting |joesguns|. It will take a
bit for them to :js:func:`grow` and :js:func:`weaken` the server to the appropriate values
before they start hacking it. Once they do, however, the scripts will be very profitable.
.. note::
For reference, in about two hours after starting my first script, my scripts had a
production rate of $20k per second and had earned a total of $70 million.
(You can see these stats on the :code:`Active Scripts` tab).
After another 15 minutes, the production rate had increased to $25k per second
and the scripts had made an additional $55 million.
Your results will vary based on how fast you earned money from crime/working/hacknet nodes,
but this will hopefully give you a good indication of how much the scripts can earn.
In the meantime, we are going to be gaining reputation with the |CyberSec faction|.
Go to the |Factions tab| on the left-hand
navigation menu, and from there select |CyberSec|. In the middle of
the page there should be a button for :code:`Hacking Contracts`.
Click it to start earning reputation for the |CyberSec| faction (as well
as some hacking experience). The higher your hacking level, the more reputation you
will gain. Note that while you are working for a faction, you can choose to not interact
with the rest of the game in any way to gain reputation at full speed. You can also select to
do something else simultaneously, gaining reputation a bit more slowly, until you focus again.
You can cancel your faction work at any time with no penalty to your reputation gained so far.
Purchasing Upgrades and Augmentations
-------------------------------------
As I mentioned before, within 1-2 hours I had earned over $200 million. Now, it's time
to spend all of this money on some persistent upgrades to help progress!
Upgrading RAM on Home computer
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The most important thing to upgrade right now is the RAM on your home computer. This
will allow you to run more scripts.
To upgrade your RAM, go to the |City tab| and visit the company |Alpha Enterprises|.
There will be an option that says :code:`Purchase additional RAM for Home Computer`.
Click it and follow the dialog box to upgrade your RAM.
I recommend getting your home computer's RAM to *at least* 128GB. Getting it even
higher would be better.
Purchasing your First Augmentations
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Once you get ~1000 reputation with the |CyberSec faction|, you can purchase
your first :ref:`Augmentation <gameplay_augmentations>` from them.
To do this, go to the |Factions tab| on the left-hand navigation menu
(|Keyboard shortcut| Alt + f) and select |CyberSec|. There is an button
near the bottom that says :code:`Purchase Augmentations`. This will bring up a
page that displays all of the Augmentations available from |CyberSec|. Some of them
may be locked right now. To unlock these, you will need to earn more
reputation with |CyberSec|.
Augmentations give persistent upgrades in the form of multipliers. These aren't very
powerful early in the game because the multipliers are small. However, the effects
of Augmentations stack multiplicatively **with each other**, so as you continue to install
many Augmentations their effects will increase significantly.
Because of this, I would recommend investing more in RAM upgrades for your home computer rather
than Augmentations early on. Having enough RAM to run many scripts will allow you to make
much more money, and then you can come back later on and get all these Augmentations.
Right now, I suggest purchasing at the very least the :code:`Neurotrainer I` Augmentation from
|CyberSec|. If you have the money to spare, I would also suggest getting :code:`BitWire` and
several levels of the :code:`NeuroFlux Governor` (:code:`NFG`) Augmentations. Note that each time
you purchase an Augmentation,
:ref:`the price of purchasing another increases by 90% <gameplay_augmentations_purchasingmultiple>`,
so make sure you buy the most expensive Augmentation first. Don't worry, once you choose to
install Augmentations, their prices will reset back to their original values.
Next Steps
----------
That's the end of the walkthrough portion of this guide! You should continue to explore
what the game has to offer. There's quite a few features that aren't covered or mentioned
in this guide, and even more that get unlocked as you continue to play!
Also, check out the :ref:`netscript` documentation to see what it has to offer. Writing
scripts to perform and automate various tasks is where most of the fun in the game comes
from (in my opinion)!
The following are a few things you may want to consider doing in the near future.
Installing Augmentations (and Resetting)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
If you've purchased any :ref:`gameplay_augmentations`, you'll need to install them before you
actually gain their effects. Installing Augmentations is the game's "soft-reset" or "prestige"
mechanic. You can :ref:`read more details about it here <gameplay_augmentations_installing>`.
To install your Augmentations, click the |Augmentations tab| on the left-hand navigation
menu (|Keyboard shortcut| Alt + a). You will see a list of all of the Augmentations
you have purchased. Below that, you will see a button that says :code:`Install Augmentations`.
Be warned, after clicking this there is no way to undo it (unless you load an earlier save).
Automating the Script Startup Process
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Whenever you install Augmentations, all of your scripts are killed and you'll have to
re-run them. Doing this every time you install Augmentations would be very tedious and annoying,
so you should write a script to automate the process. Here's a simple example for a
startup script. Feel free to adjust it to your liking.
.. code:: javascript
/** @param {NS} ns */
export async function main(ns) {
// Array of all servers that don't need any ports opened
// to gain root access. These have 16 GB of RAM
const servers0Port = ["sigma-cosmetics",
"joesguns",
"nectar-net",
"hong-fang-tea",
"harakiri-sushi"];
// Array of all servers that only need 1 port opened
// to gain root access. These have 32 GB of RAM
const servers1Port = ["neo-net",
"zer0",
"max-hardware",
"iron-gym"];
// Copy our scripts onto each server that requires 0 ports
// to gain root access. Then use nuke() to gain admin access and
// run the scripts.
for (let i = 0; i < servers0Port.length; ++i) {
const serv = servers0Port[i];
ns.scp("early-hack-template.js", serv);
ns.nuke(serv);
ns.exec("early-hack-template.js", serv, 6);
}
// Wait until we acquire the "BruteSSH.exe" program
while (!ns.fileExists("BruteSSH.exe")) {
await ns.sleep(60000);
}
// Copy our scripts onto each server that requires 1 port
// to gain root access. Then use brutessh() and nuke()
// to gain admin access and run the scripts.
for (let i = 0; i < servers1Port.length; ++i) {
const serv = servers1Port[i];
ns.scp("early-hack-template.js", serv);
ns.brutessh(serv);
ns.nuke(serv);
ns.exec("early-hack-template.sj", serv, 12);
}
}
Random Tips
-----------
* Early on in the game, it's better to spend your money on upgrading RAM and purchasing
new servers rather than spending it on Augmentations
* The more money available on a server, the more effective the :js:func:`hack` and
:js:func:`grow` Netscript functions will be. This is because both of these functions
use percentages rather than flat values. :js:func:`hack` steals a percentage of a server's
total available money, and :js:func:`grow` increases a server's money by X%.
* There is a limit to how much money can exist on a server. This value is different for each
server. The :js:func:`getServerMaxMoney` function will tell you this maximum value.
* At this stage in the game, your combat stats (strength, defense, etc.) are not nearly
as useful as your hacking stat. Do not invest too much time or money into gaining combat
stat exp.
* As a rule of thumb, your hacking target should be the server with highest max money that's
required hacking level is under 1/2 of your hacking level.
.. Substitution definitions
.. |Alpha Enterprises| replace:: :code:`Alpha Enterprises`
.. |Augmentations tab| replace:: :code:`Augmentations` tab
.. |AutoLink| replace:: :code:`AutoLink.exe`
.. |BruteSSH| replace:: :code:`BruteSSH.exe`
.. |City tab| replace:: :code:`City` tab
.. |CyberSec| replace:: :code:`CyberSec`
.. |CyberSec faction| replace:: :code:`CyberSec` :ref:`faction <gameplay_factions>`
.. |Factions tab| replace:: :code:`Factions` tab
.. |Keyboard shortcut| replace:: :ref:`Keyboard shortcut <shortcuts>`
.. |NUKE| replace:: :code:`NUKE.exe`
.. |Terminal| replace:: :code:`Terminal`
.. |n00dles| replace:: :code:`n00dles`
.. |harakiri-sushi| replace:: :code:`harakiri-sushi`
.. |hong-fang-tea| replace:: :code:`hong-fang-tea`
.. |joesguns| replace:: :code:`joesguns`
.. |nectar-net| replace:: :code:`nectar-net`
.. |sigma-cosmetics| replace:: :code:`sigma-cosmetics`

View File

@@ -1,593 +0,0 @@
What BitNode should I do?
=========================
.. warning:: This page contains spoilers regarding the game's story/plot-line.
After destroying their first :ref:`BitNode <gameplay_bitnodes>`, many players
wonder which BitNode they should tackle next. This guide hopefully helps answer
that question.
Overview of each BitNode
------------------------
BitNode-1: Source Genesis
^^^^^^^^^^^^^^^^^^^^^^^^^
Description
The first BitNode created by the Enders to imprison the minds of humans. It became
the prototype and testing-grounds for all of the BitNodes that followed.
This is the first BitNode that you play through. It has no special
modifications or mechanics.
Source-File
:Max Level: 3
This Source-File lets the player start with 32GB of RAM on his/her home computer when
entering a new BitNode, and also increases all of the player's multipliers by:
* Level 1: 16%
* Level 2: 24%
* Level 3: 28%
Difficulty
The easiest BitNode
BitNode-2: Rise of the Underworld
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
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
succumbed to the innate human impulse of evil and savagery. The organized crime
factions quickly rose to the top of the modern world.
In this BitNode:
* Your hacking level is reduced by 20%
* The growth rate and maximum amount of money available on servers are significantly decreased
* The amount of money gained from crimes and Infiltration is tripled
* Certain Factions (Slum Snakes, Tetrads, The Syndicate, The Dark Army, Speakers for the Dead,
NiteSec, The Black Hand) give the player the ability to form and manage their own gangs. These gangs
will earn the player money and reputation with the corresponding Faction
* Every Augmentation* in the game will be available through the Factions listed above
* For every Faction NOT listed above, reputation gains are halved
* You will no longer gain passive reputation with Factions
(* except Neuroflux Governor, The Red Pill and augments of secret factions)
Source-File
:Max Level: 3
This Source-File allows you to form gangs in other BitNodes once your karma decreases to a certain value.
It also increases the player's crime success rate, crime money, and charisma multipliers by:
* Level 1: 24%
* Level 2: 36%
* Level 3: 42%
Difficulty
Fairly easy, as hacking is still very profitable and the costs of various purchases/upgrades
is not increased. The gang mechanic may seem strange as its very different from anything
else, but it can be very powerful once you get the hang of it.
BitNode-3: Corporatocracy
^^^^^^^^^^^^^^^^^^^^^^^^^
Description
Our greatest illusion is that a healthy society can revolve around a
single-minded pursuit of wealth.
Sometime in the early 21st century economic and political globalization turned
the world into a corporatocracy, and it never looked back. Now, the privileged
elite will happily bankrupt their own countrymen, decimate their own community,
and evict their neighbors from houses in their desperate bid to increase their wealth.
In this BitNode you can create and manage your own corporation. Running a successful corporation
has the potential of generating massive profits. All other forms of income are reduced by 75%. Furthermore:
* The price and reputation cost of all Augmentations is tripled
* The starting and maximum amount of money on servers is reduced by 80%
* Server growth rate is reduced by 80%
* You now only need 75 favour with a faction in order to donate to it, rather than 150
Source-File
:Max Level: 3
This Source-File lets you create corporations on other BitNodes (although
some BitNodes will disable this mechanic) and level 3 permanently unlocks the full API. This Source-File also increases your
charisma and company salary multipliers by:
* Level 1: 8%
* Level 2: 12%
* Level 3: 14%
Difficulty
Somewhat-steep learning curve as you learn how to use and manage Corporations. Afterwards,
however, the BitNode is easy as Corporations can be very profitable.
BitNode-4: The Singularity
^^^^^^^^^^^^^^^^^^^^^^^^^^
Description
The Singularity has arrived. The human race is gone, replaced by artificially superintelligent
beings that are more machine than man.
In this BitNode, progressing is significantly harder:
* Experience gain rates for all stats are reduced.
* Most methods of earning money will now give significantly less.
In this BitNode you will gain access to a new set of Netscript Functions known as Singularity Functions.
These functions allow you to control most aspects of the game through scripts, including
working for factions/companies, purchasing/installing Augmentations, and creating programs.
Source-File
:Max Level: 3
This Source-File lets you access and use the Singularity Functions in other BitNodes.
Each level of this Source-File will reduce RAM costs:
* Level 1: 16x
* Level 2: 4x
* Level 3: 1x
Difficulty:
Depending on what Source-Files you have unlocked before attempting this BitNode,
it can range from easy to moderate.
BitNode-5: Artificial Intelligence
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Description
They said it couldn't be done. They said the human brain,
along with its consciousness and intelligence, couldn't be replicated. They said the complexity
of the brain results from unpredictable, nonlinear interactions that couldn't be modeled
by 1's and 0's. They were wrong.
In this BitNode:
* The base security level of servers is doubled
* The starting money on servers is halved, but the maximum money is doubled
* Most methods of earning money now give significantly less
* Infiltration gives 50% more reputation and money
* Corporations have 50% lower valuations and are therefore less profitable
* Augmentation price is doubled
* Hacking experience gain rates are reduced
Source-File
:Max Level: 3
This Source-File grants you a special new stat called Intelligence.
Intelligence is unique because it is permanent and persistent (it never gets reset back to 1). However
gaining Intelligence experience is much slower than other stats, and it is also hidden (you won't know
when you gain experience and how much). Higher Intelligence levels will boost your production for many actions
in the game.
In addition, this Source-File will unlock the :js:func:`getBitNodeMultipliers()` Netscript function,
and will also raise all of your hacking-related multipliers by:
* Level 1: 8%
* Level 2: 12%
* Level 3: 14%
Difficulty
Depending on what Source-Files you have unlocked before attempting this BitNode, it
can range from easy to moderate.
BitNode-6: Bladeburners
^^^^^^^^^^^^^^^^^^^^^^^
Description
In the middle of the 21st century, OmniTek Incorporated began designing and manufacturing advanced synthetic
androids, or Synthoids for short. They achieved a major technological breakthrough in the sixth generation
of their Synthoid design, called MK-VI, by developing a hyperintelligent AI. Many argue that this was
the first sentient AI ever created. This resulted in Synthoid models that were stronger, faster, and more intelligent
than the humans that had created them.
In this BitNode you will be able to access the Bladeburner Division at the NSA, which provides
a new mechanic for progression. Furthermore:
* Hacking and Hacknet Nodes will be less profitable
* Your hacking level is reduced by 65%
* Hacking experience gain is reduced by 75%
* Corporations have 80% lower valuations and are therefore less profitable
* Working for companies is 50% less profitable
* Crimes and Infiltration are 25% less profitable
Source-File
:Max Level: 3
This Source-File allows you to access the NSA's Bladeburner Division in other
BitNodes. In addition, this Source-File will raise both the level and experience
gain rate of all your combat stats by:
* Level 1: 8%
* Level 2: 12%
* Level 3: 14%
Difficulty
Initially difficult due to the fact that hacking is no longer profitable and you have
to learn a new mechanic. After you get the hang of the Bladeburner mechanic, however,
it becomes moderately easy.
BitNode-7: Bladeburners 2079
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Description
In the middle of the 21st century, you were doing cutting-edge work at OmniTek Incorporated
as part of the AI design team for advanced synthetic androids, or Synthoids for short. You helped
achieve a major technological breakthrough in the sixth generation of the company's Synthoid
design, called MK-VI, by developing a hyperintelligent AI. Many argue that this was the first
sentient AI ever created. This resulted in Synthoid models that were stronger, faster,
and more intelligent than the humans that had created them.
In this BitNode you will be able to access the Bladeburner API, which allows you to access
Bladeburner functionality through Netscript. Furthermore:
* The rank you gain from Bladeburner contracts/operations is reduced by 40%
* Bladeburner skills cost twice as many skill points
* Augmentations are 3x more expensive
* Hacking and Hacknet Nodes will be significantly less profitable
* Your hacking level is reduced by 65%
* Hacking experience gain is reduced by 75%
* Corporations have 80% lower valuations and are therefore less profitable
* Working for companies is 50% less profitable
* Crimes and Infiltration are 25% less profitable
Source-File
:Max Level: 3
This Source-File allows you to access the Bladeburner Netscript API in other
BitNodes. In addition, this Source-File will increase all of your Bladeburner multipliers by:
* Level 1: 8%
* Level 2: 12%
* Level 3: 14%
Difficulty
Slightly more difficult than BitNode-6. However, you will be able to automate more
aspects of the Bladeburner feature, which means it will be more passive.
BitNode-8: Ghost of Wall Street
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Description
You are trying to make a name for yourself as an up-and-coming hedge fund manager on Wall Street.
In this BitNode:
* You start with $250 million
* The only way to earn money is by trading on the stock market
* You start with a WSE membership and access to the TIX API
* You are able to short stocks and place different types of orders (limit/stop)
* You can immediately donate to factions to gain reputation
Source-File
:Max Level: 3
This Source-File grants the following benefits:
* Level 1: Permanent access to WSE and TIX API
* Level 2: Ability to short stocks in other BitNodes
* Level 3: Ability to use limit/stop orders in other BitNodes
This Source-File also increases your hacking growth multipliers by:
* Level 1: 12%
* Level 2: 18%
* Level 3: 21%
Difficulty
Very difficult until you unlock the Four Sigma (4S) Market Data API. After you
unlock the API however, it becomes moderately easy.
BitNode-9: Hacktocracy
^^^^^^^^^^^^^^^^^^^^^^
Description
When Fulcrum Technologies released their open-source Linux distro Chapeau, it quickly
became the OS of choice for the underground hacking community. Chapeau became especially
notorious for powering the Hacknet, a global, decentralized network used for nefarious
purposes. Fulcrum quickly abandoned the project and dissociated themselves from it.
This BitNode unlocks the Hacknet Server, an upgraded version of the Hacknet Node. Hacknet Servers generate
hashes, which can be spent on a variety of different upgrades.
In this BitNode:
* Your stats are significantly decreased
* You cannot purchase additional servers
* Hacking is significantly less profitable
Source-File
:Max Level: 3
This Source-File grants the following benefits:
* Level 1: Permanently unlocks the Hacknet Server in other BitNodes
* Level 2: You start with 128GB of RAM on your home computer when entering a new BitNode
* Level 3: Grants a highly-upgraded Hacknet Server when entering a new BitNode
(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:
* Level 1: 8%
* Level 2: 12%
* Level 3: 14%
Difficulty
Hard
BitNode-10: Digital Carbon
^^^^^^^^^^^^^^^^^^^^^^^^^^
Description
In 2084, VitaLife unveiled to the world the Persona Core, a technology that allowed people
to digitize their consciousness. Their consciousness could then be transferred into Synthoids
or other bodies by trasmitting the digitized data. Human bodies became nothing more than 'sleeves'
for the human consciousness. Mankind had finally achieved immortality - at least for those
that could afford it.
This BitNode unlocks Sleeve and grafting technologies. Sleeve technology allows you to:
1. Re-sleeve: Purchase and transfer your consciousness into a new body
2. Duplicate Sleeves: Duplicate your consciousness into Synthoids, allowing you to perform different tasks synchronously
Grafting technology allows you to graft Augmentations, which is an alternative way of installing Augmentations.
In this BitNode:
* Your stats are significantly decreased
* All methods of gaining money are half as profitable (except Stock Market)
* Purchased servers are more expensive, have less max RAM, and a lower maximum limit
* Augmentations are 5x as expensive and require twice as much reputation
Source-File
:Max Level: 3
This Source-File unlocks Sleeve and grafting technologies in other BitNodes.
Each level of this Source-File also grants you a Duplicate Sleeve.
Difficulty
Hard
BitNode-11: The Big Crash
^^^^^^^^^^^^^^^^^^^^^^^^^
Description
The 2050s was defined by the massive amounts of violent civil unrest and anarchic rebellion that rose all around the world. It was this period
of disorder that eventually lead to the governmental reformation of many global superpowers, most notably
the USA and China. But just as the world was slowly beginning to recover from these dark times, financial catastrophe hit.
In many countries, the high cost of trying to deal with the civil disorder bankrupted the governments. In all of this chaos and confusion, hackers
were able to steal billions of dollars from the world's largest electronic banks, prompting an international banking crisis as
governments were unable to bail out insolvent banks. Now, the world is slowly crumbling in the middle of the biggest economic crisis of all time.
In this BitNode:
* Your hacking stat and experience gain are reduced
* The starting and maximum amount of money available on servers are reduced by 90%
* The growth rate of servers is significantly reduced
* Weakening a server is twice as effective
* Company wages are decreased by 50%
* Corporation valuations are 90% lower and are therefore significantly less profitable
* Hacknet Node production is significantly decreased
* Crime and Infiltration are more lucrative
* Augmentations are twice as expensive
Source-File
:Max Level: 3
Destroying this BitNode will give you Source-File 11, or if you already have this Source-File it will
upgrade its level up to a maximum of 3. This Source-File makes it so that company favor increases BOTH
the player's salary and reputation gain rate at that company by 1% per favor (rather than just the reputation gain).
This Source-File also increases the player's company salary and reputation gain multipliers by:
* Level 1: 32%
* Level 2: 48%
* Level 3: 56%
This Source-File reduces the price increase for every aug bought by:
* Level 1: 4%
* Level 2: 6%
* Level 3: 7%
Difficulty
Hard
BitNode-12: The Recursion
^^^^^^^^^^^^^^^^^^^^^^^^^
Description
Every time this BitNode is destroyed, it becomes slightly harder.
Source-File
:Max Level: Infinity
Each level of Source-File 12 will let you start with Neuroflux Governor
equal to the level of this Source-File.
This BitNode is meant to be done passively or when waiting for new content.
Difficulty
Initially very easy, but then it (obviously) becomes harder as you continue to do it.
BitNode-13: They're lunatics
^^^^^^^^^^^^^^^^^^^^^^^^^
Description
With the invention of Augmentations in the 2040s a religious group known as the Church of the Machine God has rallied far more support than anyone would have hoped.
Their leader, Allison "Mother" Stanek is said to have created her own Augmentation whose power goes beyond any other. Find her in Chongqing and gain her trust.
In this BitNode:
* Your hacking stat is reduced by 75% and exp by 90%
* Your combat stats are reduced by 30%
* Class and gym exp gains halved
* The starting and maximum amount of money available on servers is decreased
* The starting security on servers is significantly increased
* Hacking money is decreased by 80%
* Company wages are decreased by 60% and exp gains by 50%
* Hacknet Node production is decreased by 60%
* Crime money is decreased by 60% and exp gains by 50%
* Stockmarket data costs are increased 10-fold
* Corporation valuations are 99.9% lower and are therefore extremely less profitable
* The rank you gain from Bladeburner contracts/operations is reduced by 55%
* Bladeburner skills cost twice as many skill points
* Coding contracts rewards reduced by 60%
* Gangs gain are reduced significantly and offer low amount of Augmentations
* Size of Stanek's Gift is increased by 1 size
Source-File
:Max Level: 3
Destroying this BitNode will give you Source-File 13, or if you already have this Source-File it will upgrade its level up to a maximum of 3.
This Source-File lets the Church of the Machine God appear in other BitNodes.
Each level of this Source-File increases the size of Stanek's Gift.
* Level 1: 5x5
* Level 2: 6x6
* Level 3: 7x7
Difficulty
Hard
Recommended BitNodes
--------------------
As a player, you are not forced to tackle the BitNodes in any particular order. You are
free to choose whichever ones you want. The "best" order can vary between players,
depending on what you like to do any what kind of player you are. In general, here
are the recommended BitNodes for different things:
For fast progression
^^^^^^^^^^^^^^^^^^^^
.. note:: These paths do not recommend the absolute fastest path, since speed of progression is
highly dependant on playing style. Path 1 is the recommended path according to the discord community.
Path 1 (new):
1. (Optional) Repeat **BitNode-1: Source Genesis** until you max out its Source-File. Its Source-File
is extremely powerful, as it raises all multipliers by a significant amount. This also a let's you
get used to augments and other features resetting.
2. Do **BitNode-3: Corporatocracy** at least once to unlock the Corporation mechanic, finishing all
3 levels unlocks the full API for free allowing fully scripted corp. This mechanic has highest
profit potential in the game.
3. Do **BitNode-10: Digital Carbon** once to unlock sleeves and grafting. Sleeves are useful in all nodes
and grafting can be useful in future BitNodes (especially 8). It's recommended to buy all purchasable sleeves and
their memory during the first run.
The ordering of the next three is dependant on playing style and wants/needs.
4. Do **BitNode-5: Artificial Intelligence** once or twice. The intelligence stat it unlocks
will gradually build up as you continue to play the game, and will be helpful
in the future. The Source-File also provides hacking multipliers, which are
strong because hacking is typically one of the best ways of earning money.
5. Do **BitNode-4: The Singularity**. Its Source-File does not directly make you
more powerful in any way, but it does unlock the `Singularity API <https://github.com/bitburner-official/bitburner-src/blob/dev/markdown/bitburner.singularity.md>`_ which
let you automate significantly more aspects of the game. Consider repeating until Level 3,
since each level decreases the RAM cost of Singularity functions.
6. Do **BitNode-2: Rise of the Underworld** once to unlock the gang mechanic. This mechanic
has high profit potential and offers large amounts of Augmentations in a single faction.
Having sleeves (Source-File 10) greatly reduces the time it takes to get access to gangs
outside this BitNode.
7. Do **BitNode-9: Hacktocracy** to unlock the Hacknet Server mechanic. You can
consider repeating it as well, as its Level 2 and 3 effects are pretty helpful as well.
Path 2 (old):
1. Repeat **BitNode-1: Source Genesis** until you max out its Source-File. Its Source-File
is extremely powerful, as it raises all multipliers by a significant amount.
2. Do **BitNode-5: Artificial Intelligence** once or twice. The intelligence stat it unlocks
will gradually build up as you continue to play the game, and will be helpful
in the future. The Source-File also provides hacking multipliers, which are
strong because hacking is typically one of the best ways of earning money.
3. (Optional) Consider doing **BitNode-4: The Singularity**. Its Source-File does not directly make you
more powerful in any way, but it does unlock the `Singularity API <https://github.com/bitburner-official/bitburner-src/blob/dev/markdown/bitburner.singularity.md>`_ which
let you automate significantly more aspects of the game.
4. Do **BitNode-3: Corporatocracy** once to unlock the Corporation mechanic. This mechanic
has high profit potential.
5. Do **BitNode-6: Bladeburners** once to unlock the Bladeburners mechanic. The Bladeburner
mechanic is useful for some of the future BitNodes (such as 9 and 10).
6. Do **BitNode-9: Hacktocracy** to unlock the Hacknet Server mechanic. You can
consider repeating it as well, as its Level 2 and 3 effects are pretty helpful as well.
.. todo:: To be continued as more BitNodes get added
For the strongest Source-Files
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Note that the strongest Source-Files are typically rewarded by the hardest BitNodes.
The strongest Source-File is that from **BitNode-1: Source Genesis**, as it raises
all multipliers by a significant amount.
Similarly, the Source-File from **BitNode-12: The Recursion** is also very strong
because it raises all multipliers. Each level of Source-File 12 is fairly weak,
but its effectiveness gets better over time since the effects of Source-Files and
Augmentations are multiplicative with each other.
The Source-File from **BitNode-9: Hacktocracy** is good because it unlocks the Hacknet
Server mechanic. The Hacknet Server mechanic causes Hacknet Nodes to produce a new
currency called *hashes*, rather than money. *Hashes* can be spent on powerful upgrades
that benefit your hacking, Corporation, Bladeburner, etc.
The Duplicate Sleeves granted by the Source-File from **BitNode-10: Digital Carbon**
are strong, but only after you have several of them and have spent some time/money upgrading
them.
For more scripting/hacking
^^^^^^^^^^^^^^^^^^^^^^^^^^
**BitNode-4: The Singularity** unlocks the `Singularity API <https://github.com/bitburner-official/bitburner-src/blob/dev/markdown/bitburner.singularity.md>`_, which
can be used to automate many different aspects of the game, including working for factions/companies,
purchasing & installing Augmentations, and creating programs
**BitNode-6** and **BitNode-7** unlock Bladeburner and its corresponding
`Netscript API <https://github.com/bitburner-official/bitburner-src/blob/dev/markdown/bitburner.bladeburner.md>`_. This allows you to automate an entire
new mechanic.
**BitNode-2: Rise of the Underworld** also unlocks a new mechanic and Netscript API for automating
it (the Gang mechanic). However, it is not as interesting as Bladeburner (in my opinion)
**BitNode-9: Hacktocracy** unlocks the Hacknet Server mechanic and several new
functions in the :ref:`Hacknet Node API <netscript_hacknetnodeapi>` for using it.
For new mechanics
^^^^^^^^^^^^^^^^^
**BitNode-2: Rise of the Underworld** unlocks a new mechanic in which you can
manage a gang. Gangs earn you money and can be very profitable once they get large
and powerful. The biggest benefit of gangs, however, is that they make all
Augmentations available to you through their corresponding faction.
**BitNode-3: Corporatocracy** unlocks a new mechanic in which you can manage a
corporation. You can earn money through Corporations by selling your stocks, or by
configuring your corporation to pay dividends to shareholders. If your Corporation
gets big enough, it can also bribe factions in exchange for faction reputation.
**BitNode-6: Bladeburners** unlocks a new mechanic that centers around combat rather
than hacking. The main benefit of the Bladeburner mechanic is that it offers a new
method of destroying a BitNode.
**BitNode-9: Hacktocracy** unlocks the Hacknet Server, which is an upgraded version of a
Hacknet Node. The Hacknet Server generates a computational unit called a *hash*. *Hashes*
can be spent on a variety of different upgrades that can benefit your hacking,
Corporation, Bladeburner progress, and more. It transforms the Hacknet Node from a
simple money-generator to a more interesting mechanic.
**BitNode-10: Digital Carbon** unlocks two new mechanics: Re-Sleeving and
Duplicate Sleeves.
**BitNode-13: They're lunatics** unlocks Stanek's Gift. This gift can improve skills,
hacknet production and costs, working and crime gains as well hacking power and speed.
For a Challenge
^^^^^^^^^^^^^^^
In general, the higher BitNodes are more difficult than the lower ones.
**BitNode-12: The Recursion** is an obvious exception as it gets progressively harder.
**BitNode-8: Ghost of Wall Street** provides a unique challenge as the only method
of earning money in that BitNode is through trading at the stock market.

View File

@@ -1,42 +0,0 @@
.. Bitburner documentation master file, created by
sphinx-quickstart on Wed Oct 4 15:03:07 2017.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
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/>`_.
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
secrets that you've been searching for.
.. toctree::
:maxdepth: 5
:caption: Contents:
Full documentation <https://github.com/bitburner-official/bitburner-src/blob/dev/markdown/bitburner.ns.md>
Basic documentation <netscript>
Basic Gameplay <basicgameplay>
Advanced Gameplay <advancedgameplay>
Remote API <remoteapi.rst>
Keyboard Shortcuts <shortcuts>
Game Frozen or Stuck? <gamefrozen>
Guides & Tips <guidesandtips>
Tools & Resources <toolsandresources>
Changelog <changelog>
v1.0.0 script migration guide <v1.0.0_migration.rst>
v2.0.0 script migration guide <v2.0.0_migration.rst>
404 <404.rst>
Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`

View File

@@ -1,26 +0,0 @@
.. _netscript:
Netscript
=========
Netscript is the programming language used in the world of Bitburner.
When you write scripts in Bitburner, they are written in the Netscript language.
Netscript is simply a subset of `JavaScript <https://developer.mozilla.org/en-US/docs/Web/JavaScript>`_.
This means that Netscript's syntax is
identical to that of JavaScript, but it does not implement some of the features
that JavaScript has.
.. toctree::
:maxdepth: 5
:caption: Sections:
Full documentation <https://github.com/bitburner-official/bitburner-src/blob/dev/markdown/bitburner.ns.md>
Learn to Program <netscript/netscriptlearntoprogram>
Netscript 1.0 <netscript/netscript1>
NetscriptJS (Netscript 2.0) <netscript/netscriptjs>
Script Arguments <netscript/netscriptscriptarguments>
Basic Functions <netscript/netscriptfunctions>
Advanced Functions <netscript/netscriptadvancedfunctions>
Hacknet Node API <netscript/netscripthacknetnodeapi>
Miscellaneous <netscript/netscriptmisc>

View File

@@ -1,39 +0,0 @@
autocomplete() Netscript Function
=================================
.. warning:: This feature is not officially supported yet and the API might change. It is also only supported in ns2
.. js:function:: autocomplete(data, args)
:RAM cost: 0 GB
:param Object data: general data about the game you might want to autocomplete.
:param string[] args: current arguments. Minus `run script.js`
data is an object with the following properties::
{
servers: list of all servers in the game.
txts: list of all text files on the current server.
scripts: list of all scripts on the current server.
flags: the same flags function as passed with ns. Calling this function adds all the flags as autocomplete arguments
}
This function is special as it must be declared as a top level function like `main`.
Example:
.. code-block:: javascript
export function autocomplete(data, args) {
return [...data.servers]; // This script autocompletes the list of servers.
return [...data.servers, ...data.scripts]; // Autocomplete servers and scripts
return ["low", "medium", "high"]; // Autocomplete 3 specific strings.
}
Terminal:
.. code-block:: bash
$ run demo.js mega\t
// results in
$ run demo.js megacorp

View File

@@ -1,35 +0,0 @@
Injecting HTML in the game
==========================
Bitburner uses React and Material-UI to render everything. Modifying the UI is possible but
not officially supported.
To automatically enter commands in the terminal (only works if looking at the terminal):
.. code-block:: javascript
// Acquire a reference to the terminal text field
const terminalInput = document.getElementById("terminal-input");
// Set the value to the command you want to run.
terminalInput.value="home;connect n00dles;home;connect n00dles;home;";
// Get a reference to the React event handler.
const handler = Object.keys(terminalInput)[1];
// Perform an onChange event to set some internal values.
terminalInput[handler].onChange({target:terminalInput});
// Simulate an enter press
terminalInput[handler].onKeyDown({key:'Enter',preventDefault:()=>null});
To add lines to the terminal (only works if looking at the terminal):
.. code-block:: javascript
// Acquire a reference to the terminal list of lines.
const list = document.getElementById("generic-react-container").querySelector("ul");
// Inject some HTML.
list.insertAdjacentHTML('beforeend',`<li><p color=lime>whatever custom html</p></li>`)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 60 KiB

View File

@@ -1,17 +0,0 @@
brutessh() Netscript Function
=============================
.. js:function:: brutessh(hostname)
:RAM cost: 0.05 GB
:param string hostname: Hostname of the target server.
Runs the ``BruteSSH.exe`` program on the target server. ``BruteSSH.exe``
must exist on your home computer.
Examples:
.. code-block:: javascript
ns.brutessh("foodnstuff");

View File

@@ -1,15 +0,0 @@
clearLog() Netscript Function
===============================
.. js:function:: clearLog()
:RAM cost: 0 GB
Clears the scripts logs.
Examples:
.. code-block:: javascript
//Opens the logs, clears it of whatever may have been there before and prevents non-print() functions from printing to log
ns.tail();ns.clearLog();ns.disableLog("ALL");

View File

@@ -1,19 +0,0 @@
closeTail() Netscript Function
===============================
.. js:function:: closeTail([scriptPid])
:RAM cost: 0 GB
:param number scriptPid: PID of the script of which to open the logs.
Closes a scripts logs.
If the function is called with no arguments, it will open the current scripts logs.
Examples:
.. code-block:: javascript
ns.closeTail(12);
ns.closeTail();

View File

@@ -1,21 +0,0 @@
deleteServer() Netscript Function
=================================
.. js:function:: deleteServer(hostname)
:RAM cost: 2.25 GB
:param string hostname: Hostname of the server to delete.
:returns: ``true`` if successful, ``false`` otherwise.
Deletes the specified purchased server.
The ``hostname`` argument can be any data type, but it will be converted to
a string. Whitespace is automatically removed from the string. This function
will not delete a server that still has scripts running on it.
Examples:
.. code-block:: javascript
ns.killall("dummyServer");
ns.deleteServer("dummyServer"); //returns: true if purhcased server 'dummyServer'existed

View File

@@ -1,18 +0,0 @@
disableLog() Netscript Function
===============================
.. js:function:: disableLog(functionName)
:RAM cost: 0 GB
:param string functionName: Name of function for which to disable logging.
Disables logging for the given function. Logging can be disabled for
all functions by passing 'ALL' as the argument. Print() can always print to log.
Examples:
.. code-block:: javascript
//Opens the logs, clears it of whatever may have been there before and prevents non-print() functions from logging
ns.tail();ns.clearLog();ns.disableLog("ALL");

View File

@@ -1,21 +0,0 @@
enableLog() Netscript Function
==============================
.. js:function:: enableLog(functionName)
:RAM cost: 0 GB
:param string functionName: Name of function for which to enable logging.
Re-enables logging for the given function. If 'ALL' is passed into this
function as an argument, then it will revert the effects of
``disableLog('ALL')``
Examples:
.. code-block:: javascript
//Opens the logs, clears it of whatever may have been there before and prevents non-print() functions from printing to log
ns.tail();ns.clearLog();ns.disableLog("ALL");
//let hack() log normally
ns.enableLog("hack");

View File

@@ -1,40 +0,0 @@
exec() Netscript Function
=========================
.. js:function:: exec(script, hostname[, numThreads=1[, args...]])
:RAM cost: 1.3 GB
: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
: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.
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
server, instead of just the current server.
.. warning:: Running this function with a ``numThreads`` argument of 0 or
less will cause a runtime error.
The simplest way to use the :doc:`exec<exec>` command is to call it with
just the script name and the target server. The following example will try
to run ``generic-hack.js`` on the ``foodnstuff`` server::
ns.exec("generic-hack.js", "foodnstuff");
The following example will try to run the script ``generic-hack.js`` on
the ``joesguns`` server with 10 threads::
ns.exec("generic-hack.js", "joesguns", 10);
This last example will try to run the script ``foo.js`` on the
``foodnstuff`` server with 5 threads. It will also pass the number 1 and the
string "test" in as arguments to the script::
ns.exec("foo.js", "foodnstuff", 5, 1, "test");

View File

@@ -1,29 +0,0 @@
fileExists() Netscript Function
===============================
.. js:function:: fileExists(filename[, hostname])
:RAM cost: 0.1 GB
:param string filename: Filename of file to check.
: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.
The filename for scripts is case-sensitive, but for other types of files it
is not. For example, ``fileExists("brutessh.exe")`` will work fine, even
though the actual program is named ``BruteSSH.exe``.
If the ``hostname`` argument is omitted, then the function will search
through the server running the script that calls this function for the file.
Examples:
.. code-block:: javascript
ns.fileExists("foo.js", "foodnstuff"); // returns: false
ns.fileExists("ftpcrack.exe"); // returns: true
The first example above will return true if the script named ``foo.js`` exists on the ``foodnstuff`` server, and false otherwise.
The second example above will return true if the current server contains the ``FTPCrack.exe`` program, and false otherwise.

View File

@@ -1,17 +0,0 @@
ftpcrack() Netscript Function
=============================
.. js:function:: ftpcrack(hostname)
:RAM cost: 0.05 GB
:param string hostname: Hostname of the target server.
Runs the ``FTPCrack.exe`` program on the target server. ``FTPCrack.exe``
must exist on your home computer.
Examples:
.. code-block:: javascript
ns.ftpcrack("foodnstuff");

View File

@@ -1,13 +0,0 @@
getHackingLevel() Netscript Function
====================================
.. js:function:: getHackingLevel()
:RAM cost: 0.05 GB
:returns: The player's current hacking level.
Example:
.. code-block:: javascript
ns.getHackingLevel(); // returns: 124

View File

@@ -1,26 +0,0 @@
getHackingMultipliers() Netscript Function
==========================================
.. js:function:: getHackingMultipliers()
:RAM cost: 0.25 GB
:returns: object containing the player's hacking multipliers. These
multipliers are returned in decimal forms, not percentages (e.g. 1.5
instead of 150%).
Structure::
{
chance: Player's hacking chance multiplier,
speed: Player's hacking speed multiplier,
money: Player's hacking money stolen multiplier,
growth: Player's hacking growth multiplier
}
Example:
.. code-block:: javascript
const mults = ns.getHackingMultipliers();
ns.print(mults.chance);
ns.print(mults.growth);

View File

@@ -1,27 +0,0 @@
getHacknetMultipliers() Netscript Function
==========================================
.. js:function:: getHacknetMultipliers()
:RAM cost: 0.25 GB
:returns: object containing the player's hacknet multipliers. These
multipliers are returned in decimal forms, not percentages (e.g. 1.5
instead of 150%).
Structure::
{
production: Player's hacknet production multiplier,
purchaseCost: Player's hacknet purchase cost multiplier,
ramCost: Player's hacknet ram cost multiplier,
coreCost: Player's hacknet core cost multiplier,
levelCost: Player's hacknet level cost multiplier
}
Example:
.. code-block:: javascript
const mults = ns.getHacknetMultipliers();
ns.print(mults.production);
ns.print(mults.purchaseCost);

View File

@@ -1,14 +0,0 @@
getHostname() Netscript Function
==============================
.. js:function:: getHostname()
:RAM cost: 0.05 GB
Returns a string with the hostname of the server that the script is running on.
Examples:
.. code-block:: javascript
ns.tprint(ns.getHostname())

View File

@@ -1,17 +0,0 @@
getPurchasedServerCost() Netscript Function
===========================================
.. js:function:: getPurchasedServerCost(ram)
:RAM cost: 0.25 GB
:param number ram: Amount of RAM of a potential purchased server. Must be a power of 2 (2, 4, 8, 16, etc.). Maximum value of :doc:`getPurchasedServerMaxRam<getPurchasedServerMaxRam>`
:returns: Cost to purchase a server with the specified amount of ``ram``.
Giving any non-power-of-2 as an argument results in the function returning `Infinity`
Example:
.. code-block:: javascript
ns.getPurchasedServerCost(8192); // returns: 450560000

View File

@@ -1,13 +0,0 @@
getPurchasedServerLimit() Netscript Function
============================================
.. js:function:: getPurchasedServerLimit()
:RAM cost: 0.05 GB
:returns: The maximum number of servers you can purchase.
Example:
.. code-block:: javascript
ns.getPurchasedServerLimit() // returns: 25

View File

@@ -1,13 +0,0 @@
getPurchasedServerMaxRam() Netscript Function
=============================================
.. js:function:: getPurchasedServerMaxRam()
:RAM cost: 0.05 GB
:returns: The maximum RAM that a purchased server can have.
Example:
.. code-block:: javascript
ns.getPurchasedServerMaxRam(); // returns: 1048576

View File

@@ -1,18 +0,0 @@
getPurchasedServerUpgradeCost() Netscript Function
===========================================
.. js:function:: getPurchasedServerUpgradeCost(hostname, ram)
:RAM cost: 0.1 GB
:param string hostname: Hostname of target purchased server.
:param number ram: Target amount of RAM for purchased server. Must be a power of 2 (2, 4, 8, 16, etc.). Maximum value of :doc:`getPurchasedServerMaxRam<getPurchasedServerMaxRam>`
:returns: Cost to purchase a server with the specified amount of ``ram``.
Giving any non-power-of-2 as an argument results in the function returning `-1`
Example:
.. code-block:: javascript
ns.purchaseServer("smallServer",2) //costs 110000
ns.getPurchasedServerUpgradeCost("smallServer",8); // returns: 330000

View File

@@ -1,13 +0,0 @@
getPurchasedServers() Netscript Function
========================================
.. js:function:: getPurchasedServers()
:RAM cost: 2.25 GB
:returns: String array of hostnames of all of the servers you have purchased.
Example:
.. code-block:: javascript
ns.getPurchasedServers(); // returns: ['grow-server-0', 'grow-server-1', 'weaken-server-0']

View File

@@ -1,16 +0,0 @@
getScriptRam() Netscript Function
=================================
.. js:function:: getScriptRam(filename[, hostname])
:RAM cost: 0.1 GB
:param string filename: Filename of script.
:param string hostname: Hostname of target server the script is located on.
Default to the server this script is running on.
:returns: Amount of RAM required to run the script, 0 if it does not exist.
Example:
.. code-block:: javascript
ns.getScriptRam("grow.js"); // returns: 1.75

View File

@@ -1,14 +0,0 @@
getServerMaxMoney() Netscript Function
======================================
.. js:function:: getServerMaxMoney(hostname)
:RAM cost: 0.1 GB
:param string hostname: Hostname of target server.
:returns: Maximum amount of money that can be available on a server.
Example:
.. code-block:: javascript
ns.getServerMaxMoney('foodnstuff'); // returns: 50000000

View File

@@ -1,15 +0,0 @@
getServerMaxRam() Netscript Function
====================================
.. js:function:: getServerMaxRam(hostname)
:RAM cost: 0.05 GB
:param string hostname: Hostname of target server.
:returns: Total ram available on that server. In GB.
Example:
.. code-block:: javascript
const maxRam = ns.getServerMaxRam("helios"); // returns: 16
ns.print("helios has "+maxRam + "GB");

View File

@@ -1,14 +0,0 @@
getServerMinSecurityLevel() Netscript Function
==============================================
.. js:function:: getServerMinSecurityLevel(hostname)
:RAM cost: 0.1 GB
:param string hostname: Hostname of target server.
:returns: The minimum security level of the target server.
Example:
.. code-block:: javascript
ns.getServerMinSecurityLevel('foodnstuff'); // returns: 3

View File

@@ -1,19 +0,0 @@
getServerMoneyAvailable() Netscript Function
============================================
.. js:function:: getServerMoneyAvailable(hostname)
:RAM cost: 0.1 GB
:param string hostname: Hostname of target server.
:returns: Money available on that server.
.. note::
Running this function on the home computer will return the player's money.
Example:
.. code-block:: javascript
ns.getServerMoneyAvailable("foodnstuff"); // returns: 120000
ns.getServerMoneyAvailable("home"); // returns: 1000

View File

@@ -1,15 +0,0 @@
getServerNumPortsRequired() Netscript Function
==============================================
.. js:function:: getServerNumPortsRequired(hostname)
:RAM cost: 0.1 GB
:param string hostname: Hostname of target server.
:returns: The number of open ports required to successfully run NUKE.exe on
the specified server.
Example:
.. code-block:: javascript
ns.getServerNumPortsRequired("unitalife"); // returns: 4

View File

@@ -1,14 +0,0 @@
getServerRequiredHackingLevel() Netscript Function
==================================================
.. js:function:: getServerRequiredHackingLevel(hostname)
:RAM cost: 0.1 GB
:param string hostname: Hostname of target server.
:returns: The required hacking level of target server.
Example:
.. code-block:: javascript
ns.getServerRequiredHackingLevel("foodnstuff"); // returns: 5

View File

@@ -1,14 +0,0 @@
getServerSecurityLevel() Netscript Function
===========================================
.. js:function:: getServerSecurityLevel(hostname)
:RAM cost: 0.1 GB
:param string hostname: Hostname of target server.
:returns: The security level of the target server.
Example:
.. code-block:: javascript
ns.getServerSecurityLevel("foodnstuff"); // returns: 3.45

View File

@@ -1,15 +0,0 @@
getServerUsedRam() Netscript Function
=====================================
.. js:function:: getServerUsedRam(hostname)
:RAM cost: 0.05 GB
:param string hostname: Hostname of target server.
:returns: Used ram on that server. In GB.
Example:
.. code-block:: javascript
const usedRam = ns.getServerUsedRam("harakiri-sushi"); // returns: 5.6
ns.print("harakiri-sushi uses "+ usedRam + "GB"); // prints: "harakiri-sushi uses 5.6GB"

View File

@@ -1,15 +0,0 @@
getSharePower() Netscript Function
==============================
.. js:function:: getSharePower()
: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.
Examples:
.. code-block:: javascript
ns.tprint(ns.getSharePower())

View File

@@ -1,38 +0,0 @@
grow() Netscript Function
=========================
.. js:function:: grow(hostname[, opts={}])
:RAM cost: 0.15 GB
:param string hostname: Hostname of the target server.
:param object opts: Optional parameters for configuring function behavior. Properties:
* threads (*number*) - Number of threads to use for this function.
Must be less than or equal to the number of threads the script is running with.
* stock (*boolean*) - If true, the function can affect the stock market. See
:ref:`gameplay_stock_market_player_actions_influencing_stock`
:returns: The number by which the money on the server was multiplied for the growth
Increase the amount of money available on a server. The time it takes to
execute depends on your hacking level and the target server's security
level. When :doc:`grow<grow>` completes, the money available on a target
server will be increased by the number of threads used and a certain, fixed percentage.
The percentage is determined by the target server's growth rate (which varies between servers)
and security level. Generally, higher-level servers have higher growth
rates.
Like :doc:`hack<hack>`, :doc:`grow<grow>` can be called on any server, from
any server. The :doc:`grow<grow>` command requires root access to the target
server, but there is no required hacking level to run the command. It also
raises the security level of the target server by 0.004 per thread.
Action time is calculated at the start, effect is calculated at the end.
Example:
.. code-block:: javascript
while(true) {
await ns.grow("foodnstuff");
}

View File

@@ -1,38 +0,0 @@
hack() Netscript Function
=========================
.. js:function:: hack(hostname[, opts={}])
:RAM cost: 0.1 GB
:param string hostname: Hostname of the target server.
:param object opts: Optional parameters for configuring function behavior. Properties:
* threads (*number*) - Number of threads to use for this function.
Must be less than or equal to the number of threads the script is running with.
* stock (*boolean*) - If true, the function can affect the stock market. See
:ref:`gameplay_stock_market_player_actions_influencing_stock`
:returns: The amount of money stolen if the hack is successful, and zero otherwise
Function that is used to try and hack servers to steal money and gain
hacking experience. The runtime for this command depends on your hacking
level and the target server's security level. In order to hack a server you
must first gain root access to that server and also have the required
hacking level.
A script can hack a server from anywhere. It does not need to be running on
the same server to hack that server. For example, you can create a script
that hacks the 'foodnstuff' server and run that script on any server in the
game.
A successful :doc:`hack<hack>` on a server will raise that server's security
level by 0.002.
Action time is calculated at the start, effect is calculated at the end.
Example:
.. code-block:: javascript
await ns.hack("foodnstuff");
await ns.hack("10.1.2.3");
await ns.hack("foodnstuff", { threads: 5 }); // Only use 5 threads to hack

View File

@@ -1,22 +0,0 @@
hasRootAccess() Netscript Function
==================================
.. js:function:: hasRootAccess(hostname)
:RAM cost: 0.05 GB
:param string hostname: Hostname of the target server.
:returns: ``true`` if you have root access on the target server.
Example:
.. code-block:: javascript
if (ns.hasRootAccess("foodnstuff") == false) {
ns.nuke("foodnstuff");
}
.. code-block:: javascript
if (ns.hasRootAccess("foodnstuff")) {
ns.exec("foo.js", 1, "foodnstuff");
}

View File

@@ -1,16 +0,0 @@
httpworm() Netscript Function
=============================
.. js:function:: httpworm(hostname)
:RAM cost: 0.05 GB
:param string hostname: Hostname of the target server.
Runs the ``HTTPWorm.exe`` program on the target server. ``HTTPWorm.exe``
must exist on your home computer.
Example:
.. code-block:: javascript
ns.httpworm("foodnstuff");

View File

@@ -1,14 +0,0 @@
isLogEnabled() Netscript Function
=================================
.. js:function:: isLogEnabled(functionName)
:RAM cost: 0 GB
:param string functionName: Name of function to check.
:returns: ``true`` is logs are enabled for this function or for 'ALL'
Example:
.. code-block:: javascript
ns.isLogEnabled('hack'); // returns: true

View File

@@ -1,55 +0,0 @@
isRunning() Netscript Function
==============================
.. js:function:: isRunning(filename[, hostname=current hostname[, args...]])
.. js:function:: isRunning(PID)
:RAM cost: 0.1 GB
:param string filename: Filename of script to check. case-sensitive.
:param string hostname: Hostname of target server. Defaults to current server
:param args...: Arguments to specify/identify which scripts to search for
:returns: ``true`` if that script with those args is running on that server.
.. note::
Remember that a script is uniquely identified by both its name and its arguments.
**Examples:**
In this first example below, the function call will return true if there is
a script named ``foo.js`` with no arguments running on the
``foodnstuff`` server, and false otherwise:
.. code-block:: javascript
ns.isRunning("foo.js", "foodnstuff");
In this second example below, the function call will return true if there is
a script named ``foo.js`` with no arguments running on the current
server, and false otherwise:
.. code-block:: javascript
ns.isRunning("foo.js", ns.getHostname());
In this next example below, the function call will return true if there is a
script named ``foo.script`` running with the arguments 1, 5, and "test" (in
that order) on the ``joesguns`` server, and false otherwise:
.. code-block:: javascript
ns.isRunning("foo.js", "joesguns", 1, 5, "test");
.. js:function:: isRunning(scriptPid)
:RAM cost: 0.1 GB
:param number scriptPid: PID of the script to check.
Same as the above version but with pid.
Example:
.. code-block:: javascript
ns.isRunning(39);

View File

@@ -1,59 +0,0 @@
kill() Netscript Function
=========================
.. js:function:: kill(script, [hostname=current hostname, [args...]])
.. js:function:: kill(PID)
:RAM cost: 0.5 GB
:param string script: Filename of the script to kill.
:param string hostname: Hostname of the server on which to kill the script.
:param args...: Arguments to identify which script to kill.
:returns: ``true`` is that script was killed.
Kills the script on the target server specified by the script's name and
arguments. Remember that scripts are uniquely identified by both their name
and arguments. For example, if ``foo.js`` is run with the argument 1,
then this is not the same as ``foo.js`` run with the argument 2, even
though they have the same code.
Examples:
The following example will try to kill a script named ``foo.js`` on the
``foodnstuff`` server that was ran with no arguments:
.. code-block:: javascript
ns.kill("foo.js", "foodnstuff");
The following will try to kill a script named ``foo.js`` on the current
server that was ran with no arguments:
.. code-block:: javascript
ns.kill("foo.js");
The following will try to kill a script named ``foo.js`` on the current
server that was ran with the arguments 1 and "foodnstuff":
.. code-block:: javascript
ns.kill("foo.js", ns.getHostname(), 1, "foodnstuff");
.. js:function:: kill(scriptPid)
:RAM cost: 0.5 GB
:param number scriptPid: PID of the script to kill
:returns: ``true`` that script was killed.
Kills the script with the specified PID. Killing a script by its PID will
typically have better performance, especially if you have many scripts
running.
Example:
.. code-block:: javascript
if (ns.kill(10)) {
ns.print("Killed script with PID 10!");
}

View File

@@ -1,24 +0,0 @@
killall() Netscript Function
============================
.. 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.
:param boolean safetyguard: Whether the function will safeguard the current script or not.
:returns: ``true`` if scripts were killed on target server.
Kills all running scripts on the specified server.
Example:
.. code-block:: javascript
ns.killall('foodnstuff'); // returns: true
.. code-block:: javascript
ns.killall(); // returns: true, kills all scripts on the current server, except the current script
ns.killall(); // returns: false, because all no available scripts are running anymore
ns.killall(ns.getHostname(),false) // returns: true, but also kills the current script

View File

@@ -1,17 +0,0 @@
ls() Netscript Function
=======================
.. js:function:: ls(hostname[, grep])
:RAM cost: 0.2 GB
:param string hostname: Hostname of the target server.
:param string grep: a substring to search for in the filename.
:returns: String array of all files in alphabetical order.
Example:
.. code-block:: javascript
ns.ls("home"); // returns: ["demo.js", "msg1.txt"]
ns.ls("home", ".txt"); // returns: ["msg1.txt"]
ns.ls("home", ".script"); // returns: []

View File

@@ -1,28 +0,0 @@
moveTail() Netscript Function
===============================
.. js:function:: moveTail(x , y[, pid])
:RAM cost: 0 GB
:param number x: X coordinate to move the tail window to.
:param number y: Y coordinate to move the tail window to.
:param number pid: PID of the script of which tail window to move. Defaults to current script.
Moves the tail window to the specified coordinates. The top left corner is (0,0).
.. note::
Due to inner workings, something has to be awaited between opening a tail window and moving or resizing it.
Examples:
.. code-block:: javascript
//open tail
ns.tail();
await ns.sleep(0);
//move the tail close to top left corner and make it big
ns.moveTail(10, 10);
ns.resizeTail(780, 510)

View File

@@ -1,18 +0,0 @@
mv() Netscript Function
==============================
.. js:function:: mv(serverName, sourceFile, targetFile)
:RAM cost: 0 GB
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.
This function can also be used to rename files.
Examples:
.. code-block:: javascript
ns.mv("home", "foo.js", "old_foo.txt")

View File

@@ -1,20 +0,0 @@
nFormat() Netscript Function
==============================
.. js:function:: nFormat(number, format)
:RAM cost: 0 GB
:param number number: Number to format.
:param string format: Formatting to use. Read http://numeraljs.com/#format for specifics.
onverts a number into a string with the specified formatter.
This uses the numeral.js library, so the formatters must be compatible with that.
Examples:
.. code-block:: javascript
ns.print(ns.nFormat(123456789.1,"0,0")) //logs "123,456,789"
ns.print(ns.nFormat(123456789.1,"0.00a")) //logs "123.46m"
ns.print(ns.nFormat(200000,"$0.00a")) //logs "$200.00k"

View File

@@ -1,18 +0,0 @@
nuke() Netscript Function
=========================
.. js:function:: nuke(hostname)
:RAM cost: 0.05 GB
:param string hostname: Hostname of the target server.
Runs the ``NUKE.exe`` program on the target server. ``NUKE.exe`` must exist
on your home computer. Requires the targeted server to have enough ports opened,
otherwise will throw an error.
Example:
.. code-block:: javascript
ns.nuke("foodnstuff");

View File

@@ -1,18 +0,0 @@
print() Netscript Function
===========================
.. js:function:: print(args...)
:RAM cost: 0 GB
:param args: Values to be printed.
Prints any number of values to the script's logs.
Example:
.. code-block:: javascript
ns.print("Hello world!"); // Prints "Hello world!" in the logs.
ns.print({a:5}); // Prints '{"a":5}' in the logs.
const text = "can"
ns.print("I "+ text +" use variables :)") // Prints "I can use variables :)"

View File

@@ -1,31 +0,0 @@
ps() Netscript Function
=======================
.. js:function:: ps([hostname=current hostname])
: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 an array with general information about all scripts running on the
specified target server. The information for each server is given in an
object with the following structure::
{
filename: Script name,
threads: Number of threads script is running with,
args: Script's arguments,
pid: Script's pid
}
Example:
.. code-block:: javascript
const processes = ns.ps("home");
for (const i = 0; i < processes.length; ++i) {
ns.tprint(processes[i].filename + ' ' + processes[i].threads);
ns.tprint(processes[i].args);
ns.tprint(processes[i].pid);
}

View File

@@ -1,34 +0,0 @@
purchaseServer() Netscript Function
===================================
.. js:function:: purchaseServer(hostname, ram)
:RAM cost: 2.25 GB
: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: The hostname of the newly purchased server. Empty string on failure.
Purchases a server with the specified hostname and amount of RAM.
The ``hostname`` argument can be any data type, but it will be converted to
a string and have whitespace removed. Anything that resolves to an empty
string will cause the function to fail. If there is already a server with
the specified hostname, then the function will automatically append a number
at the end of the ``hostname`` argument value until it finds a unique
hostname. For example, if the script calls ``purchaseServer("foo", 4)`` but
a server named "foo" already exists, the it will automatically change the
hostname to "foo-0". If there is already a server with the hostname "foo-0",
then it will change the hostname to "foo-1", and so on.
Note that there is a maximum limit to the amount of servers you can purchase.
Example:
.. code-block:: javascript
const ram = 64;
const name = "pserv-";
for (const i = 0; i < 5; ++i) {
ns.purchaseServer(name + i, ram);
}

View File

@@ -1,16 +0,0 @@
relaysmtp() Netscript Function
==============================
.. js:function:: relaysmtp(hostname)
:RAM cost: 0.05 GB
:param string hostname: Hostname of the target server.
Runs the ``relaySMTP.exe`` program on the target server. ``relaySMTP.exe``
must exist on your home computer.
Example:
.. code-block:: javascript
ns.relaysmtp("foodnstuff");

View File

@@ -1,28 +0,0 @@
resizeTail() Netscript Function
===============================
.. js:function:: resizeTail(width, heigth[, pid])
:RAM cost: 0 GB
:param number width: Width of the window.
:param number heigth: Heigth of the window.
:param number pid: PID of the script of which tail window to resize. Defaults to current script.
resizes the tail window to the specified size.
.. note::
Due to inner workings, something has to be awaited between opening a tail window and moving or resizing it.
Examples:
.. code-block:: javascript
//open tail
ns.tail();
await ns.sleep(0);
//move the tail close to top left corner and make it big
ns.moveTail(10, 10);
ns.resizeTail(780, 510)

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