Update documentation. Hacknet Node API functions for getting costs now return Infinity if the specified Node is at max level

This commit is contained in:
danielyxie 2018-09-26 00:00:28 -05:00
parent 12bee24520
commit 561cdb1652
9 changed files with 167321 additions and 383 deletions

56170
dist/engine.bundle.js vendored

File diff suppressed because one or more lines are too long

330
dist/engine.css vendored

@ -44,18 +44,6 @@ span {
margin: 4px; margin: 4px;
padding: 4px; } padding: 4px; }
button[type="button"] {
-webkit-transform: translateX(-50%);
-moz-transform: translateX(-50%);
-ms-transform: translateX(-50%);
-o-transform: translateX(-50%);
transform: translateX(-50%);
padding: 0.5rem 1rem;
position: absolute;
z-index: 1;
bottom: 10px;
left: 50%; }
#entire-game-container { #entire-game-container {
background-color: transparent; } background-color: transparent; }
@ -67,146 +55,11 @@ td:focus,
tr:focus { tr:focus {
outline: none; } outline: none; }
/* Main navigation menu */
.mainmenu {
list-style-type: none;
margin: 0;
padding: 0;
width: 10%;
position: fixed;
height: 100%;
overflow: auto;
border: 0;
border-bottom: 1px solid #000;
border-radius: 0;
background-color: #333; }
/* Default buttons */
.mainmenu > li a {
display: block;
color: #e6e6e6;
background-color: #555;
padding: 12px 8px;
text-decoration: none; }
.mainmenu.classic > li a {
padding: 16px; }
/* Hovering makes them lighter */
.mainmenu > li a:hover,
.mainmenu > li a:hover:not(.active),
.mainmenu > li a:focus {
background-color: #777;
color: #fff; }
/* Panel headers can become active, and they are "lighter" than the rest */
.mainmenu > li a.active {
background-color: #777;
color: #fff; }
.mainmenu > li a.active:hover {
background-color: #aaa; }
#hacking-menu-header-li,
#character-menu-header-li,
#world-menu-header-li,
#help-menu-header-li {
position: relative; }
/* Accordion Outline */
.mainmenu-accordion-header {
outline: 2px solid #fff; }
.mainmenu-accordion-header-classic {
border: 2px solid #fff;
padding: 16px !important; }
/* Plus and minus signs */
.mainmenu-accordion-header:after {
content: '\2795';
float: right;
font-size: 13px;
position: absolute;
bottom: 25%;
right: 3px;
color: transparent;
text-shadow: 0 0 0 #fff; }
.mainmenu-accordion-header-classic:after {
content: '\2795';
float: right;
font-size: 13px;
color: #fff;
margin-left: 5px; }
.mainmenu-accordion-header.opened,
.mainmenu-accordion-header-classic.opened {
background-color: #222; }
.mainmenu-accordion-header.opened:after,
.mainmenu-accordion-header-classic.opened:after {
content: "\2796"; }
/* Slide down transition */
.mainmenu-accordion-panel {
max-height: 0;
opacity: 1;
transition: max-height 0.2s ease-out; }
/* Make html links ("a" elements) nice looking buttons with this class */ /* Make html links ("a" elements) nice looking buttons with this class */
a:link, a:link,
a:visited { a:visited {
color: #fff; } color: #fff; }
.a-link-button {
text-decoration: none;
background-color: #555;
color: #fff;
padding: 3px 5px;
margin: 5px;
border: 1px solid #333;
-moz-user-select: none;
-ms-user-select: none;
-khtml-user-select: none;
-webkit-user-select: none; }
.a-link-button:hover {
background-color: #666; }
.a-link-button:active {
-webkit-box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.6);
-moz-box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.6);
box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.6); }
/* Make anchor tags ("a" elements) inactive (not clickable) */
.a-link-button-inactive {
text-decoration: none;
background-color: #333;
color: #fff;
padding: 3px 5px;
margin: 5px;
border: 1px solid #333;
cursor: default; }
.a-link-button-inactive:hover .tooltiptext,
.a-link-button-inactive:hover .tooltiptexthigh,
.a-link-button-inactive:hover .tooltiptextleft {
visibility: visible; }
.a-link-button-inactive:active {
pointer-events: none; }
/* Make anchor tags ("a" elements) for activated actions */
.a-link-button-bought {
text-decoration: none;
background-color: #0a0;
color: #fff;
padding: 3px 5px;
margin: 5px;
border: 1px solid #0a0;
cursor: default; }
.a-link-button-bought:hover .tooltiptext,
.a-link-button-bought:hover .tooltiptexthigh,
.a-link-button-bought:hover .tooltiptextleft {
visibility: visible; }
.a-link-button-bought:active {
pointer-events: none; }
.dropdown { .dropdown {
color: #fff; color: #fff;
background-color: #000; } background-color: #000; }
@ -619,6 +472,179 @@ a:visited {
.charisma-purple { .charisma-purple {
color: #a671d1; } color: #a671d1; }
/* COLORS */
/* Attributes */
/**
* Styling for all buttons
*
* Includes <button> elements as well as classes that are used
* for formatting buttons
*/
/* Remove default <button> styling */
button {
border: none; }
.a-link-button,
.std-button {
text-decoration: none;
background-color: #555;
color: #fff;
padding: 3px 5px;
margin: 5px;
border: 1px solid #333;
-moz-user-select: none;
-ms-user-select: none;
-khtml-user-select: none;
-webkit-user-select: none; }
.a-link-button:hover,
.std-button:hover {
background-color: #666; }
.a-link-button:active,
.std-button:active {
-webkit-box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.6);
-moz-box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.6);
box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.6); }
.a-link-button-inactive,
.std-button:disabled {
text-decoration: none;
background-color: #333;
color: #fff;
padding: 3px 5px;
margin: 5px;
border: 1px solid #333;
cursor: default; }
.a-link-button-inactive:hover .tooltiptext,
.a-link-button-inactive:hover .tooltiptexthigh,
.a-link-button-inactive:hover .tooltiptextleft,
.std-button:disabled:hover .tooltiptext,
.std-button:disabled:hover .tooltiptexthigh,
.std-button:disabled:hover .tooltiptextleft {
visibility: visible; }
.a-link-button-inactive:active,
.std-button:disabled:active {
pointer-events: none; }
.a-link-button-bought,
.std-button-bought {
text-decoration: none;
background-color: #0a0;
color: #fff;
padding: 3px 5px;
margin: 5px;
border: 1px solid #0a0;
cursor: default; }
.a-link-button-bought:hover .tooltiptext,
.a-link-button-bought:hover .tooltiptexthigh,
.a-link-button-bought:hover .tooltiptextleft,
.std-button-bought:hover .tooltiptext,
.std-button-bought:hover .tooltiptexthigh,
.std-button-bought:hover .tooltiptextleft {
visibility: visible; }
.a-link-button-bought:active,
.std-button-bought:active {
pointer-events: none; }
/* COLORS */
/* Attributes */
/**
* Styling for the main navigation menu on the left-hand-side
*/
.mainmenu {
list-style-type: none;
margin: 0;
padding: 0;
width: 10%;
position: fixed;
height: 100%;
overflow: auto;
border: 0;
border-bottom: 1px solid #000;
border-radius: 0;
background-color: #333; }
/* Default buttons */
.mainmenu > li a,
.mainmenu > li button {
display: block;
color: #e6e6e6;
background-color: #555;
padding: 12px 8px;
text-decoration: none;
width: 100%;
text-align: left; }
.mainmenu.classic > li a,
.mainmenu.classic > li button {
padding: 16px; }
/* Hovering makes them lighter */
.mainmenu > li a:hover,
.mainmenu > li a:hover:not(.active),
.mainmenu > li a:focus {
background-color: #777;
color: #fff; }
.mainmenu > li button:hover,
.mainmenu > li button:hover:not(.active) {
background-color: #777;
color: #fff; }
/* Panel headers can become active, and they are "lighter" than the rest */
.mainmenu > li a.active,
.mainmenu > li button.active {
background-color: #777;
color: #fff; }
.mainmenu > li a.active:hover,
.mainmenu > li button.active:hover {
background-color: #aaa; }
#hacking-menu-header-li,
#character-menu-header-li,
#world-menu-header-li,
#help-menu-header-li {
position: relative; }
/* Accordion Outline */
.mainmenu-accordion-header {
outline: 2px solid #fff !important; }
.mainmenu-accordion-header-classic {
border: 2px solid #fff;
padding: 16px !important; }
/* Plus and minus signs */
.mainmenu-accordion-header:after {
content: '\2795';
float: right;
font-size: 13px;
position: absolute;
bottom: 25%;
right: 3px;
color: transparent;
text-shadow: 0 0 0 #fff; }
.mainmenu-accordion-header-classic:after {
content: '\2795';
float: right;
font-size: 13px;
color: #fff;
margin-left: 5px; }
.mainmenu-accordion-header.opened,
.mainmenu-accordion-header-classic.opened {
background-color: #222; }
.mainmenu-accordion-header.opened:after,
.mainmenu-accordion-header-classic.opened:after {
content: "\2796"; }
/* Slide down transition */
.mainmenu-accordion-panel {
max-height: 0;
opacity: 1;
transition: max-height 0.2s ease-out; }
/* COLORS */ /* COLORS */
/* Attributes */ /* Attributes */
#terminal-container { #terminal-container {
@ -1294,16 +1320,6 @@ a:visited {
border: 5px solid var(--my-highlight-color); border: 5px solid var(--my-highlight-color);
width: 70%; width: 70%;
max-height: 80%; max-height: 80%;
/*
margin: auto;
height:auto;
max-height:80%;
position:absolute;
top:0;
left:0;
bottom:0;
right:0;
*/
overflow-y: auto; overflow-y: auto;
color: var(--my-font-color); } color: var(--my-font-color); }

111046
dist/vendor.bundle.js vendored

File diff suppressed because one or more lines are too long

@ -779,20 +779,20 @@ write
.. js:function:: write(port/fn, data="", mode="a") .. js:function:: write(port/fn, data="", mode="a")
:param string/number port/fn: Port or text file that will be written to :param string/number port/fn: Port or text file/script that will be written to
:param string data: Data to write :param string data: Data to write
:param string mode: Defines the write mode. Only valid when writing to text files. :param string mode: Defines the write mode. Only valid when writing to text files or scripts.
This function can be used to either write data to a port or to a text file (.txt). This function can be used to either write data to a port, a text file (.txt), or a script (.script, .js, .ns)
If the first argument is a number between 1 and 10, then it specifies a port and this function will write *data* to that port. Read If the first argument is a number between 1 and 20, then it specifies a port and this function will write *data* to that port. Read
about how `Netscript Ports work here <http://bitburner.wikia.com/wiki/Netscript_Ports>`_. The third argument, *mode*, is not used about how :ref:`netscript_ports` work here. The third argument, *mode*, is not used
when writing to a port. when writing to a port.
If the first argument is a string, then it specifies the name of a text file (.txt) and this function will write *data* to that text file. If the If the first argument is a string, then it specifies the name of a text file or script and this function will write *data* to that text file/script. If the
specified text file does not exist, then it will be created. The third argument *mode*, defines how the data will be written to the text file. If *mode* specified text file/script does not exist, then it will be created. The third argument *mode*, defines how the data will be written. If *mode*
is set to "w", then the data is written in "write" mode which means that it will overwrite all existing data on the text file. If *mode* is set to is set to "w", then the data is written in "write" mode which means that it will overwrite all existing data on the text file/script. If *mode* is set to
any other value then the data will be written in "append" mode which means that the data will be added at the end of the text file. any other value then the data will be written in "append" mode which means that the data will be added at the end of the file.
tryWrite tryWrite
^^^^^^^^ ^^^^^^^^
@ -813,13 +813,13 @@ read
:param string/number port/fn: Port or text file to read from :param string/number port/fn: Port or text file to read from
This function is used to read data from a port or from a text file (.txt). This function is used to read data from a port, a text file (.txt), or a script (.script, .js, .ns)
If the argument *port/fn* is a number between 1 and 10, then it specifies a port and it will read data from that port. Read If the argument *port/fn* is a number between 1 and 20, then it specifies a port and it will read data from that port. Read
about how `Netscript Ports work here <http://bitburner.wikia.com/wiki/Netscript_Ports>`_. A port is a serialized queue. This function about how :ref:`netscript_ports` work here. A port is a serialized queue. This function
will remove the first element from that queue and return it. If the queue is empty, then the string "NULL PORT DATA" will be returned. will remove the first element from that queue and return it. If the queue is empty, then the string "NULL PORT DATA" will be returned.
If the argument *port/fn* is a string, then it specifies the name of a text file (.txt) and this function will return the data in the specified text file. If If the argument *port/fn* is a string, then it specifies the name of a text file or script and this function will return the data in the specified text file/script. If
the text file does not exist, an empty string will be returned. the text file does not exist, an empty string will be returned.
peek peek
@ -827,12 +827,12 @@ peek
.. js:function:: peek(port) .. js:function:: peek(port)
:param number port: Port to peek. Must be an integer between 1 and 10 :param number port: Port to peek. Must be an integer between 1 and 20
This function is used to peek at the data from a port. It returns the first element in the specified port This function is used to peek at the data from a port. It returns the first element in the specified port
without removing that element. If the port is empty, the string "NULL PORT DATA" will be returned. without removing that element. If the port is empty, the string "NULL PORT DATA" will be returned.
Read about how `Netscript Ports work here <http://bitburner.wikia.com/wiki/Netscript_Ports>`_. Read about how :ref:`netscript_ports` work here
clear clear
^^^^^ ^^^^^
@ -843,7 +843,7 @@ clear
This function is used to clear data in a `Netscript Ports <http://bitburner.wikia.com/wiki/Netscript_Ports>`_ or a text file. This function is used to clear data in a `Netscript Ports <http://bitburner.wikia.com/wiki/Netscript_Ports>`_ or a text file.
If the *port/fn* argument is a number between 1 and 10, then it specifies a port and will clear it (deleting all data from the underlying queue). If the *port/fn* argument is a number between 1 and 20, then it specifies a port and will clear it (deleting all data from the underlying queue).
If the *port/fn* argument is a string, then it specifies the name of a text file (.txt) and will delete all data from that text file. If the *port/fn* argument is a string, then it specifies the name of a text file (.txt) and will delete all data from that text file.

@ -123,7 +123,10 @@ getLevelUpgradeCost
:param number i: Index/Identifier of Hacknet Node :param number i: Index/Identifier of Hacknet Node
:param number n: Number of levels to upgrade. Must be positive. Rounded to nearest integer :param number n: Number of levels to upgrade. Must be positive. Rounded to nearest integer
Returns the cost of upgrading the specified Hacknet Node by *n* levels Returns the cost of upgrading the specified Hacknet Node by *n* levels.
If an invalid value for *n* is provided, then this function returns 0. If the
specified Hacknet Node is already at max level, then Infinity is returned.
getRamUpgradeCost getRamUpgradeCost
----------------- -----------------
@ -134,6 +137,9 @@ getRamUpgradeCost
Returns the cost of upgrading the RAM of the specified Hacknet Node *n* times. Returns the cost of upgrading the RAM of the specified Hacknet Node *n* times.
If an invalid value for *n* is provided, then this function returns 0. If the
specified Hacknet Node is already at max RAM, then Infinity is returned.
getCoreUpgradeCost getCoreUpgradeCost
------------------ ------------------
.. js:function:: getCoreUpgradeCost(i, n) .. js:function:: getCoreUpgradeCost(i, n)
@ -143,6 +149,9 @@ getCoreUpgradeCost
Returns the cost of upgrading the number of cores of the specified Hacknet Node by *n*. Returns the cost of upgrading the number of cores of the specified Hacknet Node by *n*.
If an invalid value for *n* is provided, then this function returns 0. If the
specified Hacknet Node is already at the max number of cores, then Infinity is returned.
Utilities Utilities
--------- ---------
The following functions are not officially part of the Hacknet Node API, but they The following functions are not officially part of the Hacknet Node API, but they

@ -2,7 +2,7 @@
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<title>Bitburner</title> <title>Bitburner - development</title>
<link rel="apple-touch-icon" sizes="180x180" href="dist/apple-touch-icon.png"> <link rel="apple-touch-icon" sizes="180x180" href="dist/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="dist/favicon-32x32.png"> <link rel="icon" type="image/png" sizes="32x32" href="dist/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="dist/favicon-16x16.png"> <link rel="icon" type="image/png" sizes="16x16" href="dist/favicon-16x16.png">
@ -25,7 +25,7 @@
ga('create', 'UA-100157497-1', 'auto'); ga('create', 'UA-100157497-1', 'auto');
ga('send', 'pageview'); ga('send', 'pageview');
</script> </script>
<link rel="shortcut icon" href="favicon.ico"><link href="dist/engine.css" rel="stylesheet"></head> <link rel="shortcut icon" href="favicon.ico"><link href="0.css" rel="stylesheet"><link href="dist/engine.css" rel="stylesheet"></head>
<body> <body>
<div id="entire-game-container" style="visibility:hidden;"> <div id="entire-game-container" style="visibility:hidden;">
<div id="mainmenu-container"> <div id="mainmenu-container">
@ -33,73 +33,73 @@
<ul id="mainmenu" class="mainmenu"> <ul id="mainmenu" class="mainmenu">
<!-- Hacking dropdown --> <!-- Hacking dropdown -->
<li id="hacking-menu-header-li"> <li id="hacking-menu-header-li">
<a id="hacking-menu-header" class="mainmenu-accordion-header"> Hacking </a> <button id="hacking-menu-header" class="mainmenu-accordion-header"> Hacking </button>
</li> </li>
<li id="terminal-tab" class="mainmenu-accordion-panel"> <li id="terminal-tab" class="mainmenu-accordion-panel">
<a id="terminal-menu-link"> Terminal </a> <button id="terminal-menu-link"> Terminal </button>
</li> </li>
<li id="create-script-tab" class="mainmenu-accordion-panel"> <li id="create-script-tab" class="mainmenu-accordion-panel">
<a id="create-script-menu-link"> Create Script </a> <button id="create-script-menu-link"> Create Script </button>
</li> </li>
<li id="active-scripts-tab" class="mainmenu-accordion-panel"> <li id="active-scripts-tab" class="mainmenu-accordion-panel">
<a id="active-scripts-menu-link"> Active Scripts </a> <button id="active-scripts-menu-link"> Active Scripts </button>
</li> </li>
<li id="create-program-tab" class="mainmenu-accordion-panel"> <li id="create-program-tab" class="mainmenu-accordion-panel">
<a id="create-program-menu-link"> Create Program </a> <button id="create-program-menu-link"> Create Program </button>
<span id="create-program-notification" class="notification-off"> </span> <span id="create-program-notification" class="notification-off"> </span>
</li> </li>
<!-- Character dropdown --> <!-- Character dropdown -->
<li id="character-menu-header-li"> <li id="character-menu-header-li">
<a id="character-menu-header" class="mainmenu-accordion-header"> Character </a> <button id="character-menu-header" class="mainmenu-accordion-header"> Character </button>
</li> </li>
<li id="stats-tab" class="mainmenu-accordion-panel"> <li id="stats-tab" class="mainmenu-accordion-panel">
<a id="stats-menu-link"> Stats </a> <button id="stats-menu-link"> Stats </button>
</li> </li>
<li id="factions-tab" class="mainmenu-accordion-panel"> <li id="factions-tab" class="mainmenu-accordion-panel">
<a id="factions-menu-link"> Factions </a> <button id="factions-menu-link"> Factions </button>
</li> </li>
<li id="augmentations-tab" class="mainmenu-accordion-panel"> <li id="augmentations-tab" class="mainmenu-accordion-panel">
<a id="augmentations-menu-link" style="overflow: hidden; text-overflow: ellipsis; white-space: nowrap;"> Augmentations </a> <button id="augmentations-menu-link" style="overflow: hidden; text-overflow: ellipsis; white-space: nowrap;"> Augmentations </button>
</li> </li>
<li id="hacknet-nodes-tab" class="mainmenu-accordion-panel"> <li id="hacknet-nodes-tab" class="mainmenu-accordion-panel">
<a id="hacknet-nodes-menu-link"> Hacknet Nodes </a> <button id="hacknet-nodes-menu-link"> Hacknet Nodes </button>
</li> </li>
<!-- World dropdown --> <!-- World dropdown -->
<li id="world-menu-header-li"> <li id="world-menu-header-li">
<a id="world-menu-header" class="mainmenu-accordion-header">World</a> <button id="world-menu-header" class="mainmenu-accordion-header">World</button>
</li> </li>
<li id="city-tab" class="mainmenu-accordion-panel"> <li id="city-tab" class="mainmenu-accordion-panel">
<a id="city-menu-link"> City </a> <button id="city-menu-link"> City </button>
</li> </li>
<li id="travel-tab" class="mainmenu-accordion-panel"> <li id="travel-tab" class="mainmenu-accordion-panel">
<a id="travel-menu-link">Travel</a> <button id="travel-menu-link"> Travel </button>
</li> </li>
<li id="job-tab" class="mainmenu-accordion-panel"> <li id="job-tab" class="mainmenu-accordion-panel">
<a id="job-menu-link">Job</a> <button id="job-menu-link"> Job </button>
</li> </li>
<li id="bladeburner-tab" class="mainmenu-accordion-panel"> <li id="bladeburner-tab" class="mainmenu-accordion-panel">
<a id="bladeburner-menu-link"> Bladeburner </a> <button id="bladeburner-menu-link"> Bladeburner </button>
</li> </li>
<li id="corporation-tab" class="mainmenu-accordion-panel"> <li id="corporation-tab" class="mainmenu-accordion-panel">
<a id="corporation-menu-link"> Corp </a> <button id="corporation-menu-link"> Corp </button>
</li> </li>
<li id="gang-tab" class="mainmenu-accordion-panel"> <li id="gang-tab" class="mainmenu-accordion-panel">
<a id="gang-menu-link"> Gang </a> <button id="gang-menu-link"> Gang </button>
</li> </li>
<li id="help-menu-header-li"> <li id="help-menu-header-li">
<a id="help-menu-header" class="mainmenu-accordion-header">Help</a> <button id="help-menu-header" class="mainmenu-accordion-header"> Help </button>
</li> </li>
<li id="tutorial-tab" class="mainmenu-accordion-panel"> <li id="tutorial-tab" class="mainmenu-accordion-panel">
<a id="tutorial-menu-link"> Tutorial </a> <button id="tutorial-menu-link"> Tutorial </button>
</li> </li>
<li id="options-tab" class="mainmenu-accordion-panel"> <li id="options-tab" class="mainmenu-accordion-panel">
<a id="options-menu-link"> Options </a> <button id="options-menu-link"> Options </button>
</li> </li>
<li id="dev-tab" class="mainmenu-accordion-panel"> <li id="dev-tab" class="mainmenu-accordion-panel">
<a id="dev-menu-link"> Dev </a> <button id="dev-menu-link"> Dev </button>
</li> </li>
</ul> </ul>
</div> </div>
@ -109,7 +109,7 @@
<div id="script-editor-filename-wrapper"> <div id="script-editor-filename-wrapper">
<p id="script-editor-filename-tag"> <strong style="background-color:#555;">Script name: </strong></p> <p id="script-editor-filename-tag"> <strong style="background-color:#555;">Script name: </strong></p>
<input id="script-editor-filename" type="text" maxlength="30" tabindex="1"/> <input id="script-editor-filename" type="text" maxlength="30" tabindex="1" />
</div> </div>
<div id="javascript-editor"></div> <div id="javascript-editor"></div>
@ -159,7 +159,7 @@
<fieldset> <fieldset>
<label for="script-editor-option-maxerr" class="tooltip">Max Error Count</label> <label for="script-editor-option-maxerr" class="tooltip">Max Error Count</label>
<input type="range" max="1000" min="50" value="200" step="1" name="script-editor-option-maxerr" id="script-editor-option-maxerr"/> <input type="range" max="1000" min="50" value="200" step="1" name="script-editor-option-maxerr" id="script-editor-option-maxerr" />
<em id="script-editor-option-maxerror-value-label" style="font-style: normal;"></em> <em id="script-editor-option-maxerror-value-label" style="font-style: normal;"></em>
</fieldset> </fieldset>
</div> <!-- End script editor options panel --> </div> <!-- End script editor options panel -->
@ -170,7 +170,7 @@
<table id="terminal"> <table id="terminal">
<tr id="terminal-input"> <tr id="terminal-input">
<td id="terminal-input-td" tabindex="2">$ <td id="terminal-input-td" tabindex="2">$
<input type="text" id="terminal-input-text-box" class="terminal-input" tabindex="1" onfocus="this.value = this.value;"/> <input type="text" id="terminal-input-text-box" class="terminal-input" tabindex="1" onfocus="this.value = this.value;" />
</td> </td>
</tr> </tr>
</table> </table>
@ -187,7 +187,7 @@
provides information about each script's production. The scripts are categorized by the hostname of the servers on which provides information about each script's production. The scripts are categorized by the hostname of the servers on which
they are running. </p> they are running. </p>
<p id="active-scripts-total-prod">Total online production of <p id="active-scripts-total-prod">Total online production of
Active scripts: <span class="money-gold"><span id="active-scripts-total-production-active">$0.000</span> / sec</span><br/> Active scripts: <span class="money-gold"><span id="active-scripts-total-production-active">$0.000</span> / sec</span><br />
Total online production since last Aug installation: <span id="active-scripts-total-prod-aug-total" class="money-gold">$0.000</span> Total online production since last Aug installation: <span id="active-scripts-total-prod-aug-total" class="money-gold">$0.000</span>
(<span class="money-gold"><span id="active-scripts-total-prod-aug-avg" class="money-gold">$0.000</span> / sec</span>)</p> (<span class="money-gold"><span id="active-scripts-total-prod-aug-avg" class="money-gold">$0.000</span> / sec</span>)</p>
<ul class="active-scripts-list" id="active-scripts-list" style="list-style: none;"> <ul class="active-scripts-list" id="active-scripts-list" style="list-style: none;">
@ -201,19 +201,19 @@
The Hacknet is a global, decentralized network of machines. It is used by hackers all around The Hacknet is a global, decentralized network of machines. It is used by hackers all around
the world to anonymously share computing power and perform distributed cyberattacks without the the world to anonymously share computing power and perform distributed cyberattacks without the
fear of being traced. fear of being traced.
<br/><br/> <br /><br />
Here, you can purchase a Hacknet Node, a specialized machine that can connect and contribute its Here, you can purchase a Hacknet Node, a specialized machine that can connect and contribute its
resources to the Hacknet network. This allows you to take a small percentage of profits resources to the Hacknet network. This allows you to take a small percentage of profits
from hacks performed on the network. Essentially, you are renting out your Node's computing power. from hacks performed on the network. Essentially, you are renting out your Node's computing power.
<br/><br/> <br /><br />
Each Hacknet Node you purchase will passively earn you money. Each Hacknet Node can be upgraded Each Hacknet Node you purchase will passively earn you money. Each Hacknet Node can be upgraded
in order to increase its computing power and thereby increase the profit you earn from it. in order to increase its computing power and thereby increase the profit you earn from it.
</p> </p>
<a id="hacknet-nodes-purchase-button" class="a-link-button"> Purchase Hacknet Node </a> <a id="hacknet-nodes-purchase-button" class="a-link-button"> Purchase Hacknet Node </a>
<br/> <br />
<div id="hacknet-nodes-money-multipliers-div"> <div id="hacknet-nodes-money-multipliers-div">
<p id="hacknet-nodes-money"> <p id="hacknet-nodes-money">
<span>Money:</span><span id="hacknet-nodes-player-money" class="money-gold"></span><br/> <span>Money:</span><span id="hacknet-nodes-player-money" class="money-gold"></span><br />
<span>Total Hacknet Node Production:</span><span id="hacknet-nodes-total-production" class="money-gold"></span> <span>Total Hacknet Node Production:</span><span id="hacknet-nodes-total-production" class="money-gold"></span>
</p> </p>
<span id="hacknet-nodes-multipliers"> <span id="hacknet-nodes-multipliers">
@ -471,7 +471,8 @@
<!-- Tutorial content --> <!-- Tutorial content -->
<div id="tutorial-container" class="generic-menupage-container"> <div id="tutorial-container" class="generic-menupage-container">
<a id="tutorial-getting-started-link" class="a-link-button" href="http://bitburner.wikia.com/wiki/Chapt3rs_Guide_to_Getting_Started_with_Bitburner" target="_blank"> Getting Started </a> <a id="tutorial-getting-started-link" class="a-link-button"
href="http://bitburner.wikia.com/wiki/Chapt3rs_Guide_to_Getting_Started_with_Bitburner" target="_blank"> Getting Started </a>
<a id="tutorial-networking-link" class="a-link-button"> Servers & Networking </a> <a id="tutorial-networking-link" class="a-link-button"> Servers & Networking </a>
<a id="tutorial-hacking-link" class="a-link-button"> Hacking </a> <a id="tutorial-hacking-link" class="a-link-button"> Hacking </a>
<a id="tutorial-scripts-link" class="a-link-button"> Scripts </a> <a id="tutorial-scripts-link" class="a-link-button"> Scripts </a>
@ -480,7 +481,8 @@
<a id="tutorial-jobs-link" class="a-link-button"> Companies and Infiltration </a> <a id="tutorial-jobs-link" class="a-link-button"> Companies and Infiltration </a>
<a id="tutorial-factions-link" class="a-link-button"> Factions </a> <a id="tutorial-factions-link" class="a-link-button"> Factions </a>
<a id="tutorial-augmentations-link" class="a-link-button"> Augmentations </a> <a id="tutorial-augmentations-link" class="a-link-button"> Augmentations </a>
<a id="tutorial-shortcuts-link" class="a-link-button" href="https://bitburner.wikia.com/wiki/Shortcuts" target="_blank"> Keyboard Shortcuts </a> <a id="tutorial-shortcuts-link" class="a-link-button"
href="https://bitburner.wikia.com/wiki/Shortcuts" target="_blank"> Keyboard Shortcuts </a>
<a id="tutorial-back-button" class="a-link-button"> Back </a> <a id="tutorial-back-button" class="a-link-button"> Back </a>
<p id="tutorial-text"> </p> <p id="tutorial-text"> </p>
@ -623,7 +625,7 @@
<p id="location-slums-description"> <p id="location-slums-description">
You have entered the Slums, a poverty-ridden district filled with gangs, criminals, and You have entered the Slums, a poverty-ridden district filled with gangs, criminals, and
other shadowy entities. The city's government and police have neglected this area for years... other shadowy entities. The city's government and police have neglected this area for years...
<br/><br/><br/> <br /><br /><br />
In the Slums, you can commit crimes to earn money and experience. Crime attempts are not always In the Slums, you can commit crimes to earn money and experience. Crime attempts are not always
successful. Your chance at successfully committing a crime is determined by your stats. successful. Your chance at successfully committing a crime is determined by your stats.
</p> </p>
@ -670,7 +672,7 @@
<div id="stock-market-container" class="generic-menupage-container"> <div id="stock-market-container" class="generic-menupage-container">
<p> <p>
Welcome to the World Stock Exchange (WSE)! <br/><br/> Welcome to the World Stock Exchange (WSE)! <br /><br />
To begin trading, you must first purchase an account. WSE accounts will persist To begin trading, you must first purchase an account. WSE accounts will persist
after you 'reset' by installing Augmentations. after you 'reset' by installing Augmentations.
@ -683,7 +685,7 @@
TIX, short for Trade Information eXchange, is the communications protocol supported by the WSE. TIX, short for Trade Information eXchange, is the communications protocol supported by the WSE.
Purchasing access to the TIX API lets you write code to create your own algorithmic/automated Purchasing access to the TIX API lets you write code to create your own algorithmic/automated
trading strategies. trading strategies.
<br/><br/> <br /><br />
If you purchase access to the TIX API, you will retain that access even after If you purchase access to the TIX API, you will retain that access even after
you 'reset' by installing Augmentations. you 'reset' by installing Augmentations.
</p> </p>
@ -693,7 +695,7 @@
<p> <p>
Four Sigma's (4S) Market Data Feed provides information about stocks Four Sigma's (4S) Market Data Feed provides information about stocks
that will help your trading strategies. that will help your trading strategies.
<br/><br/> <br /><br />
If you purchase access to 4S Market Data and/or the 4S TIX API, you will If you purchase access to 4S Market Data and/or the 4S TIX API, you will
retain that access even after you 'reset' by installing Augmentations. retain that access even after you 'reset' by installing Augmentations.
</p> </p>
@ -711,7 +713,7 @@
<a id="stock-market-mode" class="a-link-button tooltip"></a> <a id="stock-market-mode" class="a-link-button tooltip"></a>
<a id="stock-market-expand-tickers" class="a-link-button tooltip">Expand tickers</a> <a id="stock-market-expand-tickers" class="a-link-button tooltip">Expand tickers</a>
<a id="stock-market-collapse-tickers" class="a-link-button tooltip">Collapse tickers</a> <a id="stock-market-collapse-tickers" class="a-link-button tooltip">Collapse tickers</a>
<br/><br/> <br /><br />
<input id="stock-market-watchlist-filter" type="text" placeholder="Filter Stocks by symbol (comma-separated list)"/> <input id="stock-market-watchlist-filter" type="text" placeholder="Filter Stocks by symbol (comma-separated list)"/>
<a id="stock-market-watchlist-filter-update" class="a-link-button"> Update Watchlist </a> <a id="stock-market-watchlist-filter-update" class="a-link-button"> Update Watchlist </a>
<ul id="stock-market-list" style="list-style:none;"> <ul id="stock-market-list" style="list-style:none;">
@ -741,7 +743,7 @@
<div id="yes-no-text-input-box-container" class="popup-box-container"> <div id="yes-no-text-input-box-container" class="popup-box-container">
<div id="yes-no-text-input-box-content" class="popup-box-content"> <div id="yes-no-text-input-box-content" class="popup-box-content">
<p id="yes-no-text-input-box-text"> </p> <p id="yes-no-text-input-box-text"> </p>
<input type="text" id="yes-no-text-input-box-input" pattern="[a-zA-Z0-9-_]" maxlength="30"/> <input type="text" id="yes-no-text-input-box-input" pattern="[a-zA-Z0-9-_]" maxlength="30" />
<span id="yes-no-text-input-box-yes" class="popup-box-button"> Yes </span> <span id="yes-no-text-input-box-yes" class="popup-box-button"> Yes </span>
<span id="yes-no-text-input-box-no" class="popup-box-button"> No </span> <span id="yes-no-text-input-box-no" class="popup-box-button"> No </span>
</div> </div>
@ -753,7 +755,7 @@
<p id="faction-invitation-box-text"> </p> <p id="faction-invitation-box-text"> </p>
<p id="faction-invitation-box-message"> </p> <p id="faction-invitation-box-message"> </p>
<p id="faction-invitation-box-warning"> <p id="faction-invitation-box-warning">
Would you like to join? <br/> <br/> Would you like to join? <br /> <br />
Warning: Joining this faction may prevent you from joining other factions during this run! Warning: Joining this faction may prevent you from joining other factions during this run!
</p> </p>
<span id="faction-invitation-box-yes" class="popup-box-button"> Yes </span> <span id="faction-invitation-box-yes" class="popup-box-button"> Yes </span>
@ -766,8 +768,8 @@
<div id="infiltration-box-content" class="popup-box-content"> <div id="infiltration-box-content" class="popup-box-content">
<p id="infiltration-box-text"> </p> <p id="infiltration-box-text"> </p>
<span id="infiltration-box-sell" class="a-link-button"> Sell on Black Market </span> <br/><br/> <span id="infiltration-box-sell" class="a-link-button"> Sell on Black Market </span> <br /><br />
<select id="infiltration-faction-select"> </select> <br/> <select id="infiltration-faction-select"> </select> <br />
<span id="infiltration-box-faction" class="a-link-button"> Give to Faction for Reputation </span> <span id="infiltration-box-faction" class="a-link-button"> Give to Faction for Reputation </span>
</div> </div>
@ -853,7 +855,7 @@
<div id="game-options-content" class="game-options-box"> <div id="game-options-content" class="game-options-box">
<span id="game-options-close-button">&times;</span> <span id="game-options-close-button">&times;</span>
<h1> Game Options </h1> <h1> Game Options </h1>
<br/> <br />
<div id="game-options-left-panel"> <div id="game-options-left-panel">
<!-- Netscript execution time --> <!-- Netscript execution time -->
<fieldset> <fieldset>
@ -865,7 +867,7 @@
</span> </span>
</label> </label>
<input type="range" max="100" min="10" step="1" name="settingsNSExecTimeRangeVal" id="settingsNSExecTimeRangeVal" value="25"/> <input type ="range" max="100" min="10" step="1" name="settingsNSExecTimeRangeVal" id="settingsNSExecTimeRangeVal" value="25" />
<em id="settingsNSExecTimeRangeValLabel" style="font-style: normal;"></em> <em id="settingsNSExecTimeRangeValLabel" style="font-style: normal;"></em>
</fieldset> </fieldset>
@ -879,7 +881,7 @@
</span> </span>
</label> </label>
<input type="range" max="100" min="20" step="1" name="settingsNSLogRangeVal" id="settingsNSLogRangeVal" value="50"/> <input type="range" max="100" min="20" step="1" name="settingsNSLogRangeVal" id="settingsNSLogRangeVal" value="50" />
<em id="settingsNSLogRangeValLabel" style="font-style: normal;"></em> <em id="settingsNSLogRangeValLabel" style="font-style: normal;"></em>
</fieldset> </fieldset>
@ -893,7 +895,7 @@
</span> </span>
</label> </label>
<input type="range" max="100" min="20" step="1" name="settingsNSPortRangeVal" id="settingsNSPortRangeVal" value="50"/> <input type="range" max="100" min="20" step="1" name="settingsNSPortRangeVal" id="settingsNSPortRangeVal" value="50" />
<em id="settingsNSPortRangeValLabel" style="font-style: normal;"></em> <em id="settingsNSPortRangeValLabel" style="font-style: normal;"></em>
</fieldset> </fieldset>
@ -905,7 +907,7 @@
</span> </span>
</label> </label>
<input type="range" max="600" min="0" step="1" name="settingsAutosaveIntervalVal" id="settingsAutosaveIntervalVal" value="60"/> <input type="range" max="600" min="0" step="1" name="settingsAutosaveIntervalVal" id="settingsAutosaveIntervalVal" value="60" />
<em id="settingsAutosaveIntervalValLabel" style="font-style: normal;"></em> <em id="settingsAutosaveIntervalValLabel" style="font-style: normal;"></em>
</fieldset> </fieldset>
@ -1017,7 +1019,7 @@
<a id="save-game-link" class="a-link-button" style="display:inline-block;width:46%;"> Save Game </a> <a id="save-game-link" class="a-link-button" style="display:inline-block;width:46%;"> Save Game </a>
<a id="delete-game-link" class="a-link-button" style="display:inline-block;width:46%;"> Delete Game </a> <a id="delete-game-link" class="a-link-button" style="display:inline-block;width:46%;"> Delete Game </a>
<a id="export-game-link" class="a-link-button" style="display:inline-block;width:46%;"> Export Game </a> <a id="export-game-link" class="a-link-button" style="display:inline-block;width:46%;"> Export Game </a>
<input type="file" id="import-game-file-selector" name="file"/> <input type="file" id="import-game-file-selector" name="file" />
<a id="import-game-link" class="a-link-button" style="display:inline-block;width:46%;"> Import Game </a> <a id="import-game-link" class="a-link-button" style="display:inline-block;width:46%;"> Import Game </a>
<a id="debug-delete-scripts-link" class="a-link-button tooltip" style="display:block;width:46%;"> <a id="debug-delete-scripts-link" class="a-link-button tooltip" style="display:block;width:46%;">
(DEBUG) Delete Active Scripts (DEBUG) Delete Active Scripts

@ -510,6 +510,7 @@ let CONSTANTS = {
* Added new Coding Contracts mechanic. Solve programming problems to earn rewards * Added new Coding Contracts mechanic. Solve programming problems to earn rewards
* (TODO NEEDS DOCUMENTATION) The write() and read() Netscript functions now work on scripts * (TODO NEEDS DOCUMENTATION) The write() and read() Netscript functions now work on scripts
* Added bladeburner.getActionRepGain() function to the Netscript Bladeburner API * Added bladeburner.getActionRepGain() function to the Netscript Bladeburner API
* The getLevelUpgradeCost(), getRamUpgradeCost(), and getCoreUpgradeCost() functions in the Hacknet API now return Infinity if the node is at max level. See documentation
* It is now possible to use freely use angled bracket (<, >) and create DOM elements using tprint() * It is now possible to use freely use angled bracket (<, >) and create DOM elements using tprint()
* The game's theme colors can now be set through the Terminal configuration (.fconf). * The game's theme colors can now be set through the Terminal configuration (.fconf).
* You can now switch to the old left-hand main menu bar through the Terminal configuration (.fconf) * You can now switch to the old left-hand main menu bar through the Terminal configuration (.fconf)

@ -87,6 +87,10 @@ HacknetNode.prototype.calculateLevelUpgradeCost = function(levels=1) {
return 0; return 0;
} }
if (this.level >= CONSTANTS.HacknetNodeMaxLevel) {
return Infinity;
}
var mult = CONSTANTS.HacknetNodeUpgradeLevelMult; var mult = CONSTANTS.HacknetNodeUpgradeLevelMult;
var totalMultiplier = 0; //Summed var totalMultiplier = 0; //Summed
var currLevel = this.level; var currLevel = this.level;
@ -133,6 +137,10 @@ HacknetNode.prototype.calculateRamUpgradeCost = function(levels=1) {
return 0; return 0;
} }
if (this.ram >= CONSTANTS.HacknetNodeMaxRam) {
return Infinity;
}
let totalCost = 0; let totalCost = 0;
let numUpgrades = Math.round(Math.log2(this.ram)); let numUpgrades = Math.round(Math.log2(this.ram));
let currentRam = this.ram; let currentRam = this.ram;
@ -158,7 +166,7 @@ HacknetNode.prototype.purchaseRamUpgrade = function(levels=1) {
return false; return false;
} }
//Fail if we're already at max // Fail if we're already at max
if (this.ram >= CONSTANTS.HacknetNodeMaxRam) { if (this.ram >= CONSTANTS.HacknetNodeMaxRam) {
return false; return false;
} }
@ -189,6 +197,10 @@ HacknetNode.prototype.calculateCoreUpgradeCost = function(levels=1) {
return 0; return 0;
} }
if (this.cores >= CONSTANTS.HacknetNodeMaxCores) {
return Infinity;
}
const coreBaseCost = CONSTANTS.BaseCostForHacknetNodeCore; const coreBaseCost = CONSTANTS.BaseCostForHacknetNodeCore;
const mult = CONSTANTS.HacknetNodeUpgradeCoreMult; const mult = CONSTANTS.HacknetNodeUpgradeCoreMult;
let totalCost = 0; let totalCost = 0;

@ -1158,7 +1158,7 @@ const Engine = {
if (Engine.Counters.contractGeneration <= 0) { if (Engine.Counters.contractGeneration <= 0) {
// X% chance of a contract being generated // X% chance of a contract being generated
if (Math.random() < 0.23) { if (Math.random() <= 0.25) {
// First select a random problem type // First select a random problem type
const problemTypes = Object.keys(CodingContractTypes); const problemTypes = Object.keys(CodingContractTypes);
let randIndex = getRandomInt(0, problemTypes.length - 1); let randIndex = getRandomInt(0, problemTypes.length - 1);