merge dev

This commit is contained in:
Olivier Gagnon
2021-10-26 23:11:47 -04:00
82 changed files with 1280 additions and 793 deletions

View File

@@ -0,0 +1,35 @@
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({keyCode:13,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>`)

View File

@@ -7,7 +7,7 @@ toast() Netscript Function
:param string message: message to display
:param success|info|warning|error variant: color of the toast
Spawns a toast (those bottom right notifications).
Spawns a toast (those bottom right notifications, like "Game Saved!" ).
Example:

View File

@@ -0,0 +1,15 @@
getCityCommunities() Netscript Function
================================================
.. js:function:: getCityCommunities(cityName)
:RAM cost: 4 GB
:param string cityName: Name of city. Case-sensitive
:returns: Confirmed number of Synthoid communities in the specified city,
or -1 if an invalid city was specified.
Example:
.. code-block:: javascript
bladeburner.getCityCommunities("Sector-12"); // returns: 76

View File

@@ -1,15 +0,0 @@
getCityEstimatedCommunities() Netscript Function
================================================
.. js:function:: getCityEstimatedCommunities(cityName)
:RAM cost: 4 GB
:param string cityName: Name of city. Case-sensitive
:returns: Estimated number of Synthoid communities in the specified city,
or -1 if an invalid city was specified.
Example:
.. code-block:: javascript
bladeburner.getCityEstimatedCommunities("Sector-12"); // returns: 76

View File

@@ -11,3 +11,5 @@ they contain spoilers for the game.
getBitNodeMultipliers() <advancedfunctions/getBitNodeMultipliers>
getServer() <advancedfunctions/getServer>
autocomplete() <advancedfunctions/autocomplete>
atExit() <advancedfunctions/atExit>
Injecting HTML <advancedfunctions/inject_html.rst>

View File

@@ -17,7 +17,7 @@ getInformation() Netscript Function
maxHp: max hp of the sleeve,
jobs: jobs available to the sleeve,
jobTitle: job titles available to the sleeve,
tor: does this sleeve have access to the tor router,
mult: {
agility: agility multiplier,
agilityExp: agility exp multiplier,