diff --git a/.eslintignore b/.eslintignore index 3564dd983..f0da1ec30 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,3 +1,4 @@ node_modules/ +doc/build/ dist/ tests/*.bundle.* diff --git a/.gitignore b/.gitignore index d7d90e793..c827e24bf 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ Changelog.txt Netburner.txt +/doc/build /node_modules /dist/*.map /tests/*.map diff --git a/css/bladeburner.css b/css/bladeburner.css index 2abbb9a99..149a5d0cf 100644 --- a/css/bladeburner.css +++ b/css/bladeburner.css @@ -7,9 +7,9 @@ } .bladeburner-action { - border:1px solid white; - margin:7px; - padding:7px; + border: 1px solid #fff; + margin: 7px; + padding: 7px; white-space: pre-wrap; } @@ -19,25 +19,25 @@ /* Whatever action is currently active */ .bladeburner-active-action { - border:4px solid white; + border: 4px solid #fff; } /* Action & Skills panel navigation button */ .bladeburner-nav-button { - border:1px solid white; - color:white; - padding:2px; - margin:2px; + border: 1px solid #fff; + color: #fff; + padding: 2px; + margin: 2px; } .bladeburner-nav-button:hover { - background-color:#3d4044; + background-color: #3d4044; } .bladeburner-nav-button-inactive { - border:1px solid white; - padding:2px; - margin:2px; + border: 1px solid #fff; + padding: 2px; + margin: 2px; text-decoration: none; background-color: #555; cursor: default; @@ -46,24 +46,24 @@ /* Bladeburner Console */ .bladeburner-console-div { - display:inline-block; - width:40%; - border:1px solid white; - overflow:auto; - height:100%; - position:absolute; + display: inline-block; + width: 40%; + border: 1px solid #fff; + overflow: auto; + height: 100%; + position: absolute; } .bladeburner-console-table { - height:auto; - overflow:auto; - table-layout:fixed; - width:100%; + height: auto; + overflow: auto; + table-layout: fixed; + width: 100%; } .bladeburner-console-input-row { transition: height 1s; - width:100%; + width: 100%; } .bladeburner-console-input-cell { @@ -72,19 +72,19 @@ .bladeburner-console-input { display: inline-block; - padding: 0px !important; - margin: 0px !important; - border: 0px; - background-color: var(--my-background-color); - font-size: 13px; - outline: none; + padding: 0 !important; + margin: 0 !important; + border: 0; + background-color: var(--my-background-color); + font-size: 13px; + outline: none; color: var(--my-font-color); flex: 1 1 auto; } .bladeburner-console-line { word-wrap: break-word; - hyphens:auto; + hyphens: auto; -webkit-hyphens: auto; -moz-hyphens: auto; } diff --git a/css/companymanagement.css b/css/companymanagement.css index 77d7a5018..8276cf5cb 100644 --- a/css/companymanagement.css +++ b/css/companymanagement.css @@ -4,13 +4,12 @@ font-size: 13px; } - /* Header tabs */ .cmpy-mgmt-header-tab { display: inline-block; - color: white; - background-color:#555; - border:1px solid white; + color: #fff; + background-color: #555; + border: 1px solid #fff; padding: 4px; } @@ -24,10 +23,10 @@ /* Switch between Cities */ .cmpy-mgmt-city-tab { - display:inline-block; - color: white; + display: inline-block; + color: #fff; background-color: #555; - border: 1px solid white; + border: 1px solid #fff; padding: 4px; } @@ -46,7 +45,7 @@ .cmpy-mgmt-industry-left-panel, .cmpy-mgmt-industry-right-panel { - display:inline-block; + display: inline-block; width: 45%; height: 100%; top: 10px; @@ -55,75 +54,74 @@ } .cmpy-mgmt-industry-overview-panel { - border: 1px solid white; + border: 1px solid #fff; color: var(--my-font-color); - display:inline-block; + display: inline-block; width: 100%; } .cmpy-mgmt-employee-panel { - border: 1px solid white; - display:block; - width:100%; + border: 1px solid #fff; + display: block; + width: 100%; } .cmpy-mgmt-warehouse-panel { - border: 1px solid white; - display:inline-block; - width:100%; + border: 1px solid #fff; + display: inline-block; + width: 100%; } -/* Hiring new employees*/ +/* Hiring new employees */ .cmpy-mgmt-find-employee-option { - border:1px solid white; + border: 1px solid #fff; margin: 6px; } .cmpy-mgmt-find-employee-option:hover { - background-color:#3d4044; + background-color: #3d4044; } /* Warehouse */ .cmpy-mgmt-warehouse-material-div { - padding:2px; - border:1px solid white; + padding: 2px; + border: 1px solid #fff; } .cmpy-mgmt-warehouse-product-div { - padding:2px; - border:1px solid white; + padding: 2px; + border: 1px solid #fff; } /* Exporting materials/products */ .cmpy-mgmt-existing-export { - border:1px solid white; - border-radius:25px; - margin:4px; - padding:4px; + border: 1px solid #fff; + border-radius: 25px; + margin: 4px; + padding: 4px; } .cmpy-mgmt-existing-export:hover { - background-color:#333333; + background-color: #333; } - /* Upgrades */ .cmpy-mgmt-upgrade-container { - border:1px solid white; + border: 1px solid #fff; width: 60%; - margin:4px; + margin: 4px; } .cmpy-mgmt-upgrade-div { - display:inline-block; - border:1px solid white; - margin:2px; - padding:6px; - border-radius:25px; - font-size:"12px"; - color:var(--my-font-color); + display: inline-block; + border: 1px solid #fff; + margin: 2px; + padding: 6px; + border-radius: 25px; + font-size: "12px"; + color: var(--my-font-color); } .cmpy-mgmt-upgrade-div:hover { - background-color:#333333; + background-color: #333; } diff --git a/css/interactivetutorial.css b/css/interactivetutorial.css index 95e51b380..095a626c8 100644 --- a/css/interactivetutorial.css +++ b/css/interactivetutorial.css @@ -1,6 +1,6 @@ /* interactivetutorial.css */ #interactive-tutorial-wrapper { - position:relative; + position: relative; } #interactive-tutorial-container { @@ -10,11 +10,11 @@ top: 0; height: 400px; /* Full height */ padding: 10px; - border: 5px solid #FFFFFF; + border: 5px solid #fff; width: 20%; overflow: auto; /* Enable scroll if needed */ background-color: #444; /* Fallback color */ - color: white; + color: #fff; } #interactive-tutorial-container > strong { @@ -24,7 +24,7 @@ #interactive-tutorial-text { padding: 4px; margin: 4px; - color: white; + color: #fff; background-color: #444; } @@ -40,7 +40,7 @@ -moz-box-shadow: 1px 1px 3px #000; -webkit-box-shadow: 1px 1px 3px #000; box-shadow: 1px 1px 3px #000; - background-color:black; + background-color: #000; } #interactive-tutorial-exit { @@ -62,7 +62,7 @@ #interactive-tutorial-next:focus, #interactive-tutorial-back:hover, #interactive-tutorial-back:focus { - color: white; + color: #fff; text-decoration: none; cursor: pointer; } diff --git a/css/loader.css b/css/loader.css index 7b921d313..3c3681e6d 100644 --- a/css/loader.css +++ b/css/loader.css @@ -1,148 +1,148 @@ @-webkit-keyframes LOADERSPINNER { - 0% { -webkit-transform: translate(-50%,-50%) rotate(0deg); } - 100% { -webkit-transform: translate(-50%,-50%) rotate(360deg); } + 0% { -webkit-transform: translate(-50%, -50%) rotate(0deg); } + 100% { -webkit-transform: translate(-50%, -50%) rotate(360deg); } } @-moz-keyframes LOADERSPINNER { - 0% { -moz-transform: translate(-50%,-50%) rotate(0deg); } - 100% { -moz-transform: translate(-50%,-50%) rotate(360deg); } + 0% { -moz-transform: translate(-50%, -50%) rotate(0deg); } + 100% { -moz-transform: translate(-50%, -50%) rotate(360deg); } } @-ms-keyframes LOADERSPINNER { - 0% { -ms-transform: translate(-50%,-50%) rotate(0deg); } - 100% { -ms-transform: translate(-50%,-50%) rotate(360deg); } + 0% { -ms-transform: translate(-50%, -50%) rotate(0deg); } + 100% { -ms-transform: translate(-50%, -50%) rotate(360deg); } } @-o-keyframes LOADERSPINNER { - 0% { -o-transform: translate(-50%,-50%) rotate(0deg); } - 100% { -o-transform: translate(-50%,-50%) rotate(360deg); } + 0% { -o-transform: translate(-50%, -50%) rotate(0deg); } + 100% { -o-transform: translate(-50%, -50%) rotate(360deg); } } @keyframes LOADERSPINNER { - 0% { transform: translate(-50%,-50%) rotate(0deg); } - 100% { transform: translate(-50%,-50%) rotate(360deg); } + 0% { transform: translate(-50%, -50%) rotate(0deg); } + 100% { transform: translate(-50%, -50%) rotate(360deg); } } @-webkit-keyframes LOADERLABEL { - 0% { opacity: 1.0; -webkit-transform: translate(-50%,-50%) scale(1.0); } - 5% { opacity: 0.5; -webkit-transform: translate(-50%,-50%) scale(0.5); } - 95% { opacity: 0.5; -webkit-transform: translate(-50%,-50%) scale(0.5); } - 100% { opacity: 1.0; -webkit-transform: translate(-50%,-50%) scale(1.0); } + 0% { opacity: 1.0; -webkit-transform: translate(-50%, -50%) scale(1.0); } + 5% { opacity: 0.5; -webkit-transform: translate(-50%, -50%) scale(0.5); } + 95% { opacity: 0.5; -webkit-transform: translate(-50%, -50%) scale(0.5); } + 100% { opacity: 1.0; -webkit-transform: translate(-50%, -50%) scale(1.0); } } @-moz-keyframes LOADERLABEL { - 0% { opacity: 1.0; -moz-transform: translate(-50%,-50%) scale(1.0); } - 5% { opacity: 0.5; -moz-transform: translate(-50%,-50%) scale(0.5); } - 95% { opacity: 0.5; -moz-transform: translate(-50%,-50%) scale(0.5); } - 100% { opacity: 1.0; -moz-transform: translate(-50%,-50%) scale(1.0); } + 0% { opacity: 1.0; -moz-transform: translate(-50%, -50%) scale(1.0); } + 5% { opacity: 0.5; -moz-transform: translate(-50%, -50%) scale(0.5); } + 95% { opacity: 0.5; -moz-transform: translate(-50%, -50%) scale(0.5); } + 100% { opacity: 1.0; -moz-transform: translate(-50%, -50%) scale(1.0); } } @-ms-keyframes LOADERLABEL { - 0% { opacity: 1.0; -ms-transform: translate(-50%,-50%) scale(1.0); } - 5% { opacity: 0.5; -ms-transform: translate(-50%,-50%) scale(0.5); } - 95% { opacity: 0.5; -ms-transform: translate(-50%,-50%) scale(0.5); } - 100% { opacity: 1.0; -ms-transform: translate(-50%,-50%) scale(1.0); } + 0% { opacity: 1.0; -ms-transform: translate(-50%, -50%) scale(1.0); } + 5% { opacity: 0.5; -ms-transform: translate(-50%, -50%) scale(0.5); } + 95% { opacity: 0.5; -ms-transform: translate(-50%, -50%) scale(0.5); } + 100% { opacity: 1.0; -ms-transform: translate(-50%, -50%) scale(1.0); } } @-o-keyframes LOADERLABEL { - 0% { opacity: 1.0; -o-transform: translate(-50%,-50%) scale(1.0); } - 5% { opacity: 0.5; -o-transform: translate(-50%,-50%) scale(0.5); } - 95% { opacity: 0.5; -o-transform: translate(-50%,-50%) scale(0.5); } - 100% { opacity: 1.0; -o-transform: translate(-50%,-50%) scale(1.0); } + 0% { opacity: 1.0; -o-transform: translate(-50%, -50%) scale(1.0); } + 5% { opacity: 0.5; -o-transform: translate(-50%, -50%) scale(0.5); } + 95% { opacity: 0.5; -o-transform: translate(-50%, -50%) scale(0.5); } + 100% { opacity: 1.0; -o-transform: translate(-50%, -50%) scale(1.0); } } @keyframes LOADERLABEL { - 0% { opacity: 1.0; transform: translate(-50%,-50%) scale(1.0); } - 5% { opacity: 0.5; transform: translate(-50%,-50%) scale(0.5); } - 95% { opacity: 0.5; transform: translate(-50%,-50%) scale(0.5); } - 100% { opacity: 1.0; transform: translate(-50%,-50%) scale(1.0); } + 0% { opacity: 1.0; transform: translate(-50%, -50%) scale(1.0); } + 5% { opacity: 0.5; transform: translate(-50%, -50%) scale(0.5); } + 95% { opacity: 0.5; transform: translate(-50%, -50%) scale(0.5); } + 100% { opacity: 1.0; transform: translate(-50%, -50%) scale(1.0); } } *, *:before, *:after { - margin: 0; - padding: 0; - box-sizing: border-box; - vertical-align: top; + margin: 0; + padding: 0; + box-sizing: border-box; + vertical-align: top; } .loaderoverlay { - position: absolute; - width: 100%; - height: 100%; - background: rgba(255,255,255,1.0); + position: absolute; + width: 100%; + height: 100%; + background: rgba(255, 255, 255, 1.0); } .loaderoverlay .loaderspinner, .loaderoverlay .loaderspinner:before, .loaderoverlay .loaderspinner:after { - border: 20px solid rgba(0,0,0,0); - border-top: 20px solid #ccc; - border-bottom: 20px solid #ccc; - border-radius: 1000px; - position: absolute; - top: 50%; - left: 50%; + border: 20px solid rgba(0, 0, 0, 0); + border-top: 20px solid #ccc; + border-bottom: 20px solid #ccc; + border-radius: 1000px; + position: absolute; + top: 50%; + left: 50%; } .loaderoverlay .loaderspinner:before, .loaderoverlay .loaderspinner:after { - content: ""; + content: ""; } .loaderoverlay .loaderspinner { - width: 200px; - height: 200px; - -webkit-animation: LOADERSPINNER 5s linear infinite; - -moz-animation: LOADERSPINNER 5s linear infinite; - -ms-animation: LOADERSPINNER 5s linear infinite; - -o-animation: LOADERSPINNER 5s linear infinite; - animation: LOADERSPINNER 5s linear infinite; + width: 200px; + height: 200px; + -webkit-animation: LOADERSPINNER 5s linear infinite; + -moz-animation: LOADERSPINNER 5s linear infinite; + -ms-animation: LOADERSPINNER 5s linear infinite; + -o-animation: LOADERSPINNER 5s linear infinite; + animation: LOADERSPINNER 5s linear infinite; } .loaderoverlay .loaderspinner:before { - width: 160px; - height: 160px; - -webkit-animation: LOADERSPINNER 10s linear infinite; - -moz-animation: LOADERSPINNER 10s linear infinite; - -ms-animation: LOADERSPINNER 10s linear infinite; - -o-animation: LOADERSPINNER 10s linear infinite; - animation: LOADERSPINNER 10s linear infinite; + width: 160px; + height: 160px; + -webkit-animation: LOADERSPINNER 10s linear infinite; + -moz-animation: LOADERSPINNER 10s linear infinite; + -ms-animation: LOADERSPINNER 10s linear infinite; + -o-animation: LOADERSPINNER 10s linear infinite; + animation: LOADERSPINNER 10s linear infinite; } .loaderoverlay .loaderspinner:after { - width: 120px; - height: 120px; - -webkit-animation: LOADERSPINNER 5s linear infinite; - -moz-animation: LOADERSPINNER 5s linear infinite; - -ms-animation: LOADERSPINNER 5s linear infinite; - -o-animation: LOADERSPINNER 5s linear infinite; - animation: LOADERSPINNER 5s linear infinite; + width: 120px; + height: 120px; + -webkit-animation: LOADERSPINNER 5s linear infinite; + -moz-animation: LOADERSPINNER 5s linear infinite; + -ms-animation: LOADERSPINNER 5s linear infinite; + -o-animation: LOADERSPINNER 5s linear infinite; + animation: LOADERSPINNER 5s linear infinite; } .loaderoverlay .loaderlabel { - color: #66ff33; - text-transform: uppercase; - font-family: sans-serif; - font-size: 22px; - font-weight: 700; - letter-spacing: 2px; - position: absolute; - top: 50%; - left: 50%; - -webkit-animation: LOADERLABEL 5s linear infinite; - -moz-animation: LOADERLABEL 5s linear infinite; - -ms-animation: LOADERLABEL 5s linear infinite; - -o-animation: LOADERLABEL 5s linear infinite; - animation: LOADERLABEL 5s linear infinite; + color: #6f3; + text-transform: uppercase; + font-family: sans-serif; + font-size: 22px; + font-weight: 700; + letter-spacing: 2px; + position: absolute; + top: 50%; + left: 50%; + -webkit-animation: LOADERLABEL 5s linear infinite; + -moz-animation: LOADERLABEL 5s linear infinite; + -ms-animation: LOADERLABEL 5s linear infinite; + -o-animation: LOADERLABEL 5s linear infinite; + animation: LOADERLABEL 5s linear infinite; } button[type="button"] { - padding: 0.5rem 1rem; - position: absolute; - z-index: 1; - bottom: 10px; - left: 50%; - -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%; + -webkit-transform: translateX(-50%); + -moz-transform: translateX(-50%); + -ms-transform: translateX(-50%); + -o-transform: translateX(-50%); + transform: translateX(-50%); } /* Customize */ .loaderoverlay { - background: #000; + background: #000; } .loaderoverlay .loaderspinner, .loaderoverlay .loaderspinner:before, .loaderoverlay .loaderspinner:after { - border-top-color: #66ff33!important; - border-bottom-color:#66ff33 !important; + border-top-color: #6f3 !important; + border-bottom-color: #6f3 !important; } .loaderoverlay .loaderlabel { - color: #66ff33; -} \ No newline at end of file + color: #6f3; +} diff --git a/css/menupages.css b/css/menupages.css index 8a73b0322..9960d4a90 100644 --- a/css/menupages.css +++ b/css/menupages.css @@ -1,12 +1,12 @@ /* CSS for different main menu pages, such as character info, script editor, etc (but excluding - terminal which has its own page) */ + terminal which has its own page) */ .generic-menupage-container { height: 100%; padding-left: 10px; margin-left: 10%; width: 99%; - overflow-y: scroll; + overflow-y: scroll; } /* Character Info */ @@ -17,7 +17,7 @@ /* Script Editor */ #script-editor-container { - background-color:transparent; + background-color: transparent; } #javascript-editor { margin: 10px; @@ -37,43 +37,43 @@ .ace_line, .ace_line * { - background-color:transparent; - margin:0px; - padding:0px; + background-color: transparent; + margin: 0; + padding: 0; } .ace_text-input { - font-size:16px; - background-color:transparent; + font-size: 16px; + background-color: transparent; } /* This temp element is used for auto adjusting filename field */ .tmp-element { - visibility: hidden; - white-space: pre; + visibility: hidden; + white-space: pre; } #script-editor-container { - position: fixed; - padding-top: 10px; + position: fixed; + padding-top: 10px; } #script-editor-buttons-wrapper { width: 100%; - padding-right: 0xp; - margin-right: 0px; + padding-right: 0; + margin-right: 0; } #script-editor-wrapper { - height:100%; + height: 100%; width: 70%; - background:transparent; + background: transparent; } #script-editor-filename-wrapper { background-color: #555; margin-left: 6px; - margin-right: 0px; + margin-right: 0; padding-left: 6px; width: 100%; border: 2px solid var(--my-highlight-color); @@ -82,57 +82,57 @@ #script-editor-filename-tag { display: inline-block; padding-top: 10px; - padding-bottom: 0px; - float:center; + padding-bottom: 0; + float: center; background-color: #555; - color: white; + color: #fff; } #script-editor-filename { background-color: #555; display: inline-block; - float: center; - resize: none; - color: white; + float: center; + resize: none; + color: #fff; margin: 4px; - padding: 2px; + padding: 2px; border: 2px solid var(--my-highlight-color); -webkit-box-shadow: - inset 0 0 8px rgba(0,0,0,0.1), - 0 0 16px rgba(0,0,0,0.1); + inset 0 0 8px rgba(0, 0, 0, 0.1), + 0 0 16px rgba(0, 0, 0, 0.1); -moz-box-shadow: - inset 0 0 8px rgba(0,0,0,0.1), - 0 0 16px rgba(0,0,0,0.1); + inset 0 0 8px rgba(0, 0, 0, 0.1), + 0 0 16px rgba(0, 0, 0, 0.1); box-shadow: - inset 0 0 8px rgba(0,0,0,0.1), - 0 0 16px rgba(0,0,0,0.1); + inset 0 0 8px rgba(0, 0, 0, 0.1), + 0 0 16px rgba(0, 0, 0, 0.1); } #script-editor-status { - float: left; - color: #ffffff; + float: left; + color: #fff; } #script-editor-options-panel { - position:absolute; + position: absolute; right: 9%; - bottom:15%; - border:2px solid white; - width:19%; - background-color:#444; - padding:2px; - overflow:auto; + bottom: 15%; + border: 2px solid #fff; + width: 19%; + background-color: #444; + padding: 2px; + overflow: auto; z-index: 1; - color: white; + color: #fff; } #script-editor-options-panel fieldset { - margin-top:8px; - margin-bottom:8px; + margin-top: 8px; + margin-bottom: 8px; padding: 2px; - font-size:12px; + font-size: 12px; } /* Active scripts */ @@ -141,8 +141,8 @@ } #active-scripts-container { - position: fixed; - padding-top: 10px; + position: fixed; + padding-top: 10px; } #active-scripts-text, @@ -155,8 +155,8 @@ .active-scripts-server-header { background-color: #444; font-size: 20px; - color: white; - margin: 6px 6px 0px 6px; + color: #fff; + margin: 6px 6px 0 6px; padding: 6px; cursor: pointer; width: 60%; @@ -177,7 +177,7 @@ .active-scripts-server-header:after { content: '\02795'; /* "plus" sign (+) */ font-size: 13px; - color: white; + color: #fff; float: right; margin-left: 5px; } @@ -185,14 +185,14 @@ .active-scripts-server-header.active:after { content: "\2796"; /* "minus" sign (-) */ font-size: 13px; - color: white; + color: #fff; float: right; margin-left: 5px; } .active-scripts-server-panel { - margin: 0px 6px 6px 6px; - padding: 0px 6px 6px 6px; + margin: 0 6px 6px 6px; + padding: 0 6px 6px 6px; width: 55%; margin-left: 5%; display: none; @@ -255,7 +255,7 @@ .active-scripts-script-panel li { background-color: #555; width: auto; - color: white; + color: #fff; margin-left: 5%; } @@ -271,12 +271,12 @@ box-shadow: 1px 1px 3px #000; margin: 4px; padding: 4px; - background-color:black; + background-color: #000; } .active-scripts-button:hover, .active-scripts-button:focus { - color: white; + color: #fff; text-decoration: none; cursor: pointer; } @@ -328,14 +328,14 @@ width: 34vw; border: 2px solid var(--my-highlight-color); -webkit-box-shadow: - inset 0 0 8px rgba(0,0,0,0.1), - 0 0 16px rgba(0,0,0,0.1); + inset 0 0 8px rgba(0, 0, 0, 0.1), + 0 0 16px rgba(0, 0, 0, 0.1); -moz-box-shadow: - inset 0 0 8px rgba(0,0,0,0.1), - 0 0 16px rgba(0,0,0,0.1); + inset 0 0 8px rgba(0, 0, 0, 0.1), + 0 0 16px rgba(0, 0, 0, 0.1); box-shadow: - inset 0 0 8px rgba(0,0,0,0.1), - 0 0 16px rgba(0,0,0,0.1); + inset 0 0 8px rgba(0, 0, 0, 0.1), + 0 0 16px rgba(0, 0, 0, 0.1); } .hacknet-node-container { @@ -368,7 +368,6 @@ padding-top: 10px; } - #world-city-name, #world-city-desc { padding: 4px; @@ -403,11 +402,11 @@ } .faction-work-div-wrapper { - overflow:hidden; + overflow: hidden; border: 2px solid #333; padding: 6px; margin: 6px; - width:70%; + width: 70%; } #faction-donate-amount-txt, @@ -416,11 +415,11 @@ margin: 6px; display: inline-block; color: var(--my-font-color); - background-color:black; + background-color: #000; } #faction-donate-amount-txt { - width:50%; + width: 50%; } #faction-container p, @@ -467,7 +466,7 @@ .augmentations-list button, .augmentations-list div { color: var(--my-font-color); - padding: 8px; + padding: 8px; text-decoration: none; } @@ -503,13 +502,13 @@ /* Location */ #location-container { - position: fixed; - padding: 6px; + position: fixed; + padding: 6px; overflow-x: hidden; } #location-container a { - display:inline-block; + display: inline-block; width: 30%; } @@ -524,7 +523,7 @@ } #location-container * { - margin: 10px 5px 10px 5px; + margin: 10px 5px 10px 5px; } #location-job-reputation, #location-company-favor { @@ -538,8 +537,8 @@ } #infiltration-left-panel, #infiltration-right-panel { - display:inline-block; - border: 1px solid white; + display: inline-block; + border: 1px solid #fff; width: 35%; height: 75%; top: 10px; @@ -548,7 +547,7 @@ } #infiltration-faction-select { - color:white; + color: #fff; } #infiltration-left-panel p, @@ -557,7 +556,7 @@ } #infiltration-buttons .a-link-button { - display:inline; + display: inline; width: 25%; } @@ -581,27 +580,27 @@ display: inline-block; padding: 4px; margin: 2px; - background-color: black; - border: 1px solid white; + background-color: #000; + border: 1px solid #fff; color: var(--my-font-color); } .stock-market-position-text { - color:white; - display:inline-block; + color: #fff; + display: inline-block; } .stock-market-order-list { - overflow-y:auto; + overflow-y: auto; max-height: 100px; } .stock-market-order-cancel-btn { - background-color: black; - border: 1px solid white; + background-color: #000; + border: 1px solid #fff; color: var(--my-font-color); margin: 2px; - padding: 0px; + padding: 0; } /* Gang */ @@ -615,6 +614,6 @@ } .gang-member-info-div { - float:left; + float: left; background-color: #555; } diff --git a/css/missions.css b/css/missions.css index ee1a22e17..6a958ac12 100644 --- a/css/missions.css +++ b/css/missions.css @@ -2,40 +2,38 @@ /* Hacking missions */ #mission-container { - overflow:hidden; + overflow: hidden; } .hack-mission-grid { display: grid; - /*grid-template-columns: 11% 11% 11% 11% 11% 11% 11% 11%;*/ grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr; - /*grid-template-rows: 10% 10% 10% 10% 10% 10% 10% 10%;*/ grid-template-rows: 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr; grid-gap: 2.5%; height: 90%; - position:absolute; + position: absolute; width: 100%; - overflow-y:auto; + overflow-y: auto; padding-right: 10px; } .hack-mission-grid::-webkit-scrollbar { - display:none; + display: none; } .hack-mission-node { - z-index:5; - background-color:gray; + z-index: 5; + background-color: #808080; align-self: center; justify-self: center; - display:inline-block; + display: inline-block; } .hack-mission-node p { - margin-top:8px; - color:white; - font-size:12px; - text-align:center; + margin-top: 8px; + color: #fff; + font-size: 12px; + text-align: center; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; @@ -43,49 +41,49 @@ } .hack-mission-player-node { - color:white; - background-color:blue; + color: #fff; + background-color: #00f; } .hack-mission-player-node-active { - border: 2px solid white; - background-color: #6666ff; + border: 2px solid #fff; + background-color: #66f; } .hack-mission-enemy-node { - color:white; - background-color:red; + color: #fff; + background-color: #f00; } .hack-mission-cpu-node { - width:100%; - height:100%; + width: 100%; + height: 100%; -moz-border-radius: 50%; -webkit-border-radius: 50%; border-radius: 50%; } .hack-mission-firewall-node { - width:90%; - height:100%; + width: 90%; + height: 100%; } .hack-mission-database-node { width: 100%; - height: 90%; - -webkit-transform: skew(20deg); - -moz-transform: skew(20deg); - -o-transform: skew(20deg); + height: 90%; + -webkit-transform: skew(20deg); + -moz-transform: skew(20deg); + -o-transform: skew(20deg); } .hack-mission-database-node p { -webkit-transform: skew(-20deg); - -moz-transform: skew(-20deg); - -o-transform: skew(-20deg); - color:white; - font-size:12px; + -moz-transform: skew(-20deg); + -o-transform: skew(-20deg); + color: #fff; + font-size: 12px; margin-top: 8px; - text-align:center; + text-align: center; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; @@ -94,20 +92,20 @@ .hack-mission-transfer-node { width: 100%; - height: 90%; - -webkit-transform: skew(-20deg); - -moz-transform: skew(-20deg); - -o-transform: skew(-20deg); + height: 90%; + -webkit-transform: skew(-20deg); + -moz-transform: skew(-20deg); + -o-transform: skew(-20deg); } .hack-mission-transfer-node p { -webkit-transform: skew(20deg); - -moz-transform: skew(20deg); - -o-transform: skew(20deg); - color:white; - font-size:12px; + -moz-transform: skew(20deg); + -o-transform: skew(20deg); + color: #fff; + font-size: 12px; margin-top: 8px; - text-align:center; + text-align: center; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; @@ -116,7 +114,7 @@ .hack-mission-spam-node, .hack-mission-shield-node { - height:100%; + height: 100%; width: 100%; } @@ -128,5 +126,5 @@ } .hack-mission-action-buttons-container { - border: 2px solid white; + border: 2px solid #fff; } diff --git a/css/popupboxes.css b/css/popupboxes.css index 38bc7f503..2b92cdd33 100644 --- a/css/popupboxes.css +++ b/css/popupboxes.css @@ -7,7 +7,7 @@ top: 0; width: 100%; height: 100%; - overflow:auto; + overflow: auto; background-color: rbga(var(--my-background-color), 0.4); } @@ -28,8 +28,8 @@ font-weight: bold; padding: 2px; margin: 6px; - border: 1px solid white; - background-color:black; + border: 1px solid #fff; + background-color: #000; } .popup-box-button:hover, @@ -46,8 +46,8 @@ #yes-no-text-input-box-input { color: var(--my-font-color); - border: 1px solid white; - background-color:black; + border: 1px solid #fff; + background-color: #000; } .dialog-box-container, @@ -97,13 +97,13 @@ } #log-box-close, #log-box-kill-script { - float:right; - display:inline-block; + float: right; + display: inline-block; } .dialog-box-close-button:hover, .dialog-box-close-button:focus,{ - color: white; + color: #fff; text-decoration: none; cursor: pointer; } @@ -126,12 +126,12 @@ } #infiltration-faction-select { - background-color:black; + background-color: #000; } /* Generic Yes No Box */ #yes-no-text-input-box-input { - color: white; + color: #fff; } /* Game Options */ @@ -163,7 +163,7 @@ font-weight: bold; -webkit-border-radius: 12px; -moz-border-radius: 12px; - border-radius: 12px white; + border-radius: 12px #fff; -moz-box-shadow: 1px 1px 3px #000; -webkit-box-shadow: 1px 1px 3px #000; box-shadow: 1px 1px 3px #000; @@ -171,16 +171,16 @@ #game-options-close-button:hover, #game-options-close-button:focus { - color: white; + color: #fff; text-decoration: none; cursor: pointer; } #game-options-left-panel fieldset { - padding:2px; - margin:2px; + padding: 2px; + margin: 2px; } #import-game-file-selector { - display:none; + display: none; } diff --git a/css/styles.css b/css/styles.css index 211fc85d2..b8b320957 100644 --- a/css/styles.css +++ b/css/styles.css @@ -1,7 +1,7 @@ :root{ - --my-font-color: #66ff33; - --my-background-color: #000000; - --my-highlight-color: #ffffff; + --my-font-color: #6f3; + --my-background-color: #000; + --my-highlight-color: #fff; } * { @@ -42,7 +42,7 @@ span { } #entire-game-container { - background-color:transparent; + background-color: transparent; } /* Disable border highlight on elements */ @@ -51,7 +51,7 @@ textarea:focus, button:focus, td:focus, tr:focus { - outline:none; + outline: none; } /* Main navigation menu */ @@ -65,13 +65,13 @@ tr:focus { overflow: auto; border: 0; - border-bottom: 1px solid #000000; - border-radius: 0; - background-color: #333; + border-bottom: 1px solid #000; + border-radius: 0; + background-color: #333; } /* Default buttons */ -.mainmenu>li a { +.mainmenu > li a { display: block; color: #e6e6e6; background-color: #555; @@ -80,28 +80,28 @@ tr:focus { } /* Hovering makes them lighter */ -.mainmenu>li a:hover, -.mainmenu>li a:hover:not(.active), -.mainmenu>li a:focus { +.mainmenu > li a:hover, +.mainmenu > li a:hover:not(.active), +.mainmenu > li a:focus { background-color: #777; - color: white; + color: #fff; } /* Panel headers can become active, and they are "lighter" than the rest */ -.mainmenu>li a.active { +.mainmenu > li a.active { background-color: #777; - color: white; + color: #fff; } -.mainmenu>li a.active:hover { - background-color:#aaa; +.mainmenu > li a.active:hover { + background-color: #aaa; } /* Plus and minus signs */ .mainmenu-accordion-header:after { content: '\02795'; font-size: 13px; - color: white; + color: #fff; float: right; margin-left: 5px; } @@ -111,7 +111,7 @@ tr:focus { } .mainmenu-accordion-header.opened { - background-color:#222; + background-color: #222; } /* Slide down transition */ @@ -123,21 +123,21 @@ tr:focus { /* Borders */ .mainmenu-accordion-header { - border:2px solid white; + border: 2px solid #fff; } /* Make html links ("a" elements) nice looking buttons with this class */ a:link, a:visited { - color:white; + color: #fff; } .a-link-button { text-decoration: none; background-color: #555; - color: #FFFFFF; + color: #fff; padding: 5px; margin: 5px; - border: 1px solid #333333; + border: 1px solid #333; -moz-user-select: none; -ms-user-select: none; @@ -151,18 +151,18 @@ a:link, a:visited { .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); + -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: #FFFFFF; + color: #fff; padding: 5px; margin: 5px; - border: 1px solid #333333; + border: 1px solid #333; cursor: default; } @@ -179,11 +179,11 @@ a:link, a:visited { /* Make anchor tags ("a" elements) for activated actions */ .a-link-button-bought { text-decoration: none; - background-color: #00AA00; - color: #FFFFFF; + background-color: #0a0; + color: #fff; padding: 5px; margin: 5px; - border: 1px solid #00AA00; + border: 1px solid #0a0; cursor: default; } @@ -198,18 +198,18 @@ a:link, a:visited { } .dropdown { - color:white; - background-color:black; + color: #fff; + background-color: #000; } .text-input { - color:white; - background-color:black; + color: #fff; + background-color: #000; } /* Notification icon (for create program right now only) */ #create-program-tab { - position:relative; + position: relative; } #create-program-notification { font-size: 10px; @@ -221,7 +221,7 @@ a:link, a:visited { .notification-on { background-color: #fa3e3e; - color: white; + color: #fff; border-radius: 2px; padding: 1px 3px; } @@ -229,8 +229,8 @@ a:link, a:visited { .notification-off { background-color: #333; color: #333; - border-radius: 0px; - padding: 0px; + border-radius: 0; + padding: 0; } /* Tool tips (when hovering over an element */ @@ -243,8 +243,8 @@ a:link, a:visited { visibility: hidden; width: 300px; background-color: var(--my-background-color); - border: 2px solid var(--my-highlight-color);; - color: white; + border: 2px solid var(--my-highlight-color); + color: #fff; text-align: center; padding: 4px; left: 101%; @@ -258,12 +258,12 @@ a:link, a:visited { visibility: hidden; width: 300px; background-color: var(--my-background-color); - border: 2px solid var(--my-highlight-color);; - color: white; + border: 2px solid var(--my-highlight-color); + color: #fff; text-align: center; padding: 4px; left: 101%; - bottom:-25%; + bottom: -25%; position: absolute; z-index: 99; @@ -275,12 +275,12 @@ a:link, a:visited { visibility: hidden; width: 300px; background-color: var(--my-background-color); - border: 2px solid var(--my-highlight-color);; - color: white; + border: 2px solid var(--my-highlight-color); + color: #fff; text-align: center; padding: 4px; left: 40%; - bottom:-10%; + bottom: -10%; position: absolute; z-index: 99; @@ -294,13 +294,13 @@ a:link, a:visited { /* help tip. Question mark that opens popup with info/details */ .help-tip { - content:'?'; - padding:1px; - margin-left:3px; - color:#fff; - border:1px solid white; - border-radius:5px; - display:inline-block; + content: '?'; + padding: 1px; + margin-left: 3px; + color: #fff; + border: 1px solid #fff; + border-radius: 5px; + display: inline-block; } .help-tip:hover { @@ -309,33 +309,33 @@ a:link, a:visited { .help-tip: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); + -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); } /* Flashing button (Red) */ @-webkit-keyframes glowing { - 0% { background-color: #B20000; -webkit-box-shadow: 0 0 3px #B20000; } - 50% { background-color: #FF0000; -webkit-box-shadow: 0 0 40px #FF0000; } - 100% { background-color: #B20000; -webkit-box-shadow: 0 0 3px #B20000; } + 0% { background-color: #b20000; -webkit-box-shadow: 0 0 3px #b20000; } + 50% { background-color: #f00; -webkit-box-shadow: 0 0 40px #f00; } + 100% { background-color: #b20000; -webkit-box-shadow: 0 0 3px #b20000; } } @-moz-keyframes glowing { - 0% { background-color: #B20000; -moz-box-shadow: 0 0 3px #B20000; } - 50% { background-color: #FF0000; -moz-box-shadow: 0 0 40px #FF0000; } - 100% { background-color: #B20000; -moz-box-shadow: 0 0 3px #B20000; } + 0% { background-color: #b20000; -moz-box-shadow: 0 0 3px #b20000; } + 50% { background-color: #f00; -moz-box-shadow: 0 0 40px #f00; } + 100% { background-color: #b20000; -moz-box-shadow: 0 0 3px #b20000; } } @-o-keyframes glowing { - 0% { background-color: #B20000; box-shadow: 0 0 3px #B20000; } - 50% { background-color: #FF0000; box-shadow: 0 0 40px #FF0000; } - 100% { background-color: #B20000; box-shadow: 0 0 3px #B20000; } + 0% { background-color: #b20000; box-shadow: 0 0 3px #b20000; } + 50% { background-color: #f00; box-shadow: 0 0 40px #f00; } + 100% { background-color: #b20000; box-shadow: 0 0 3px #b20000; } } @keyframes glowing { - 0% { background-color: #B20000; box-shadow: 0 0 3px #B20000; } - 50% { background-color: #FF0000; box-shadow: 0 0 40px #FF0000; } - 100% { background-color: #B20000; box-shadow: 0 0 3px #B20000; } + 0% { background-color: #b20000; box-shadow: 0 0 3px #b20000; } + 50% { background-color: #f00; box-shadow: 0 0 40px #f00; } + 100% { background-color: #b20000; box-shadow: 0 0 3px #b20000; } } .flashing-button { @@ -348,57 +348,57 @@ a:link, a:visited { /* Blinking Cursor */ /* ----- blinking cursor animation ----- */ .typed-cursor{ - opacity: 1; - -webkit-animation: blink 0.95s infinite; - -moz-animation: blink 0.95s infinite; - -ms-animation: blink 0.95s infinite; - -o-animation: blink 0.95s infinite; - animation: blink 0.95s infinite; + opacity: 1; + -webkit-animation: blink 0.95s infinite; + -moz-animation: blink 0.95s infinite; + -ms-animation: blink 0.95s infinite; + -o-animation: blink 0.95s infinite; + animation: blink 0.95s infinite; } @-keyframes blink{ - 0% { opacity:1; } - 50% { opacity:0; } - 100% { opacity:1; } + 0% { opacity: 1; } + 50% { opacity: 0; } + 100% { opacity: 1; } } @-webkit-keyframes blink{ - 0% { opacity:1; } - 50% { opacity:0; } - 100% { opacity:1; } + 0% { opacity: 1; } + 50% { opacity: 0; } + 100% { opacity: 1; } } @-moz-keyframes blink{ - 0% { opacity:1; } - 50% { opacity:0; } - 100% { opacity:1; } + 0% { opacity: 1; } + 50% { opacity: 0; } + 100% { opacity: 1; } } @-ms-keyframes blink{ - 0% { opacity:1; } - 50% { opacity:0; } - 100% { opacity:1; } + 0% { opacity: 1; } + 50% { opacity: 0; } + 100% { opacity: 1; } } @-o-keyframes blink{ - 0% { opacity:1; } - 50% { opacity:0; } - 100% { opacity:1; } + 0% { opacity: 1; } + 50% { opacity: 0; } + 100% { opacity: 1; } } /* Status text */ @-webkit-keyframes status-text{ from{ - opacity:1; - top:0px; + opacity: 1; + top: 0; } to{ - opacity:0; - top:0px; + opacity: 0; + top: 0; } } .status-text{ - display:inline; - position:fixed; - top:0px; - -webkit-animation:status-text 3s 1; + display: inline; + position: fixed; + top: 0; + -webkit-animation: status-text 3s 1; background-color: transparent; height: 15%; } @@ -409,7 +409,7 @@ a:link, a:visited { #status-text { font-size: 20px; - color: #FFFFFF; + color: #fff; right: 0; bottom: 0; padding: 4px; @@ -429,7 +429,6 @@ a:link, a:visited { right: 0; top: 0; height: 205px; /* Full height */ - /*margin: 50% auto;*/ padding: 5px; border: 2px solid var(--my-highlight-color); width: 19%; @@ -441,7 +440,7 @@ a:link, a:visited { #character-overview-text { padding: 4px; margin: 8px; - color: white; + color: #fff; background-color: #444; } @@ -457,14 +456,14 @@ a:link, a:visited { -webkit-box-shadow: 1px 1px 3px #000; box-shadow: 1px 1px 3px #000; height: 22px; - background-color:black; + background-color: #000; } #character-overview-save-button:hover, #character-overview-save-button:focus, #character-overview-options-button:hover, #character-overview-options-button:focus { - color: white; + color: #fff; text-decoration: none; cursor: pointer; } @@ -475,20 +474,20 @@ a:link, a:visited { /* Scan analyze links from AutoLink */ .scan-analyze-link { - cursor:pointer; - color:#FFFFFF; - text-decoration:underline; + cursor: pointer; + color: #fff; + text-decoration: underline; } .scan-analyze-link:hover { - text-decoration:none; + text-decoration: none; } /* Accordion menus (Header with collapsible panel) */ .accordion-header { background-color: #444; font-size: 20px; - color: white; - margin: 6px 6px 0px 6px; + color: #fff; + margin: 6px 6px 0 6px; padding: 6px; cursor: pointer; width: 80%; @@ -509,7 +508,7 @@ a:link, a:visited { .accordion-header:after { content: '\02795'; /* "plus" sign (+) */ font-size: 13px; - color: white; + color: #fff; float: right; margin-left: 5px; } @@ -517,20 +516,20 @@ a:link, a:visited { .accordion-header.active:after { content: "\2796"; /* "minus" sign (-) */ font-size: 13px; - color: white; + color: #fff; float: right; margin-left: 5px; } .accordion-panel { - margin: 0px 6px 6px 6px; - padding: 0px 6px 6px 6px; + margin: 0 6px 6px 6px; + padding: 0 6px 6px 6px; width: 75%; margin-left: 5%; display: none; background-color: #555; - overflow-y:auto; - overflow-x:none; + overflow-y: auto; + overflow-x: none; } .accordion-panel div, diff --git a/css/terminal.css b/css/terminal.css index 76fb71737..54da4e75e 100644 --- a/css/terminal.css +++ b/css/terminal.css @@ -1,10 +1,10 @@ #terminal-container { position: fixed; margin-left: 10%; - height: 100%; + height: 100%; width: 99%; - overflow: auto; - overflow-y: scroll; + overflow: auto; + overflow-y: scroll; } #terminal { @@ -13,10 +13,10 @@ height: auto; width: 70%; font-size: 16px; - overflow: auto; - overflow-y: scroll; + overflow: auto; + overflow-y: scroll; background-color: var(--my-background-color); - table-layout:fixed; + table-layout: fixed; } #terminal-input { @@ -26,20 +26,20 @@ } .terminal-input { - display: inline-block; - padding: 0px !important; - margin: 0px !important; - border: 0px; - background-color: var(--my-background-color); - font-size: 16px; - outline: none; + display: inline-block; + padding: 0 !important; + margin: 0 !important; + border: 0; + background-color: var(--my-background-color); + font-size: 16px; + outline: none; color: var(--my-font-color); } .terminal-line { width: 70%; word-wrap: break-word; - hyphens:auto; + hyphens: auto; -webkit-hyphens: auto; -moz-hyphens: auto; } diff --git a/css/workinprogress.css b/css/workinprogress.css index 80717fa3d..ed922ee65 100644 --- a/css/workinprogress.css +++ b/css/workinprogress.css @@ -25,7 +25,7 @@ margin: 10px; padding: 5px; border-radius: 12px; - border: 3px solid white; + border: 3px solid #fff; -moz-box-shadow: 1px 1px 3px #000; -webkit-box-shadow: 1px 1px 3px #000; box-shadow: 1px 1px 3px #000; @@ -33,7 +33,7 @@ #work-in-progress-cancel-button:hover, #work-in-progress-cancel-button:focus { - color: white; + color: #fff; text-decoration: none; cursor: pointer; } @@ -44,12 +44,12 @@ } .bitnode { - color:blue; + color: #00f; } .bitnode-destroyed { - color:red; + color: #f00; } .bitnode:hover, .bitnode-destroyed:hover { - color:white; + color: #fff; } diff --git a/doc/Makefile b/doc/Makefile index 04de3e359..5be0931a8 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -4,7 +4,6 @@ # You can set these variables from the command line. SPHINXOPTS = SPHINXBUILD = python -msphinx -SPHINXPROJ = Bitburner SOURCEDIR = source BUILDDIR = build diff --git a/doc/build/doctrees/changelog.doctree b/doc/build/doctrees/changelog.doctree deleted file mode 100644 index 54828a601..000000000 Binary files a/doc/build/doctrees/changelog.doctree and /dev/null differ diff --git a/doc/build/doctrees/environment.pickle b/doc/build/doctrees/environment.pickle deleted file mode 100644 index f38f805e8..000000000 Binary files a/doc/build/doctrees/environment.pickle and /dev/null differ diff --git a/doc/build/doctrees/index.doctree b/doc/build/doctrees/index.doctree deleted file mode 100644 index b529b68d8..000000000 Binary files a/doc/build/doctrees/index.doctree and /dev/null differ diff --git a/doc/build/doctrees/netscript.doctree b/doc/build/doctrees/netscript.doctree deleted file mode 100644 index 674a4b449..000000000 Binary files a/doc/build/doctrees/netscript.doctree and /dev/null differ diff --git a/doc/build/doctrees/netscriptadvancedfunctions.doctree b/doc/build/doctrees/netscriptadvancedfunctions.doctree deleted file mode 100644 index 558b06819..000000000 Binary files a/doc/build/doctrees/netscriptadvancedfunctions.doctree and /dev/null differ diff --git a/doc/build/doctrees/netscriptbladeburnerapi.doctree b/doc/build/doctrees/netscriptbladeburnerapi.doctree deleted file mode 100644 index f9b1b19e1..000000000 Binary files a/doc/build/doctrees/netscriptbladeburnerapi.doctree and /dev/null differ diff --git a/doc/build/doctrees/netscriptdatatypes.doctree b/doc/build/doctrees/netscriptdatatypes.doctree deleted file mode 100644 index efbdad60c..000000000 Binary files a/doc/build/doctrees/netscriptdatatypes.doctree and /dev/null differ diff --git a/doc/build/doctrees/netscriptfunctions.doctree b/doc/build/doctrees/netscriptfunctions.doctree deleted file mode 100644 index 2540e9bd6..000000000 Binary files a/doc/build/doctrees/netscriptfunctions.doctree and /dev/null differ diff --git a/doc/build/doctrees/netscripthacknetnodeapi.doctree b/doc/build/doctrees/netscripthacknetnodeapi.doctree deleted file mode 100644 index 2deecc153..000000000 Binary files a/doc/build/doctrees/netscripthacknetnodeapi.doctree and /dev/null differ diff --git a/doc/build/doctrees/netscriptixapi.doctree b/doc/build/doctrees/netscriptixapi.doctree deleted file mode 100644 index 5334d1342..000000000 Binary files a/doc/build/doctrees/netscriptixapi.doctree and /dev/null differ diff --git a/doc/build/doctrees/netscriptjs.doctree b/doc/build/doctrees/netscriptjs.doctree deleted file mode 100644 index 23da6ced5..000000000 Binary files a/doc/build/doctrees/netscriptjs.doctree and /dev/null differ diff --git a/doc/build/doctrees/netscriptloopsandconditionals.doctree b/doc/build/doctrees/netscriptloopsandconditionals.doctree deleted file mode 100644 index b0807422c..000000000 Binary files a/doc/build/doctrees/netscriptloopsandconditionals.doctree and /dev/null differ diff --git a/doc/build/doctrees/netscriptmisc.doctree b/doc/build/doctrees/netscriptmisc.doctree deleted file mode 100644 index 8bc99cf30..000000000 Binary files a/doc/build/doctrees/netscriptmisc.doctree and /dev/null differ diff --git a/doc/build/doctrees/netscriptoperators.doctree b/doc/build/doctrees/netscriptoperators.doctree deleted file mode 100644 index a71e96239..000000000 Binary files a/doc/build/doctrees/netscriptoperators.doctree and /dev/null differ diff --git a/doc/build/doctrees/netscriptscriptarguments.doctree b/doc/build/doctrees/netscriptscriptarguments.doctree deleted file mode 100644 index 11484727f..000000000 Binary files a/doc/build/doctrees/netscriptscriptarguments.doctree and /dev/null differ diff --git a/doc/build/doctrees/netscriptsingularityfunctions.doctree b/doc/build/doctrees/netscriptsingularityfunctions.doctree deleted file mode 100644 index 200fec04f..000000000 Binary files a/doc/build/doctrees/netscriptsingularityfunctions.doctree and /dev/null differ diff --git a/doc/build/doctrees/shortcuts.doctree b/doc/build/doctrees/shortcuts.doctree deleted file mode 100644 index c34f9b14e..000000000 Binary files a/doc/build/doctrees/shortcuts.doctree and /dev/null differ diff --git a/doc/build/doctrees/terminal.doctree b/doc/build/doctrees/terminal.doctree deleted file mode 100644 index 305c53b75..000000000 Binary files a/doc/build/doctrees/terminal.doctree and /dev/null differ diff --git a/doc/build/html/.buildinfo b/doc/build/html/.buildinfo deleted file mode 100644 index 664bc1dd2..000000000 --- a/doc/build/html/.buildinfo +++ /dev/null @@ -1,4 +0,0 @@ -# Sphinx build info version 1 -# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. -config: 2dc85c27d5b3eafd764454e0cb5932ea -tags: 645f666f9bcd5a90fca523b33c5a78b7 diff --git a/doc/build/html/.nojekyll b/doc/build/html/.nojekyll deleted file mode 100644 index e69de29bb..000000000 diff --git a/doc/build/html/_sources/changelog.rst.txt b/doc/build/html/_sources/changelog.rst.txt deleted file mode 100644 index cefdac4dd..000000000 --- a/doc/build/html/_sources/changelog.rst.txt +++ /dev/null @@ -1,803 +0,0 @@ -.. _changelog: - -Changelog -========= - -v0.39.1 - 7/4/2018 ------------------- - -* Bladeburner Rank gain in BN-7 is now reduced by 40% instead of 50% -* Quadrupled the amount of money gained from Bladeburner contracts -* Added joinBladeburnerDivision() Netscript function to Bladeburner API -* Doubled the effects of Source-File 5. Now gives 8%, 12%, and 14% increase to all hacking multipliers " + -at levels 1, 2, and 3, respectively (increased from 4%/6%, 7%) -* Increased the effect of Source-File 8. It now gives a 12%, 18% and 21% to your hacking growth multiplier " + -at levels 1, 2, and 3, respectively (increased from 8%, 12%, 14%) -* The effect of Source-File 12 is now additive with itself, rather than multiplicative. This means " + -that level N of Source-File 12 now increases all multipliers by N% -* The setting to suppress the confirmation box when purchasing Augmentations was moved into the main Options menu (by Github user hydroflame) -* Bug Fix: Crime Success rates were being calculated incorrectly (by Github user hydroflame) -* When an Infiltration is finished, you will now return back to the company's page, rather than the city -* Infiltration faction reputation selector now remembers your last choice -* Significantly increased the amount of money gained from Infiltration -* Bug Fix: Copying a NetscriptJS script to another server using scp now properly takes into account " + -the script's changes. -* Bug Fix: Fixed an issue where game would not load in Edge due to incompatible features -* travelToCity() Singularity function no longer grants Intelligence exp" - -v0.39.0 - 6/25/2018 -------------------- - -* Added BitNode-7: Bladeburner 2079 -* Infiltration base difficulty decreased by 10% for most locations -* Experience gains from Infiltration slightly increased -* Money gained from Infiltration increased by 20% -* Added 'var' declarations in Netscript 1.0 (only works with 'var', not 'let' or 'const') -* Script base RAM cost is now 1.6 GB (increased from 1.4 GB) -* While/for loops and if statements no longer cost RAM in scripts -* Made short-circuit evaluation logic more consistent in Netscript 1.0 (see https://github.com/danielyxie/bitburner/issues/308) -* Changelog button in the Options menu now links to the new Changelog URL (by Github user thePalindrome) -* Skill level calculation is now 'smoother' (by Github user hydroflame) -* Added a button to 'beautify' scripts in the text editor (by Github user hydroflame) -* Added favicon (by Github user kopelli) - -v0.38.1 - 6/15/2018 -------------------- -* Bug Fix: Using 'Object.prototype' functions like toLocaleString() or toString() should no longer cause errors in NetscriptJS -* Implemented by Github user hydroflame: - * Accessing the 'window' and 'document' objects in Netscript JS now requires a large amount of RAM (100 GB) - * Added game option to suppress travel confirmation - * Text on buttons can no longer be highlighted - * Bug Fix: Fixed an issue that caused NaN values when exporting Real Estate in Corporations - * Bug Fix: Competition and Demand displays in Corporation are now correct (were reversed before) - * Added ps() Netscript function - * Bug Fix: grow() should no longer return/log a negative value when it runs on a server that's already at max money - * Bug Fix: serverExists() Netscript function should now properly return false for non-existent hostname/ips - * Bug Fix: Sever's security level should now properly increase when its money is grown to max value - -v0.38.0 - 6/12/2018 -------------------- -* New BitNode: BN-12 The Recursion - Implemented by Github user hydroflame -* Bladeburner Changes: - * Bladeburner progress is no longer reset when installing Augmentations - * The number of successess needed to increase a Contract/Operation's max level now scales with the current max level (gradually gets harder) - * All Bladeburner Augmentations are now slightly more expensive and require more reputation - * Black Operations now give higher rank rewards - * Doubled the base amount of money gained from Contracts - * Increased the amount of experience gained from Contracts/Actions - * Added a new Augmentation: The Blade's Simulacrum - * Bladeburner faction reputation gain is now properly affected by favor -* Hacking is now slightly less profitable in BitNode-3 -* Updated Hacknet Nodes UI - Implemented by Github user kopelli -* Bug Fix: Fixed an exploit that allowed calling any Netscript function without incurring any RAM Cost in NetscriptJS - -v0.37.2 - 6/2/2018 ------------------- - -* After joining the Bladeburners division, there is now a button to go to the Bladeburner content - in the 'City' page -* You now start with $250m in BitNode-8 (increased from $100m) -* Bug Fix: You can now no longer directly edit Hacknet Node values through NetscriptJS (hopefully) -* Bug Fix: Bladeburners is no longer accessible in BN-8 -* Bug Fix: getBitNodeMultipliers() Netscript function now returns a copy rather than the original object - -v0.37.1 - 5/22/2018 -------------------- -* You now earn money from successfully completing Bladeburner contracts. The amount you earn is based - on the difficulty of the contract. -* Completing Field Analysis in Bladeburner now grants 0.1 rank -* The maximum RAM you can get on a purchased server is now 1,048,576 GB (2^20) -* Bug Fix: Fixed Netscript syntax highlighting issues with the new NetscriptJS -* Bug Fix: Netscript Functions now properly incur RAM costs in NetscriptJS -* Bug Fix: deleteServer() now fails if its called on the server you are currently connected to -* Removed in-game Netscript documentation, since it was outdated and difficult to maintain. -* Bug Fix: Updated the gymWorkout() Singularity function with the new exp/cost values for gyms - - -v0.37.0 - 5/20/2018 -------------------- -* NetscriptJS (Netscript 2.0) released (Documentation here: http://bitburner.readthedocs.io/en/latest/netscriptjs.html) -* Running the game with the '?noScripts' query will start the game without loading any of your scripts. This should be used if you accidentally write a script that crashes your game - -v0.36.1 - 5/11/2018 -------------------- -* Bladeburner Changes: - * Bug Fix: You can no longer get Bladeburner faction reputation through Infiltration - * Initial difficulty of Tracking contracts reduced - * Datamancer skill effect increased from 4% per level to 5% - * Slightly decreased the base stamina cost of contracts/operations - * Slightly increased the effects of the Tracer, Digital Observer, Short Circuit, Cloak, and Blade's Intuition skills - * Overclock skill capped at level 95, rather than 99 - * Training gives significantly more exp/s -* Crime, Infiltration, and Hacking are now slightly more profitable in BN-6 -* Gyms are now more expensive, but give slightly more exp -* Added getScriptName() and getHacknetMultipliers() Netscript functions (added by Github user hydroflame) -* getScriptRam() Netscript function now has default value for the second argument, which is hostname/ip (implemented by Github user hydroflame) -* There is now a soft-cap on stock price, which means it's no longer possible for the price of a stock to reach insanely-high values -* The ctrl+b hotkey in the text editor should now also be triggered by command+b on OSX (I don't have OSX so I can't confirm if this works) -* Many servers now have additional RAM -* Added an option to disable hotkeys/keyboard shortcuts -* Refactored 'Active Scripts' UI page to optimize its performance -* Added a new .fconf Terminal setting: ENABLE_TIMESTAMP -* 'Netscript Execution Time', which can be found in the Options, now has a minimum value of 15ms rather than 25ms -* Bug Fix: Fixed a typo in the Fulcrum Technologies company name (Technolgies -> Technologies) -* Bug Fix: hacknetnodes keyword should no longer incur RAM cost if its in a comment -* Bug Fix: disableLog() now works for the commitCrime() Netscript function (fixed by Github user hydroflame) - -v0.36.0 - 5/2/2018 ------------------- -* Added BN-6: Bladeburners -* Rebalanced many combat Augmentations so that they are slightly less powerful -* Bug Fix: When faction invites are suppressed, an invitation will no longer load the Faction page - - -v0.35.2 - 3/26/2018 -------------------- -* Corporation Changes: - * Fixed an issue with Warehouse upgrade cost. Should now be significantly cheaper than before. - * Scientific Research now has a slightly more significant effect on Product quality - * The Energy and Water Utilities industries are now slightly more profitable - * The Robotics and Computer Hardware industries are now less profitable - * The Software industry is slightly less profitable - * When selling Materials and Products, the 'PROD' qualifier can now be used to set dynamic sell amounts based on your production - * Exporting MAX should now work properly - * You can no longer export past storage limits - * Scientific Research production reduced - * Effects of AdVert. Inc upgrade were reduced, but the effect that popularity and awareness have on sales was increased to compensate (popularity/awareness numbers were getting too big with Advert. Inc) - * Bug Fix: Products from Computer Hardware division should now properly have ratings -* Improved Augmentation UI/UX. Now contains collapsible headers and sort buttons -* Improved Faction Augmentations display UI/UX. Now contains sort buttons. There is also an option to disable confirmation when purchasing Augmentations - -v0.35.1 - 3/12/2018 -------------------- -* You can now easily download all of your scripts/text files as zip folders. Use the 'help download' Terminal command for details -* Scripts are now downloaded with the .script.js extension at the end of their filename -* Corporation Management Changes: - * Implemented Smart Supply unlock - * Changed the way a division's Production Multiplier is calculated. It is now the sum of the individual Production Multiplier for every city. Therefore, it is now beneficial to open offices in different cities - * Several small UI/UX improvements - * Numerous balance changes. The significant ones are listed below. - * Product descriptions will now display their estimated market price - * The sale price of Products can no longer be marked up as high as before - * Scientific Research now affects the rating of Products - * In general, the maximum amount of product you are able to sell is reduced - * Sale bonus from advertising (popularity/awareness) now has diminishing returns rather than scaling linearly -* Experience gained during Infiltration now scales linearly based on the clearance level you reach. Compared to before, the experience gained will be much less at lower clearance levels, but much more at higher clearance levels -* The editor can now be used to edit both scripts and text files -* New Terminal config file that can be edited using the command 'nano .fconf'. Right now there is only one option, but there will be more in the future. -* You can now enable Bash-style Terminal hotkeys using the .fconf file referenced above -* Bug Fix: Fixed an issue with the UI elements of Gang Management persisting across different instances of BitNode-2 - -v0.35.0 - 3/3/2018 ------------------- -* Minor rebalancing of BitNodes due to the fact that Corporations provide a (relatively) new method of progressing -* Corporation Management Changes: - * Once your Corporation gets big/powerful enough, you can now bribe Factions for reputation using company funds an/or stock shares - * You can now only create one Division for every Industry type - * Added several new UI/UX elements - * Wilson Analytics multiplier was significantly reduced to 1% per level (additive). - * Reduced the effect of Advert Inc upgrade. Advert Inc. upgrade price increases faster - * Materials can now be marked up at higher prices -* Added Javascript's built-in Number object to Netscript -* Added getCharacterInformation(), getCompanyFavor(), and getFactionFavor() Netscript Singularity functions -* Rebalanced Singularity Function RAM Costs. They now cost x8 as much when outside of BN-4 (rather than x10). Also, many of the functions now use significantly less RAM -* Refactored Netscript Ports. You can now get a handle for a Netscript port using the getPortHandle() Netscript function. This allows you to access a port's underlying queue (which is just an array) and also makes several new functions available such as tryWrite(), full(), and empty(). -* Number of Netscript Ports increased from 10 to 20 -* Netscript assignments should now return proper values. i.e. i = 5 should return 5. -* Added throw statements to Netscript. It's not super useful since 'catch' isn't implemented, but it can be used to generate custom runtime error messages. -* Added import declaration to Netscript. With this, you are able to import functions (and only functions) from other files. Using export declarations is not necessary -* Most Netscript Runtime errors (the ones that cause your script to crash) should now include the line number where the error occured -* When working for a company, your current company reputation is now displayed -* Whenever you get a Faction Invite it will be immediately appended to your 'invited factions' list. Therefore the checkFactionInvitations() Singularity Function should now be properly useable since you no longer need to decline a Faction Invitation before it shows up in the result. -* Bug Fix: When purchasing servers, whitespace should now automatically be removed from the hostname -* Bug Fix: Can no longer have whitespace in the filename of text files created using write() -* Bug Fix: In Netscript, you can no longer assign a Hacknet Node handle (hacknetnodes[i]) to another value -* Bug Fix: If you are in the Factions tab when you accept an invitation from a Faction, the page will now properly 'refresh' -* Bug Fix: Scripts that run recursive functions should now be killed properly - - -v0.34.5 - 2/24/2018 -------------------- -* Corporation Management Changes: - * Market Research unlocks are now cheaper - * New 'VeChain' upgrade: displays useful statistics about Corporation - * Corporation cycles are processed 25% faster - * Corporation valuation was lowered by ~10% (this affects stock price and investments) - * Rebalanced the effects of advertising. Should now be more effective for every Industry - * Fixed several bugs/exploits involving selling and buying back stock shares - * You will now receive a Corporation Handbook (.lit file) when starting out BitNode-3. It contains a brief guide to help you get started. This same handbook can be viewed from the Corporation management screen - * Slightly decreased the amount by which a Product's sell price can be marked up - * Employees can now be assigned to a 'Training' task, during which they will slowly increase several of their stats -* Hopefully fixed an exploit with Array.forEach(). If there are any issues with using forEach, let me know -* Arguments passed into a script are now passed by value. This means modifying the 'args' array in a script should no longer cause issues -* Scripts executed programatically (via run(), exec(), etc.) will now fail if null/undefined is passed in as an argument -* Added peek() Netscript function -* killall() Netscript function now returns true if any scripts were killed, and false otherwise. -* hack() Netscript function now returns the amount of money gained for successful hacks, and 0 for failed hacks -* scp Terminal command and Netscript function now work for txt files -* Changes courtesy of Wraithan: - * Text files are now displayed using 'pre' rather than 'p' elements when using the 'cat' Terminal command. This means tabs are retained and lines don't automatically wrap - * ls() Netscript function now returns text files as well -* Removed round() Netscript function, since you can just use Math.round() instead -* Added disableLog() and enableLog() Netscript functions -* Removed the 'log' argument from sleep(), since you can now use the new disableLog function -* 'Netscript Documentation' button on script editor now points to new readthedocs documentation rather than wiki -* When working for a faction, your current faction reputation is now displayed -* Bug Fix: Hacking Missions should no longer break when dragging an existing connection to another Node -* Bug Fix: Fixed RAM usage of getNextHacknetNodeCost() (is not 1.5GB instead of 4GB) - - -v0.34.4 - 2/14/2018 -------------------- -* Added several new features to Gang UI to make it easier to manage your Gang. -* Changed the Gang Member upgrade mechanic. Now, rather than only being able to have one weapon/armor/vehicle/etc., you can purchase all the upgrades for each Gang member and their multipliers will stack. To balance this out, the effects (AKA multipliers) of each Gang member upgrade were reduced. -* Added a new script editor option: Max Error Count. This affects how many approximate lines the script editor will process (JSHint) for common errors. Increasing this option can affect negatively affect performance -* Game theme colors (set using 'theme' Terminal command) are now saved when re-opening the game -* 'download' Terminal command now works on scripts -* Added stopAction() Singularity function and the spawn() Netscript function -* The 'Purchase Augmentations' UI screen will now tell you if you need a certain prerequisite for Augmentations. -* Augmentations with prerequisites can now be purchased as long as their prerequisites are puchased (before, you had to actually install the prerequisites before being able to purchase) - -v0.34.3 - 1/31/2018 -------------------- -* Minor balance changes to Corporations: - * Upgrades are generally cheaper and/or have more powerful effects. - * You will receive more funding while your are a private company. - * Product demand decreases at a slower rate. - * Production multiplier for Industries (receives for owning real estate/hardware/robots/etc.) is slightly higher -* Accessing the hacknetnodes array in Netscript now costs 4.0GB of RAM (only counts against RAM usage once) -* Bug Fix: Corporation oustanding shares should now be numeric rather than a string -* Bug Fix: Corporation production now properly calculated for industries that dont produce materials. -* Bug Fix: Gangs should now properly reset when switching BitNodes -* Bug Fix: Corporation UI should now properly reset when you go public - -v0.34.2 - 1/27/2018 -------------------- -* Corporation Management Changes: - * Added advertising mechanics - * Added Industry-specific purchases - * Re-designed employee management UI - * Rebalancing: Made many upgrades/purchases cheaper. Receive more money from investors in early stage. Company valuation is higher after going public - * Multiple bug fixes -* Added rm() Netscript function -* Updated the way script RAM usage is calculated. Now, a function only increases RAM usage the first time it is called. i.e. even if you call hack() multiple times in a script, it only counts against RAM usage once. The same change applies for while/for loops and if conditionals. -* The RAM cost of the following were increased: - * If statements: increased by 0.05GB - * run() and exec(): increased by 0.2GB - * scp(): increased by 0.1GB - * purchaseServer(): increased by 0.25GB -* Note: You may need to re-save all of your scripts in order to re-calculate their RAM usages. Otherwise, it should automatically be re-calculated when you reset/prestige -* The cost to upgrade your home computer's RAM has been increased (both the base cost and the exponential upgrade multiplier) -* The cost of purchasing a server was increased by 10% (it is now $55k per RAM) -* Bug fix: (Hopefully) removed an exploit where you could avoid RAM usage for Netscript function calls by assigning functions to a variable (foo = hack(); foo('helios');) -* Bug fix: (Hopefully) removed an exploit where you could run arbitrary Javascript code using the constructor() method -* Thanks to Github user mateon1 and Reddit users havoc_mayhem and spaceglace for notifying me of the above exploits -* The fileExists() Netscript function now works on text files (.txt). Thanks to Github user devoidfury for this - - -v0.34.1 - 1/19/2018 -------------------- -* Updates to Corporation Management: - * Added a number of upgrades to various aspects of your Corporation - * Rebalanced the properties of Materials and the formula for determining the valuation of the Corporation - * Fixed a number of bugs -* 'Stats' page now shows information about current BitNode -* You should now be able to create Corporations in other BitNodes if you have Source-File 3 -* Added a new create-able program called b1t_flum3.exe. This program can be used to reset and switch BitNodes -* Added an option to adjust autosave interval -* Line feeds, newlines, and tabs will now work with the tprint() Netscript function -* Bug fix: 'check' Terminal command was broken -* Bug fix: 'theme' Terminal command was broken when manually specifying hex codes -* Bug fix: Incorrect promotion requirement for 'Business'-type jobs -* Bug fix: Settings input bars were incorrectly formatted when loading game - - -v0.34.0 - 12/6/2017 -------------------- -* Added clear() and exit() Netscript functions -* When starting out or prestiging, you will now receive a 'Hacking Starter Guide'. It provides tips/pointers for new players -* Doubled the amount of RAM on low-level servers (up to required hacking level 150) -* Slightly increased experience gain from Infiltration -* buyStock(), sellStock(), shortStock(), and sellShort() Netscript function now return the stock price at which the transaction occurred, rather than a boolean. If the function fails for some reason, 0 will be returned. -* Hacking Mission Changes: - * You can now select multiple Nodes of the same type by double clicking. This allows you to set the action of all of selected nodes at once (e.g. set all Transfer Nodes to Fortify). Creating connections does not work with this multi-select functionality yet - * Shield and Firewall Nodes can now fortify - * The effects of Fortifying are now ~5% lower - * Conquering a Spam Node now increases your time limit by 25 seconds instead of 15 - * Damage dealt by Attacking was slightly reduced - * The effect of Scanning was slightly reduced - * Enemy CPU Core Nodes start with slightly more attack. Misc Nodes start with slightly less defense -* Corporation Management changes: - * Added several upgrades that unlock new features - * Implemented Exporting mechanic - * Fixed many bugs - -v0.33.0 - 12/1/2017 -------------------- -* Added BitNode-3: Corporatocracy. In this BitNode you can start and manage your own corporation. This feature is incomplete. Much more will be added to it in the near future -* Minor bug fixes - -v0.32.1 - 11/2/2017 -------------------- -* Updated Netscript's 'interpreter/engine' to use the Bluebird promise library instead of native promises. It should now be faster and more memory-efficient. If this has broken any Netscript features please report it through Github or the subreddit (reddit.com/r/bitburner) -* Rebalanced stock market (adjusted parameters such as the volatility/trends/starting price of certain stocks) -* Added prompt() Netscript function -* Added 'Buy Max' and 'Sell All' functions to Stock Market UI -* Added 'Portfolio' Mode to Stock Market UI so you can only view stocks you have a position/order in -* Added a button to kill a script from its log display box - - -v0.32.0 - 10/25/2017 --------------------- -* Added BitNode-8: Ghost of Wall Street -* Re-designed Stock Market UI -* Minor bug fixes - -v0.31.0 - 10/15/2017 --------------------- -* Game now saves to IndexedDb (if your browser supports it). This means you should no longer have trouble saving the game when your save file gets too big (from running too many scripts). The game will still be saved to localStorage as well -* New file type: text files (.txt). You can read or write to text files using the read()/write() Netscript commands. You can view text files in Terminal using 'cat'. Eventually I will make it so you can edit them in the editor but that's not available yet. You can also download files to your real computer using the 'download' Terminal command -* Added a new Crime: Bond Forgery. This crime takes 5 minutes to attempt and gives $4,500,000 if successful. It is meant for mid game. -* Added commitCrime(), getCrimeChance(), isBusy(), and getStats() Singularity Functions. -* Removed getIntelligence() Netscript function -* Added sprintf and vsprintf to Netscript. See [https://github.com/alexei/sprintf.js this Github page for details] -* Increased the amount of money gained from Infiltration by 20%, and the amount of faction reputation by 12% -* Rebalanced BitNode-2 so that Crime and Infiltration are more profitable but hacking is less profitable. Infiltration also gives more faction rep -* Rebalanced BitNode-4 so that hacking is slightly less profitable -* Rebalanced BitNode-5 so that Infiltration is more profitable and gives more faction rep -* Rebalanced BitNode-11 so that Crime and Infiltration are more profitable. Infiltration also gives more faction rep. -* Fixed an annoying issue in Hacking Missions where sometimes you would click a Node but it wouldnt actually get selected -* Made the Hacking Mission gameplay a bit slower by lowering the effect of Scan and reducing Attack damage -* Slightly increased the base reputation gain rate for factions when doing Field Work and Security Work - -v0.30.0 - 10/9/2017 -------------------- -* Added getAugmentations() and getAugmentationsFromFaction() Netscript Singularity Functions -* Increased the rate of Intelligence exp gain -* Added a new upgrade for home computers: CPU Cores. Each CPU core on the home computer grants an additional starting Core Node in Hacking Missions. I may add in other benefits later. Like RAM upgrades, upgrading the CPU Core on your home computer persists until you enter a new BitNode. -* Added lscpu Terminal command to check number of CPU Cores -* Changed the effect of Source-File 11 and made BitNode-11 a little bit harder -* Fixed a bug with Netscript functions (the ones you create yourself) -* Hacking Missions officially released (they give reputation now). Notable changes in the last few updates: - * Misc Nodes slowly gain hp/defense over time - * Conquering a Misc Node will increase the defense of all remaining Misc Nodes that are not being targeted by a certain percentage - * Reputation reward for winning a Mission is now affected by faction favor and Player's faction rep multiplier - * Whenever a Node is conquered, its stats are reduced - -v0.29.3 - 10/3/2017 -------------------- -* Fixed bug for killing scripts and showing error messages when there are errors in a player-defined function -* Added function name autocompletion in Script Editor. Press Ctrl+space on a prefix to show autocompletion options. -* Minor rebalancing and bug fixes for Infiltration and Hacking Missions - -v0.29.2 - 10/1/2017 -------------------- -* installAugmentations() Singularity Function now takes a callback script as an argument. This is a script that gets ran automatically after Augmentations are installed. The script is run with no arguments and only a single thread, and must be found on your home computer. -* Added the ability to create your own functions in Netscript. See [[Netscript Functions|this link]] for details -* Added :q, :x, and :wq Vim Ex Commands when using the Vim script editor keybindings. :w, :x, and :wq will all save the script and return to Terminal. :q will quit (return to Terminal) WITHOUT saving. If anyone thinks theres an issue with this please let me know, I don't use Vim -* Added a new Augmentation: ADR-V2 Pheromone Gene -* In Hacking Missions, enemy nodes will now automatically target Nodes and perform actions. -* Re-balanced Hacking Missions through minor tweaking of many numbers -* The faction reputation reward for Hacking Missions was slightly increased - -v0.29.1 - 9/27/2017 -------------------- -* New gameplay feature that is currently in BETA: Hacking Missions. Hacking Missions is an active gameplay mechanic (its a minigame) that is meant to be used to earn faction reputation. However, since this is currently in beta, hacking missions will NOT grant reputation for the time being, since the feature likely has many bugs, balance problems, and other issues. If you have any feedback regarding the new feature, feel free to let me know -* CHANGED THE RETURN VALUE OF getScriptIncome() WHEN RAN WITH NO ARGUMENTS. It will now return an array of two values rather than a single value. This may break your scripts, so make sure to update them! -* Added continue statement for for/while loops -* Added getServerMinSecurityLevel(), getPurchasedServers(), and getTimeSinceLastAug() Netscript functions -* Netscript scp() function can now take an array as the first argument, and will try to copy every file specified in the array (it will just call scp() normally for every element in the array). If an array is passed in, then the scp() function returns true if at least one element from the array is successfully copied -* Added Javascript's Date module to Netscript. Since 'new' is not supported in Netscript yet, only the Date module's static methods will work (now(), UTC(), parse(), etc.). -* Failing a crime now gives half the experience it did before -* The forced repeated 'Find The-Cave' message after installing The Red Pill Augmentation now only happens if you've never destroyed a BitNode before, and will only popup every 15 minutes. If you have already destroyed a BitNode, the message will not pop up if you have messages suppressed (if you don't have messages suppressed it WILL still repeatedly popup) -* fileExists() function now works on literature files - -v0.29.0 - 9/19/2017 -------------------- -* Added BitNode-5: Artificial Intelligence -* Added getIp(), getIntelligence(), getHackingMultipliers(), and getBitNodeMultipliers() Netscript functions (requires Source-File 5) -* Updated scan() Netscript function so that you can choose to have it print IPs rather than hostnames -* Refactored scp() Netscript function so that it takes an optional 'source server' argument -* For Infiltration, decreased the percentage by which the security level increases by about 10% for every location -* Using :w in the script editor's Vim keybinding mode should now save and quit to Terminal -* Some minor optimizations that should reduce the size of the save file -* scan-analyze Terminal command will no longer show your purchased servers, unless you pass a '-a' flag into the command -* After installing the Red Pill augmentation from Daedalus, the message telling you to find 'The-Cave' will now repeatedly pop up regardless of whether or not you have messages suppressed -* Various bugfixes - -v0.28.6 - 9/15/2017 -------------------- -* Time required to create programs now scales better with hacking level, and should generally be much faster -* Added serverExists(hostname/ip) and getScriptExpGain(scriptname, ip, args...) Netscript functions -* Short circuiting && and || logical operators should now work -* Assigning to multidimensional arrays should now work -* Scripts will no longer wait for hack/grow/weaken functions to finish if they are killed. They will die immediately -* The script loop that checks whether any scripts need to be started/stopped now runs every 6 seconds rather than 10 (resulting in less delays when stopping/starting scripts) -* Fixed several bugs/exploits -* Added some description for BitNode-5 (not implemented yet, should be soon though) - -v0.28.5 - 9/13/2017 -------------------- -* The fl1ght.exe program that is received from jump3r is now sent very early on in the game, rather than at hacking level 1000 -* Hostname is now displayed in Terminal -* Syntax highlighting now works for all Netscript functions -* Export should now work on Edge/IE - -v0.28.4 - 9/11/2017 -------------------- -* Added getScriptIncome() Netscript function -* Added Javascript's math module to Netscript. See [https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math this link for details] -* Added several member variables for the Hacknet Node API that allow you to access info about their income -* All valid Netscript functions are now syntax highlighted as keywords in the editor. This means they will a different color than invalid netscript functions. The color will depend on your theme. Note that right now, this only applies for normal Netscript functions, not functions in the TIX API, Hacknet Node API, or Singularity Functions. -* Comments and operators no longer count towards RAM usage in scripts. -* Variety of bug fixes and updates to informational text in the game - -v0.28.3 - 9/7/2017 ------------------- -* Added ls() Netscript function -* Increased company wages by about ~10% across the board -* The scp() Netsction function and Terminal command now works for .lit files -* Increased the amount of RAM on many lower level servers (up to level 200 hacking level required). - -v0.28.2 - 9/4/2017 ------------------- -* Added several configuration options for script editor (key bindings, themes, etc.) -* Certain menu options will now be hidden until their relevant gameplay is unlocked. This includes the Factions, Augmentations, Create Program, Travel, and Job tabs. This will only affect newer players. -* Most unrecognize or un-implemented syntax errors in Netscript will now include the line number in the error message - -v0.28.1 - 9/1/2017 ------------------- -* The script editor now uses the open-source Ace editor, which provides a much better experience when coding! -* Added tprint() Netscript function - -v0.28.0 - 8/30/2017 -------------------- -* Added BitNode-4: The Singularity -* Added BitNode-11: The Big Crash -* Migrated the codebase to use webpack (doesn't affect any in game content, except maybe some slight performance improvements and there may be bugs that result from dependency errors - -v0.27.3 - 8/19/2017 -------------------- -* You can now purchase upgrades for Gang Members (BitNode 2 only) -* Decreased Gang respect gains and slightly increased wanted gains (BitNode 2 only) -* Other gangs will increase in power faster (BitNode 2 only) -* Added getHackTime(), getGrowTime(), and getWeakenTime() Netscript functions - -v0.27.2 - 8/18/2017 -------------------- -* Added getServerGrowth() Netscript function -* Added getNextHacknetNodeCost() Netscript function -* Added new 'literature' files (.lit extension) that are used to build lore for the game. These .lit files can be found in certain servers throughout the game. They can be viewed with the 'cat' Terminal command and copied over to other servers using the 'scp' command. These .lit files won't be found until you reset by installing Augmentations -* Fixed some bugs with Gang Territory(BitNode 2 only) - -v0.27.1 - 8/15/2017 -------------------- -* Changed the way Gang power was calculated to make it scale better late game (BitNode 2 only) -* Lowered the respect gain rate in Gangs (Bitnode 2 only) -* Added '| grep pattern' option for ls Terminal command. This allows you to only list files that contain a certain pattern -* Added break statement in Netscript -* Display for some numerical values is now done in shorthand (e.g 1.000m instead of 1,000,000) - -v0.27.0 - 8/13/2017 -------------------- -* Added secondary 'prestige' system - featuring Source Files and BitNodes -* MILD SPOILERS HERE: Installing 'The Red Pill' Augmentation from Daedalus will unlock a special server called w0r1d_d43m0n. Finding and manually hacking this server through Terminal will destroy the Player's current BitNode, and allow the player to enter a new one. When destroying a BitNode, the player loses everything except the scripts on his/her home computer. The player will then gain a powerful second-tier persistent upgrade called a Source File. The player can then enter a new BitNode to start the game over. Each BitNode has different characteristics, and many will have new content/mechanics as well. Right now there are only 2 BitNodes. Each BitNode grants its own unique Source File. Restarting and destroying a BitNode you already have a Source File for will upgrade your Source File up to a maximum level of 3. - -* Reputation gain with factions and companies is no longer a linear conversion, but an exponential one. It will be much easier to gain faction favor at first, but much harder later on. -* Significantly increased Infiltration exp gains -* Fixed a bug with company job requirement tooltips -* Added scriptRunning(), scriptKill(), and getScriptRam() Netscript functions. See documentation for details -* Fixed a bug with deleteServer() Netscript function - -v0.26.4 - 8/1/2017 ------------------- -* All of the 'low-level servers' in early game that have a required hacking level now have 8GB of RAM instead of 4GB -* Increased the amount of experience given at university -* Slightly increased the production of Hacknet Nodes and made them cheaper to upgrade -* Infiltration now gives slightly more EXP and faction reputation -* Added two new crimes. These crimes are viable to attempt early on in the game and are relatively passive (each take 60+ seconds to complete) -* Crimes give more exp and more money -* Max money available on a server decreased from 50x the server's starting money to 25x -* Significantly increased wages for all jobs - -v0.26.3 -------- -* Added support for large numbers using Decimal.js. Right now it only applies for the player's money -* Purchasing servers with the Netscript function purchaseServer() is no longer 2x as expensive as doing manually it now costs the same -* Early game servers have more starting money - -v0.26.2 -------- -* Major rebalancing and randomization of the amount of money that servers start with -* Significantly lowered hacking exp gain from hacking servers. The exp gain for higher-level servers was lowered more than that of low level servers. (~16% for lower level servers, up to ~25% for higher-level servers) -* Added deleteServer() Netscript function -* You can now purchase a maximum of 25 servers each run (Deleting a server will allow you to purchase a new one) -* Added autocompletion for './' Terminal command -* Darkweb prices now displayed properly using toLocaleString() -* Added NOT operator (!) and negation operator(-) in Netscript, so negative numbers should be functional now -* Rejected faction invitations will now show up as 'Outstanding Faction Invites' in the Factions page. These can be accepted at any point in the future -* Added a few more configurable game settings for suppressing messages and faction invitations -* Added tooltips for company job requirements - -v0.26.1 -------- -* Added autocompletion for aliases -* Added getServerRam() Netscript function() -* Added getLevelUpgradeCost(n), getRamUpgradeCost(), getCoreUpgradeCost() functions for Netscript Hacknet Node API -* Added some configurable settings (See Game Options menu) - - -v0.26.0 -------- -* Game now has a real ending, although it's not very interesting/satisfying right now. It sets up the framework for the secondary prestige system in the future -* Forgot to mention that since last update, comments now work in Netscript. Use // for single line comments or /* and */ for multiline comments just like in Javascript -* Added ports to Netscript. These ports are essentially serialized queues. You can use the write() Netscript function to write a value to a queue, and then you can use the read() Netscript function to read the value from the queue. Once you read a value from the queue it will be removed. There are only 10 queues (1-10), and each has a maximum capacity of 50 entries. If you try to write to a queue that is full, the the first value is removed. See wiki/Netscript documentation for more details -* You can now use the 'help' Terminal command for specific commands -* You can now use './' to run a script/program (./NUKE.exe). However, tab completion currently doesn't work for it (I'm working on it) -* Decreased the base growth rate of servers by ~25% -* Both the effect of weaken() and its time to execute were halved. In other words, calling weaken() on a server only lowers its security by 0.05 (was 0.1 before) but the time to execute the function is half of what it was before. Therefore, the effective rate of weaken() should be about the same -* Increased all Infiltration rewards by ~10%, and increased infiltration rep gains by an additional 20% (~32% total for rep gains) -* The rate at which the security level of a facility increases during Infiltration was decreased significantly (~33%) -* Getting treated at the Hospital is now 33% more expensive -* Slightly increased the amount of time it takes to hack a server -* Slightly decreased the amount of money gained when hacking a server (~6%) -* Slightly decreased the base cost for RAM on home computer, but increased the cost multiplier. This means that upgrading RAM on the home computer should be slightly cheaper at the start, but slightly more expensive later on -* Increased the required hacking level for many late game servers -* The sleep() Netscript function now takes an optional 'log' argument that specifies whether or not the 'Sleeping for N milliseconds' will be logged for the script -* Added clearLog() Netscript function -* Deleted a few stocks. Didn't see a reason for having so many, and it just affects performance. Won't take effect until you reset by installing Augmentations -* There was a typo with Zeus Medical's server hostname. It is now 'zeus-med' rather than 'zeud-med' -* Added keyboard shortcuts to quickly navigate between different menus. See wiki link (http://bitburner.wikia.com/wiki/Shortcuts) -* Changed the Navigation Menu UI - -v0.25.0 -------- -* Refactored Netscript to use the open-source Acorns Parser. This re-implementation was done by [https://github.com/MrNuggelz Github user MrNuggelz]. This has resulted in several changes in the Netscript language. Some scripts might break because of these changes. Changes listed below:  -* Arrays are now fully functional Javascript arrays. You no longer need to use the 'Array' keyword to declare them.  -* The length(), clear/clear(), insert(), and remove() functions no longer work for arrays.  -* All Javascript array methods are available (splice(), push(), pop(), join(), shift(), indexOf(), etc. See documentation) -* Variables assigned to arrays are now passed by value rather than reference - -* Incrementing/Decrementing are now available (i++, ++i) - -* You no longer need semicolons at the end of block statements - -* Elif is no longer valid. Use 'else if' instead - -* Netscript's Hacknet Node API functions no longer log anything -* Stock prices now update every ~6 seconds when the game is active (was 10 seconds before) -* Added a new mechanic that affects how stock prices change -* Script editor now has dynamic indicators for RAM Usage and Line number -* Augmentation Rebalancing - Many late game augmentations are now slightly more expensive. Several early game augmentations had their effects slightly decreased -* Increased the amount of rewards (both money and rep) you get from infiltration -* Purchasing servers is now slightly more expensive -* Calling the Netscript function getServerMoneyAvailable('home') now return's the player's money -* Added round(n) Netscript function - Rounds a number -* Added purchaseServer(hostname, ram) Netscript function -* Added the TIX API. This must be purchased in the WSE. It persists through resets. Access to the TIX API allows you to write scripts that perform automated algorithmic trading. See Netscript documentation -* Minor rebalancing in a lot of different areas -* Changed the format of IP Addresses so that they are smaller (will consist mostly of single digit numbers now). This will reduce the size of the game's save file. - -v0.24.1 -------- -* Adjusted cost of upgrading home computer RAM. Should be a little cheaper for the first few upgrades (up to ~64GB), and then will start being more expensive than before. High RAM upgrades should now be significantly more expensive than before. -* Slightly lowered the starting money available on most mid-game and end-game servers (servers with required hacking level greater than 200) by about 10-15% -* Rebalanced company/company position reputation gains and requirements -* Studying at a university now gives slightly more EXP and early jobs give slightly less EXP -* Studying at a university is now considerably more expensive -* Rebalanced stock market -* Significantly increased cost multiplier for purchasing additional Hacknet Nodes -* The rate at which facility security level increases during infiltration for each clearance level was lowered slightly for all companies -* Updated Faction descriptions -* Changed the way alias works. Normal aliases now only work at the start of a Terminal command (they will only replace the first word in the Terminal command). You can also create global aliases that work on any part of the command, like before. Declare global aliases by entering the optional -g flag: alias -g name="value" - [https://github.com/MrNuggelz Courtesy of Github user MrNuggelz] -* 'top' Terminal command implemented courtesy of [https://github.com/LTCNugget Github user LTCNugget]. Currently, the formatting gets screwed up if your script names are really long. - -v0.24.0 -------- -* Players now have HP, which is displayed in the top right. To regain HP, visit the hospital. Currently the only way to lose HP is through infiltration -* Infiltration - Attempt to infiltrate a company and steal their classified secrets. See 'Companies' documentation for more details -* Stock Market - Added the World Stock Exchange (WSE), a brokerage that lets you buy/sell stocks. To begin trading you must first purchase an account. A WSE account will persist even after resetting by installing Augmentations. How the stock market works should hopefully be self explanatory. There is no documentation about it currently, I will add some later. NOTE: Stock prices only change when the game is open. The Stock Market is reset when installing Augmentations, which means you will lose all your stocks -* Decreased money gained from hacking by ~12% -* Increased reputation required for all Augmentations by ~40% -* Cost increase when purchasing multiple augmentations increased from 75% to 90% -* Added basic variable runtime to Netscript operations. Basic commands run in 100ms. Any function incurs another 100ms in runtime (200ms total). Any function that starts with getServer incurs another 100ms runtime (300ms total). exec() and scp() require 400ms total.  -* Slightly reduced the amount of experience gained from hacking - -v0.23.1 -------- -* scan() Netscript function now takes a single argument representing the server from which to scan.  - -v0.23.0 -------- -* You can now purchase multiple Augmentations in a run. When you purchase an Augmentation you will lose money equal to the price and then the cost of purchasing another Augmentation during this run will be increased by 75%. You do not gain the benefits of your purchased Augmentations until you install them. This installation can be done through the 'Augmentation' tab. When you install your Augmentations, your game will reset like before.  -* Reputation needed to gain a favor from faction decreased from 7500 to 6500 -* Reputation needed to gain a favor from company increased from 5000 to 6000 -* Reputation cost of all Augmentations increased by 16% -* Higher positions at companies now grant slightly more reputation for working -* Added getServerMaxMoney() Netscript function -* Added scan() Netscript function -* Added getServerNumPortsRequired() Netscript function -* There is now no additional RAM cost incurred when multithreading a script - -v0.22.1 -------- -* You no longer lose progress on creating programs when cancelling your work. Your progress will be saved and you will pick up where you left off when you start working on it again -* Added two new programs: AutoLink.exe and ServerProfiler.exe -* Fixed bug with Faction Field work reputation gain - -v0.22.0 - Major rebalancing, optimization, and favor system ------------------------------------------------------------ -* Significantly nerfed most augmentations -* Almost every server with a required hacking level of 200 or more now has slightly randomized server parameters. This means that after every Augmentation purchase, the required hacking level, base security level, and growth factor of these servers will all be slightly different -* The hacking speed multiplier now increases rather than decreases. The hacking time is now divided by your hacking speed multiplier rather than multiplied. In other words, a higher hacking speed multiplier is better -* Servers now have a minimum server security, which is approximately one third of their starting ('base') server security -* If you do not steal any money from a server, then you gain hacking experience equal to the amount you would have gained had you failed the hack -* The effects of grow() were increased by 50% -* grow() and weaken() now give hacking experience based on the server's base security level, rather than a flat exp amount -* Slightly reduced amount of exp gained from hack(), weaken(), and grow() -* Rebalanced formulas that determine crime success -* Reduced RAM cost for multithreading a script. The RAM multiplier for each thread was reduced from 1.02 to 1.005 -* Optimized Script objects so they take less space in the save file -* Added getServerBaseSecurityLevel() Netscript function -* New favor system for companies and factions. Earning reputation at a company/faction will give you favor for that entity when you reset after installing an Augmentation. This favor persists through the rest of the game. The more favor you have, the faster you will earn reputation with that faction/company -* You can no longer donate to a faction for reputation until you have 150 favor with that faction -* Added unalias Terminal command -* Changed requirements for endgame Factions - -v0.21.1 -------- -* IF YOUR GAME BREAKS, DO THE FOLLOWING: Options -> Soft Reset -> Save Game -> Reload Page. Sorry about that!  -* Autocompletion for aliases - courtesy of [https://github.com/LTCNugget Github user LTCNugget] - -v0.21.0 -------- -* Added dynamic arrays. See Netscript documentation -* Added ability to pass arguments into scripts. See documentation -* The implementation/function signature of functions that deal with scripts have changed. Therefore, some old scripts might not work anymore. Some of these functions include run(), exec(), isRunning(), kill(), and some others I may have forgot about. Please check the updated Netscript documentation if you run into issues.-Note that scripts are now uniquely identified by the script name and their arguments. For example, you can run a script using:: - - run foodnstuff.script 1 - -and you can also run the same script with a different argument:: - - run foodnstuff.script 2 - -These will be considered two different scripts. To kill the first script you must run:: - - kill foodnstuff.script 1 - -and to kill the second you must run:: - - kill foodnstuff.script 2 - -Similar concepts apply for Terminal Commands such as tail, and Netscript commands such as run(), exec(), kill(), isRunning(), etc. - -* Added basic theme functionality using the 'theme' Terminal command - All credit goes to /u/0x726564646974 who implemented the awesome feature -* Optimized Script objects, which were causing save errors when the player had too many scripts -* Formula for determining exp gained from hacking was changed -* Fixed bug where you could purchase Darkweb items without TOR router -* Slightly increased cost multiplier for Home Computer RAM -* Fixed bug where you could hack too much money from a server (and bring its money available below zero) -* Changed tail command so that it brings up a display box with dynamic log contents. To get old functionality where the logs are printed to the Terminal, use the new 'check' command -* As a result of the change above, you can no longer call tail/check on scripts that are not running -* Added autocompletion for buying Programs in Darkweb - -v0.20.2 -------- -* Fixed several small bugs -* Added basic array functionality to Netscript -* Added ability to run scripts with multiple threads. Running a script with n threads will multiply the effects of all hack(), grow(), and weaken() commands by n. However, running a script with multiple threads has drawbacks in terms of RAM usage. A script's ram usage when it is 'multithreaded' is calculated as: base cost * numThreads * (1.02 ^ numThreads). A script can be run multithreaded using the 'run [script] -t n' Terminal command or by passing in an argument to the run() and exec() Netscript commands. See documentation. -* RAM is slightly (~10%) more expensive (affects purchasing server and upgrading RAM on home computer) -* NeuroFlux Governor augmentation cost multiplier decreased -* Netscript default operation runtime lowered to 200ms (was 500ms previously) - -v0.20.1 -------- -* Fixed bug where sometimes scripts would crash without showing the error -* Added Deepscan programs to Dark Web -* Declining a faction invite will stop you from receiving invitations from that faction for the rest of the run -* (BETA) Added functionality to export/import saves. WARNING This is only lightly tested. You cannot choose where to save your file it just goes to the default save location. Also I have no idea what will happen if you try to import a file that is not a valid save. I will address these in later updates - -v0.20.0 -------- -* Refactored Netscript Interpreter code. Operations in Netscript should now run significantly faster (Every operation such as a variable assignment, a function call, a binary operator, getting a variable's value, etc. used to take up to several seconds, now each one should only take ~500 milliseconds).  -* Percentage money stolen when hacking lowered to compensate for faster script speeds -* Hacking experience granted by grow() halved -* Weaken() is now ~11% faster, but only grants 3 base hacking exp upon completion instead of 5  -* Rebalancing of script RAM costs. Base RAM Cost for a script increased from 1GB to 1.5GB. Loops, hack(), grow() and weaken() all cost slightly less RAM than before  -* Added getServerRequiredHackingLevel(server) Netscript command.  -* Added fileExists(file, [server]) Netscript command, which is used to check if a script/program exists on a specified server -* Added isRunning(script, [server]) Netscript command, which is used to check if a script is running on the specified server -* Added killall Terminal command. Kills all running scripts on the current machine -* Added kill() and killall() Netscript commands. Used to kill scripts on specified machines. See Netscript documentation -* Re-designed 'Active Scripts' tab -* Hacknet Node base production rate lowered from 1.6 to 1.55 ($/second) -* Increased monetary cost of RAM (Upgrading home computer and purchasing servers will now be more expensive) -* NEW GROWTH MECHANICS - The rate of growth on a server now depends on a server's security level. A higher security level will result in lower growth on a server when using the grow() command. Furthermore, calling grow() on a server raises that server's security level by 0.004. For reference, if a server has a security level of 10 it will have approximately the same growth rate as before.  -* Server growth no longer happens naturally -* Servers now have a maximum limit to their money. This limit is 50 times it's starting money -* Hacking now grants 10% less hacking experience -* You can now edit scripts that are running -* Augmentations cost ~11% more money and 25% more faction reputation - -v0.19.7 -------- -* Added changelog to Options menu -* Bug fix with autocompletion (wasn't working properly for capitalized filenames/programs - -v0.19.6 -------- -* Script editor now saves its state even when you change tabs  -* scp() command in Terminal/script will now overwrite files at the destination  -* Terminal commands are no longer case-sensitive (only the commands themselves such as 'run' or 'nano'. Filenames are still case sensitive -* Tab automcompletion will now work on commands - -v0.19.0 -------- -* Hacknet Nodes have slightly higher base production, and slightly increased RAM multiplier. But they are also a bit more expensive at higher levels -* Calling grow() and weaken() in a script will now work offline, at slower rates than while online (The script now keeps track of the rate at which grow() and weaken() are called when the game is open. These calculated rates are used to determine how many times the calls would be made while the game is offline) -* Augmentations now cost 20% more reputation and 50% more money -* Changed the mechanic for getting invited to the hacking factions (CyberSec, NiteSec, The Black Hand, BitRunners) Now when you get to the required level to join these factions you will get a message giving you instructions on what to do in order to get invited. -* Added a bit of backstory/plot into the game. It's not fully fleshed out yet but it will be used in the future -* Made the effects of many Augmentations slightly more powerful -* Slightly increased company job wages across the board (~5-10% for each position) -* Gyms and classes are now significantly more expensive -* Doubled the amount by which a server's security increases when it is hacked. Now, it will increase by 0.002. Calling weaken() on a server will lower the security by 0.1. - -v0.18.0 -------- -* Major rebalancing (sorry didn't record specifics. But in general hacking gives more money and hacknet nodes give less) -* Server growth rate (both natural and manual using grow()) doubled -* Added option to Soft Reset -* Cancelling a full time job early now only results in halved gains for reputation. Exp and money earnings are gained in full -* Added exec() Netscript command, used to run scripts on other servers.  -* NEW HACKING MECHANICS: Whenever a server is hacked, its 'security level' is increased by a very small amount. The security level is denoted by a number between 1-100. A higher security level makes it harder to hack a server and also decreases the amount of money you steal from it. Two Netscript functions, weaken() and getServerSecurityLevel() level, were added. The weaken(server) function lowers a server's security level. See the Netscript documentation for more details -* When donating to factions, the base rate is now $1,000,000 for 1 reputation point. Before, it was $1,000 for 1 reputation point. -* Monetary costs for all Augmentations increased. They are now about ~3.3 - 3.75 times more expensive than before - -v0.17.1 -------- -* Fixed issue with purchasing Augmentations that are 'upgrades' and require previous Augmentations to be installed -* Increased the percentage of money stolen from servers when hacking - -v0.17.0 -------- -* Greatly increased amount of money gained for crimes (by about 400% for most crimes) -* Criminal factions require slightly less negative karma to get invited to -* Increased the percentage of money stolen from servers when hacking -* Increased the starting amount of money available on beginning servers (servers with <50 required hacking)) -* Increased the growth rate of servers (both naturally and manually when using the grow() command in a script) -* Added getHostname() command in Netscript that returns the hostname of the server a script is running on -* jQuery preventDefault() called when pressing ctrl+b in script editor -* The Neuroflux Governor augmentation (the one that can be repeatedly leveled up) now increases ALL multipliers by 1%. To balance it out, it's price multiplier when it levels up was increased -* Hacknet Node base production decreased from $1.75/s to $1.65/s -* Fixed issue with nested for loops in Netscript (stupid Javascript references) -* Added 'scp' command to Terminal and Netscript -* Slightly nerfed Hacknet Node Kernel DNI and Hacknet Node Core DNI Augmentations -* Increased TOR Router cost to $200k - -v0.16.0 -------- -* New Script Editor interface  -* Rebalanced hacknet node - Increased base production but halved the multiplier from additional cores. This should boost its early-game production but nerf its late-game production -* Player now starts with 8GB of RAM on home computer -* 'scan-analyze' terminal command displays RAM on servers -* Slightly buffed the amount of money the player steals when hacking servers (by about ~8%) -* Time to execute grow() now depends on hacking skill and server security, rather than taking a flat 2 minutes. -* Clicking outside of a pop-up dialog box will now close it -* BruteSSH.exe takes 33% less time to create -* 'iron-gym' and 'max-hardware' servers now have 2GB of RAM -* Buffed job salaries across the board -* Updated Tutorial -* Created a Hacknet Node API for Netscript that allows you to access and upgrade your Hacknet Nodes. See the Netscript documentation for more details. WARNING The old upgradeHacknetNode() and getNumHacknetNodes() functions waere removed so any script that has these will no longer work  - -v0.15.0 -------- -* Slightly reduced production multiplier for Hacknet Node RAM -* Faction pages now scroll -* Slightly increased amount of money gained from hacking -* Added 'alias' command -* Added 'scan-analyze' terminal command - used to get basic hacking info about all immediate network connections -* Fixed bugs with upgradeHacknetNode() and purchaseHacknetNode() commands -* Added getNumHacknetNodes() and hasRootAccess(hostname/ip) commands to Netscript -* Increased Cost of university classes/gym -* You can now see what an Augmentation does and its price even while its locked diff --git a/doc/build/html/_sources/index.rst.txt b/doc/build/html/_sources/index.rst.txt deleted file mode 100644 index f71bf236c..000000000 --- a/doc/build/html/_sources/index.rst.txt +++ /dev/null @@ -1,33 +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 cyberpunk-themed `incremental game `_ that is currently in the -early beta stage of development. The game `can be played here `_. - -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: - - Netscript - Terminal - Keyboard Shortcuts - Changelog - - -Indices and tables -================== - -* :ref:`genindex` -* :ref:`modindex` -* :ref:`search` diff --git a/doc/build/html/_sources/netscript.rst.txt b/doc/build/html/_sources/netscript.rst.txt deleted file mode 100644 index 934e7f6c6..000000000 --- a/doc/build/html/_sources/netscript.rst.txt +++ /dev/null @@ -1,28 +0,0 @@ -Netscript Documentation -======================= -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 tiny subset of Javascript. This means that Netscript's -syntax is almost idental to Javascript's, but it does not implement many of the -features that Javascript has. - -If you have any requests or suggestions to improve the Netscript language, feel free -to reach out to the developer! - -.. toctree:: - :maxdepth: 5 - :caption: Sections: - - NetscriptJS (Netscript 2.0) - Data Types and Variables - Operators - Loops and Conditionals - Script Arguments - Basic Functions - Advanced Functions - Hacknet Node API - Trade Information eXchange (TIX) API - Singularity Functions - Bladeburner API - Miscellaneous diff --git a/doc/build/html/_sources/netscriptadvancedfunctions.rst.txt b/doc/build/html/_sources/netscriptadvancedfunctions.rst.txt deleted file mode 100644 index e71ebd2b6..000000000 --- a/doc/build/html/_sources/netscriptadvancedfunctions.rst.txt +++ /dev/null @@ -1,45 +0,0 @@ -Netscript Advanced Functions -============================ - -These Netscript functions become relevant later on in the game. They are put on a separate page because -they contain spoilers for the game. - -getBitNodeMultipliers -^^^^^^^^^^^^^^^^^^^^^ - -.. js:function:: getBitNodeMultipliers() - - Returns an object containing the current BitNode multipliers. This function requires Source-File 5 in order - to run. The multipliers are returned in integer forms (e.g. 1.5 instead of 150%). The multipliers represent - the difference between the current BitNode and the original BitNode (BitNode-1). For example, if the - *CrimeMoney* multiplier has a value of 0.1, then that means that committing crimes in the current BitNode - will only give 10% of the money you would have received in BitNode-1. The object has the following structure, - (subject to change in the future):: - - { - ServerMaxMoney: 1, - ServerStartingMoney: 1, - ServerGrowthRate: 1, - ServerWeakenRate: 1, - ServerStartingSecurity: 1, - ManualHackMoney: 1, - ScriptHackMoney: 1, - CompanyWorkMoney: 1, - CrimeMoney: 1, - HacknetNodeMoney: 1, - CompanyWorkExpGain: 1, - ClassGymExpGain: 1, - FactionWorkExpGain: 1, - HackExpGain: 1, - CrimeExpGain: 1, - FactionWorkRepGain: 1, - FactionPassiveRepGain: 1, - AugmentationRepCost: 1, - AugmentationMoneyCost: 1, - } - - Example:: - - mults = getBitNodeMultipliers(); - print(mults.ServerMaxMoney); - print(mults.HackExpGain); diff --git a/doc/build/html/_sources/netscriptbladeburnerapi.rst.txt b/doc/build/html/_sources/netscriptbladeburnerapi.rst.txt deleted file mode 100644 index 2faf8b12e..000000000 --- a/doc/build/html/_sources/netscriptbladeburnerapi.rst.txt +++ /dev/null @@ -1,460 +0,0 @@ -Netscript Bladeburner API -========================= - -Netscript provides the following API for interacting with the game's Bladeburner mechanic. - -The Bladeburner API is **not** immediately available to the palyer and must be unlocked -later in the game - -**WARNING: This page contains spoilers for the game** - -The Bladeburner API is unlocked in BitNode-7. If you are in BitNode-7, you will -automatically gain access to this API. Otherwise, you must have Source-File 7 in -order to use this API in other BitNodes - -**Bladeburner API functions must be accessed through the bladeburner namespace** - -In Netscript 1.0:: - - bladeburner.getContractNames(); - bladeburner.startAction("general", "Training"); - -In :ref:`netscriptjs`:: - - ns.bladeburner.getContractNames(); - ns.bladeburner.startAction("general", "Training"); - -.. _bladeburner_action_types: - -Bladeburner Action Types ------------------------- - -Several functions in the Bladeburner API require you to specify an action using -its type and name. The following are valid values when specifying the action's type: - -**Contracts** - * contract - * contracts - * contr - -**Operations** - * operation - * operations - * op - * ops - -**Black Ops** - * blackoperation - * black operation - * black operations - * black op - * black ops - * blackop - * blackops - -**General Actions (Training, Field Analysis, Recruitment)** - * general - * general action - * gen - -getContractNames ----------------- - -.. js:function:: getContractNames() - - Returns an array of strings containing the names of all Bladeburner contracts - -getOperationNames ------------------ - -.. js:function:: getOperationNames() - - Returns an array of strings containing the names of all Bladeburner operations - -getBlackOpNames ---------------- - -.. js:function:: getBlackOpNames() - - Returns an array of strings containing the names of all Bladeburner Black Ops - -getGeneralActionNames ---------------------- - -.. js:function:: getGeneralActionNames() - - Returns an array of strings containing the names of all general Bladeburner actions - -getSkillNames -------------- - -.. js:function:: getSkillNames() - - Returns an array of strings containing the names of all Bladeburner skills - -startAction ------------ - -.. js:function:: startAction(type, name) - - :param string type: Type of action. See :ref:`bladeburner_action_types` - :param string name: Name of action. Must be an exact match - - Attempts to start the specified Bladeburner action. Returns true if the action - was started successfully, and false otherwise. - -stopBladeburnerAction ---------------------- - -.. js:function:: stopBladeburnerAction() - - Stops the current Bladeburner action - -getActionTime -------------- - -.. js:function:: getActionTime(type, name) - - :param string type: Type of action. See :ref:`bladeburner_action_types` - :param string name: Name of action. Must be an exact match - - Returns the number of seconds it takes to complete the specified action - -getActionEstimatedSuccessChance -------------------------------- - -.. js:function:: getActionEstimatedSuccessChance(type, name) - - :param string type: Type of action. See :ref:`bladeburner_action_types` - :param string name: Name of action. Must be an exact match - - Returns the estimated success chance for the specified action - -getActionCountRemaining ------------------------ - -.. js:function:: getActionCountRemaining(type, name) - - :param string type: Type of action. See :ref:`bladeburner_action_types` - :param string name: Name of action. Must be an exact match - - Returns the remaining count of the specified action. - - Note that this is meant to be used for Contracts and Operations. - This function will return 'Infinity' for actions such as Training and Field Analysis. - -getRank -------- - -.. js:function:: getRank() - - Returns the player's Bladeburner Rank - -getSkillPoints --------------- - -.. js:function:: getSkillPoints() - - Returns the number of Bladeburner skill points you have - -getSkillLevel -------------- - -.. js:function:: getSkillLevel(skillName="") - - :param string skillName: Optional name of Skill. Empty string by default - - If no argument or an empty string is passed in, this function returns - an object with your level for all Bladeburner Skills (only for skills that - have at least one level). In the object, the name of the Bladeburner Skills - are the keys and your skill levels are the values. For example:: - - { - "Blade's Intuition": 10, - "Cloak": 5, - "Evasive System": 6 - } - - If the name of a skill is passed in as an argument, then this function - returns your level in the specified skill. - - The function returns -1 if an invalid skill name is passed in - -upgradeSkill ------------- - -.. js:function:: upgradeSkill(skillName) - - :param string skillName: Name of Skill to be upgraded. Must be an exact match - - Attempts to upgrade the specified Bladeburner skill. Returns true if the - skill is successfully upgraded, and false otherwise - -getTeamSize ------------ - -.. js:function:: getTeamSize(type, name) - - :param string type: Type of action. See :ref:`bladeburner_action_types` - :param string name: Name of action. Must be an exact match - - Returns the number of Bladeburner team members you have assigned to the - specified action. - - Setting a team is only applicable for Operations and BlackOps. This function - will return 0 for other action types. - -setTeamSize ------------ - -.. js:function:: setTeamSize(type, name, size) - - :param string type: Type of action. See :ref:`bladeburner_action_types` - :param string name: Name of action. Must be an exact match - :param int size: Number of team members to set. Will be converted using Math.round() - - Set the team size for the specified Bladeburner action. - - Returns the team size that was set, or -1 if the function failed. - -getCityEstimatedPopulation --------------------------- - -.. js:function:: getCityEstimatedPopulation(cityName) - - :param string cityName: Name of city. Case-sensitive - - Returns the estimated number of Synthoids in the specified city, or -1 - if an invalid city was specified. - -getCityEstimatedCommunities ---------------------------- - -.. js:function:: getCityEstimatedCommunities(cityName) - - :param string cityName: Name of city. Case-sensitive - - Returns the estimated number of Synthoid communities in the specified city, - or -1 if an invalid city was specified. - -getCityChaos ------------- - -.. js:function:: getCityChaos(cityName) - - :param string cityName: Name of city. Case-sensitive - - Returns the chaos in the specified city, or -1 if an invalid city was specified - -switchCity ----------- - -.. js:function:: switchCity(cityName) - - :param string cityName: Name of city - - Attempts to switch to the specified city (for Bladeburner only). - - Returns true if successful, and false otherwise - -getStamina ----------- - -.. js:function:: getStamina() - - Returns an array with two elements: - - [Current stamina, Max stamina] - - Example usage:: - - function getStaminaPercentage() { - let res = bladeburner.getStamina(); - return res[0] / res[1]; - } - -joinBladeburnerFaction ----------------------- - -.. js:function:: joinBladeburnerFaction() - - Attempts to join the Bladeburner faction. - - Returns true if you successfully join the Bladeburner faction, or if - you are already a member. - - Returns false otherwise. - -joinBladeburnerDivision ------------------------ - -.. js:function:: joinBladeburnerDivision() - - Attempts to join the Bladeburner division. - - Returns true if you successfully join the Bladeburner division, or if you - are already a member. - - Returns false otherwise - -Examples --------- - -**Basic example usage**:: - - tprint(bladeburner.getContractNames()); - tprint(bladeburner.getOperationNames()); - tprint(bladeburner.getBlackOpNames()); - tprint(bladeburner.getGeneralActionNames()); - tprint(bladeburner.getSkillNames()); - tprint(bladeburner.getActionTime("contract", "Tracking")); - tprint("Rank: " + bladeburner.getRank()); - tprint("Skill Points: " + bladeburner.getSkillPoints()); - tprint("Cloak Skill Level: " + bladeburner.getSkillLevel("Cloak")); - tprint("Trying to upgradeSkill: " + bladeburner.upgradeSkill("Cloak")); - tprint("Skill Points remaining: " + bladeburner.getSkillPoints()); - - tprint("Trying to switch to a nonexistent city: " + bladeburner.switchCity("lskgns")); - - var chongqing = "Chongqing"; - tprint("Trying to switch to Chongqing: " + bladeburner.switchCity(chongqing)); - tprint("Chongqing chaos: " + bladeburner.getCityChaos(chongqing)); - tprint("Chongqing estimated pop: " + bladeburner.getCityEstimatedPopulation(chongqing)); - tprint("Chonqging estimated communities: " + bladeburner.getCityEstimatedCommunities(chongqing)); - -**Bladeburner handler example**. Note that this avoids the need of using the *bladeburner* namespace -identifier by attaching the Bladeburner API functions to an object:: - - const FIELD_ANALYSIS_INTERVAL = 10; //Number of minutes between field analysis states - const FIELD_ANALYSIS_DURATION = 5; //Duration in minutes - - function BladeburnerHandler(ns, params) { - //Netscript environment becomes part of the instance - this.ns = ns; - - //Netscript bladeburner API becomes part of this instance - for (var bladeburnerFn in ns.bladeburner) { - this[bladeburnerFn] = ns.bladeburner[bladeburnerFn]; - } - - this.fieldAnalysis = { - inProgress: params.startFieldAnalysis ? true : false, - cyclesRemaining: params.startFieldAnalysis ? FIELD_ANALYSIS_DURATION : 0, - cyclesSince: params.startFieldAnalysis ? FIELD_ANALYSIS_INTERVAL : 0, - } - } - - - - BladeburnerHandler.prototype.getStaminaPercentage = function() { - var res = this.getStamina(); - return 100 * (res[0] / res[1]); - } - - BladeburnerHandler.prototype.hasSimulacrum = function() { - var augs = this.ns.getOwnedAugmentations(); - return augs.includes("The Blade's Simulacrum"); - } - - BladeburnerHandler.prototype.handle = function() { - //If we're doing something else manually (without Simlacrum), - //it overrides Bladeburner stuff - if (!this.hasSimulacrum() && this.ns.isBusy()) { - this.ns.print("Idling bc player is busy with some other action"); - return; - } - - if (this.fieldAnalysis.inProgress) { - --(this.fieldAnalysis.cyclesRemaining); - if (this.fieldAnalysis.cyclesRemaining < 0) { - this.fieldAnalysis.inProgress = false; - this.fieldAnalysis.cyclesSince = 0; - return this.handle(); - } else { - this.startAction("general", "Field Analysis"); - this.ns.print("handler is doing field analyis for " + - (this.fieldAnalysis.cyclesRemaining+1) + " more mins"); - return 31; //Field Analysis Time + 1 - } - } else { - ++(this.fieldAnalysis.cyclesSince); - if (this.fieldAnalysis.cyclesSince > FIELD_ANALYSIS_INTERVAL) { - this.fieldAnalysis.inProgress = true; - this.fieldAnalysis.cyclesRemaining = FIELD_ANALYSIS_DURATION; - return this.handle(); - } - } - - this.stopBladeburnerAction(); - - var staminaPerc = this.getStaminaPercentage(); - if (staminaPerc < 55) { - this.ns.print("handler is starting training due to low stamina percentage"); - this.startAction("general", "Training"); - return 31; //Training time + 1 - } else { - var action = this.chooseAction(); - this.ns.print("handler chose " + action.name + " " + action.type + " through chooseAction()"); - this.startAction(action.type, action.name); - return (this.getActionTime(action.type, action.name) + 1); - } - } - - BladeburnerHandler.prototype.chooseAction = function() { - //Array of all Operations - var ops = this.getOperationNames(); - - //Sort Operations in order of increasing success chance - ops.sort((a, b)=>{ - return this.getActionEstimatedSuccessChance("operation", a) - - this.getActionEstimatedSuccessChance("operation", b); - }); - - //Loop through until you find one with 99+% success chance - for (let i = 0; i < ops.length; ++i) { - let successChance = this.getActionEstimatedSuccessChance("operation", ops[i]); - let count = this.getActionCountRemaining("operation", ops[i]); - if (successChance >= 0.99 && count > 10) { - return {type: "operation", name: ops[i]}; - } - } - - //Repeat for Contracts - var contracts = this.getContractNames(); - contracts.sort((a, b)=>{ - return this.getActionEstimatedSuccessChance("contract", a) - - this.getActionEstimatedSuccessChance("contract", b); - }); - - for (let i = 0; i < contracts.length; ++i) { - let successChance = this.getActionEstimatedSuccessChance("contract", contracts[i]); - let count = this.getActionCountRemaining("contract", contracts[i]); - if (successChance >= 0.80 && count > 10) { - return {type: "contract", name: contracts[i]}; - } - } - - return {type:"general", name:"Training"}; - } - - - BladeburnerHandler.prototype.process = async function() { - await this.ns.sleep(this.handle() * 1000); - } - - export async function main(ns) { - //Check if Bladeburner is available. This'll throw a runtime error if it's not - ns.bladeburner.getContractNames(); - - var startFieldAnalysis = true; - if (ns.args.length >= 1 && ns.args[0] == "false") { - startFieldAnalysis = false; - } - - var handler = new BladeburnerHandler(ns, { - startFieldAnalysis: startFieldAnalysis - }); - while(true) { - await handler.process(); - } - } diff --git a/doc/build/html/_sources/netscriptdatatypes.rst.txt b/doc/build/html/_sources/netscriptdatatypes.rst.txt deleted file mode 100644 index a230fee0e..000000000 --- a/doc/build/html/_sources/netscriptdatatypes.rst.txt +++ /dev/null @@ -1,44 +0,0 @@ -Netscript Data Types and Variables -================================== - - -Data Types ----------- -Netscript supports three primitive data types: - -**Numbers** - Positive numerics, such as integers and floats. Examples: 6, 0, 10.5 - -**Strings** - A sequence of characters that represents text. The characters must be encapsulated by single or -double quotes. Example: "This is a string" or equivalently 'This is a string'. -*Strings are fully functional* `Javascript strings `_, -*which means that all of the member functions of Javascript strings such as toLowerCase() and includes() are also available in Netscript!* - -**Boolean** - true or false - -**Array** - An array is a special container object that is capable of holding many different values. Arrays are simply Javascript -arrays, and most Javascript array methods can be used in Netscript as well (join(), pop(), splice(), etc.). You can read more about -`Javascript arrays here `_ - -Variables ---------- - -Variables can be thought of as named containers. Their purpose is to label and store data. The data stored in the -variable can then be accessed and changed by referring to the variable's name. The name of a variable must start with -either a letter or an underscore. The rest of the variable name can contain any alphanumeric (letters and numbers), -as well as hyphens and underscores. - -The Netscript language is untyped, meaning that any variable can hold any of the data types above. The value type of a variable -can also change. For example, if a variable initially holds a number, it can later hold a string. - -The following shows how you can declare and initialize variables:: - - i = 1; - s = "This is a string"; - b = false; - -After declaring a variable, the values in variables can be used simply by referencing the name. For example:: - - j = i + 5; - s2 = s + " Adding more letters onto the string" - -The first command above will store the value 6 in the variable j. The second command will store the string "This is a string Adding more letters onto the string" into the variable s2. diff --git a/doc/build/html/_sources/netscriptfunctions.rst.txt b/doc/build/html/_sources/netscriptfunctions.rst.txt deleted file mode 100644 index d2443c0da..000000000 --- a/doc/build/html/_sources/netscriptfunctions.rst.txt +++ /dev/null @@ -1,1030 +0,0 @@ -Netscript Basic Functions -========================= - -This page contains the complete documentation for all functions that are available in Netscript. -This includes information such as function signatures, what they do, and their return values. - -At the end is also a section that describes how to define your own functions in Netscript. - -hack -^^^^ - -.. js:function:: hack(hostname/ip) - - :param string hostname/ip: IP or hostname of the target server to hack - :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 hack() on a server will raise that server's security level by 0.002. - - Example:: - - hack("foodnstuff"); - hack("10.1.2.3"); - -grow -^^^^ - -.. js:function:: grow(hostname/ip) - - :param string hostname/ip: IP or hostname of the target server to grow - :returns: The number by which the money on the server was multiplied for the growth - - Use your hacking skills to increase the amount of money available on a server. The runtime for this command depends on your hacking - level and the target server's security level. When grow() completes, the money available on a target server will be increased by a - certain, fixed percentage. This 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. The getServerGrowth() function can be used to obtain a server's growth rate. - - Like hack(), grow() can be called on any server, regardless of where the script is running. The 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. - - Example:: - - grow("foodnstuff"); - -weaken -^^^^^^ - -.. js:function:: weaken(hostname/ip) - - :param string hostname.ip: IP or hostname of the target server to weaken - :returns: The amount by which the target server's security level was decreased. This is equivalent to 0.05 multiplied - by the number of script threads - - Use your hacking skills to attack a server's security, lowering the server's security level. The runtime for this command - depends on your hacking level and the target server's security level. This function lowers the security level of the target - server by 0.05. - - Like hack() and grow(), weaken() can be called on any server, regardless of where the script is running. This command requires - root access to the target server, but there is no required hacking level to run the command. - - Example:: - - weaken("foodnstuff"); - -sleep -^^^^^ - -.. js:function:: sleep(n) - - :param number n: Number of milliseconds to sleep - - Suspends the script for n milliseconds. - -print -^^^^^ - -.. js:function:: print(x) - - :param x: Value to be printed - - Prints a value or a variable to the script's logs. - -tprint -^^^^^^ - -.. js:function:: tprint(x) - - :param x: Value to be printed - - Prints a value or a variable to the Terminal - -clearLog -^^^^^^^^ - -.. js:function:: clearLog() - - Clears the script's logs - -disableLog -^^^^^^^^^^ - -.. js:function:: disableLog(fn) - - :param string fn: 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. - - Note that this does not completely remove all logging functionality. - This only stops a function from logging - when the function is successful. If the function fails, it will still log the reason for failure. - - Notable functions that cannot have their logs disabled: run, exec, exit - -enableLog -^^^^^^^^^ - -.. js:function:: enableLog(fn) - - :param string fn: 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') - -scan -^^^^ - -.. js:function:: scan(hostname/ip[, hostnames=true]) - - :param string hostname/ip: IP or hostname of the server to scan - :param boolean: Optional boolean specifying whether the function should output hostnames (if true) or IP addresses (if false) - - Returns an array containing the hostnames or IPs of all servers that are one node way from the specified target server. The - hostnames/IPs in the returned array are strings. - -nuke -^^^^ - -.. js:function:: nuke(hostname/ip) - - :param string hostname/ip: IP or hostname of the target server - - Runs the NUKE.exe program on the target server. NUKE.exe must exist on your home computer. - - Example:: - - nuke("foodnstuff"); - -brutessh -^^^^^^^^ - -.. js:function:: brutessh(hostname/ip) - - :param string hostname/ip: IP or hostname of the target server - - Runs the BruteSSH.exe program on the target server. BruteSSH.exe must exist on your home computer. - - Example:: - - brutessh("foodnstuff"); - -ftpcrack -^^^^^^^^ - -.. js:function:: ftpcrack(hostname/ip) - - :param string hostname/ip: IP or hostname of the target server - - Runs the FTPCrack.exe program on the target server. FTPCrack.exe must exist on your home computer. - - Example:: - - ftpcrack("foodnstuff"); - -relaysmtp -^^^^^^^^^ - -.. js:function:: relaysmtp(hostname/ip) - - :param string hostname/ip: IP or hostname of the target server - - Runs the relaySMTP.exe program on the target server. relaySMTP.exe must exist on your home computer. - - Example:: - - relaysmtp("foodnstuff"); - -httpworm -^^^^^^^^ - -.. js:function:: httpworm(hostname/ip) - - :param string hostname/ip: IP or hostname of the target server - - Runs the HTTPWorm.exe program on the target server. HTTPWorm.exe must exist on your home computer. - - Example:: - - httpworm("foodnstuff"); - -sqlinject -^^^^^^^^^ - -.. js:function:: sqlinject(hostname/ip) - - :param string hostname/ip: IP or hostname of the target server - - Runs the SQLInject.exe program on the target server. SQLInject.exe must exist on your home computer. - - Example:: - - sqlinject("foodnstuff"); - -run -^^^ - -.. js:function:: run(script, [numThreads=1], [args...]) - - :param string script: Filename of script to run - :param number numThreads: Optional thread count for new script. Set to 1 by default. Will be rounded to nearest integer - :param args...: - Additional arguments to pass into the new script that is being run. Note that if any arguments are being - passed into the new script, then the second argument *numThreads* must be filled in with a value. - - Run a script as a separate process. This function can only be used to run scripts located on the current server (the server - running the script that calls this function). - - Returns true if the script is successfully started, and false otherwise. Requires a significant amount of RAM to run this - command. - - The simplest way to use the *run* command is to call it with just the script name. The following example will run - 'foo.script' single-threaded with no arguments:: - - run("foo.script"); - - The following example will run 'foo.script' but with 5 threads instead of single-threaded:: - - run("foo.script", 5); - - This next example will run 'foo.script' single-threaded, and will pass the string 'foodnstuff' into the script - as an argument:: - - run("foo.script", 1, 'foodnstuff'); - -exec -^^^^ - -.. js:function:: exec(script, hostname/ip, [numThreads=1], [args...]) - - :param string script: Filename of script to execute - :param string hostname/ip: IP or 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. - - Run a script as a separate process on a specified server. This is similar to the *run* function except - that it can be used to run a script on any server, instead of just the current server. - - Returns true if the script is successfully started, and false otherwise. - - The simplest way to use the *exec* command is to call it with just the script name and the target server. - The following example will try to run *generic-hack.script* on the *foodnstuff* server:: - - exec("generic-hack.script", "foodnstuff"); - - The following example will try to run the script *generic-hack.script* on the *joesguns* server with 10 threads:: - - exec("generic-hack.script", "joesguns", 10); - - This last example will try to run the script *foo.script* on the *foodnstuff* server with 5 threads. It will also pass - the number 1 and the string "test" in as arguments to the script:: - - exec("foo.script", "foodnstuff", 5, 1, "test"); - -spawn -^^^^^ - -.. js:function:: spawn(script, numThreads, [args...]) - - :param string script: Filename of script to execute - :param number numThreads: Number of threads to spawn new script with. Will be rounded to nearest integer - :param args...: - Additional arguments to pass into the new script that is being run. - - Terminates the current script, and then after a delay of about 20 seconds it will execute the newly-specified script. - The purpose of this function is to execute a new script without being constrained by the RAM usage of the current one. - This function can only be used to run scripts on the local server. - - Because this function immediately terminates the script, it does not have a return value. - - The following example will execute the script 'foo.script' with 10 threads and the arguments 'foodnstuff' and 90:: - - spawn('foo.script', 10, 'foodnstuff', 90); - -kill -^^^^ - -.. js:function:: kill(script, hostname/ip, [args...]) - - :param string script: Filename of the script to kill - :param string hostname/ip: IP or hostname of the server on which to kill the script - :param args...: Arguments to identify which script to kill - - 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.script* is run with the argument 1, then this - is not the same as *foo.script* run with the argument 2, even though they have the same code. - - If this function successfully kills the specified script, then it will return true. Otherwise, it will return false. - - Examples: - - The following example will try to kill a script named *foo.script* on the *foodnstuff* server that was ran with no arguments:: - - kill("foo.script", "foodnstuff"); - - The following will try to kill a script named *foo.script* on the current server that was ran with no arguments:: - - kill("foo.script", getHostname()); - - The following will try to kill a script named *foo.script* on the current server that was ran with the arguments 1 and "foodnstuff":: - - kill("foo.script", getHostname(), 1, "foodnstuff"); - -killall -^^^^^^^ - -.. js:function:: killall(hostname/ip) - - :param string hostname/ip: IP or hostname of the server on which to kill all scripts - - Kills all running scripts on the specified server. This function returns true if any scripts were killed, and - false otherwise. In other words, it will return true if there are any scripts running on the target server. - - -exit -^^^^ - -.. js:function:: exit() - - Terminates the current script immediately - -scp -^^^ - -.. js:function:: scp(files, [source], destination) - - :param string/array files: Filename or an array of filenames of script/literature files to copy - :param string source: - Hostname or IP of the source server, which is the server from which the file will be copied. - This argument is optional and if it's omitted the source will be the current server. - :param string destination: Hostname or IP of the destination server, which is the server to which the file will be copied. - - Copies a script or literature (.lit) file(s) to another server. The *files* argument can be either a string specifying a - single file to copy, or an array of strings specifying multiple files to copy. - - Returns true if the script/literature file is successfully copied over and false otherwise. If the *files* argument is an array - then this function will return true if at least one of the files in the array is successfully copied. - - Examples:: - - //Copies hack-template.script from the current server to foodnstuff - scp("hack-template.script", "foodnstuff"); - - //Copies foo.lit from the helios server to the home computer - scp("foo.lit", "helios", "home"); - - //Tries to copy three files from rothman-uni to home computer - files = ["foo1.lit", "foo2.script", "foo3.script"]; - scp(files, "rothman-uni", "home"); - -ls -^^ - -.. js:function:: ls(hostname/ip, [grep]) - - :param string hostname/ip: Hostname or IP of the target server - :param string grep: a substring to search for in the filename - - Returns an array with the filenames of all files on the specified server (as strings). The returned array - is sorted in alphabetic order - -ps -^^ - -.. js:function:: ps(hostname/ip=current ip) - - :param string ip: Hostname or IP address of the target server. - If not specified, it will be the current server's IP by default - - 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 - } - - Example usage (using :doc:`netscriptjs`):: - - export async function main(ns) { - const ps = ns.ps("home"); - for (let i = 0; i < ps.length; ++i) { - ns.tprint(ps[i].filename + ' ' + ps[i].threads); - ns.tprint(ps[i].args); - } - } - -hasRootAccess -^^^^^^^^^^^^^ - -.. js:function:: hasRootAccess(hostname/ip) - - :param string hostname/ip: Hostname or IP of the target server - - Returns a boolean indicating whether or not the player has root access to the specified target server. - - Example:: - - if (hasRootAccess("foodnstuff") == false) { - nuke("foodnstuff"); - } - -getHostname -^^^^^^^^^^^ - -.. js:function:: getHostname() - - Returns a string with the hostname of the server that the script is running on - -getHackingLevel -^^^^^^^^^^^^^^^ - -.. js:function:: getHackingLevel() - - Returns the player's current hacking level - -getHackingMultipliers -^^^^^^^^^^^^^^^^^^^^^ - -.. js:function:: getHackingMultipliers() - - Returns an object containing the Player's hacking related multipliers. These multipliers are - returned in fractional forms, not percentages (e.g. 1.5 instead of 150%). The object has the following 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 of how this can be used:: - - mults = getHackingMultipliers(); - print(mults.chance); - print(mults.growth); - -getHacknetMultipliers -^^^^^^^^^^^^^^^^^^^^^ - -.. js:function:: getHacknetMultipliers() - - Returns an object containing the Player's hacknet related multipliers. These multipliers are - returned in fractional forms, not percentages (e.g. 1.5 instead of 150%). The object has the following 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 of how this can be used:: - - mults = getHacknetMultipliers(); - print(mults.production); - print(mults.purchaseCost); - - - -getServerMoneyAvailable -^^^^^^^^^^^^^^^^^^^^^^^ - -.. js:function:: getServerMoneyAvailable(hostname/ip) - - :param string hostname/ip: Hostname or IP of target server - - Returns the amount of money available on a server. **Running this function on the home computer will return - the player's money.** - - Example:: - - getServerMoneyAvailable("foodnstuff"); - getServerMoneyAvailable("home"); //Returns player's money - -getServerMaxMoney -^^^^^^^^^^^^^^^^^ - -.. js:function:: getServerMaxMoney(hostname/ip) - - :param string hostname/ip: Hostname or IP of target server - - Returns the maximum amount of money that can be available on a server - -getServerGrowth -^^^^^^^^^^^^^^^ - -.. js:function:: getServerGrowth(hostname/ip) - - :param string hostname/ip: Hostname or IP of target server - - Returns the server's instrinsic "growth parameter". This growth parameter is a number - between 1 and 100 that represents how quickly the server's money grows. This parameter affects the - percentage by which the server's money is increased when using the *grow()* function. A higher - growth parameter will result in a higher percentage increase from *grow()*. - -getServerSecurityLevel -^^^^^^^^^^^^^^^^^^^^^^ - -.. js:function:: getServerSecurityLevel(hostname/ip) - - :param string hostname/ip: Hostname or IP of target server - - Returns the security level of the target server. A server's security level is denoted by a number, typically - between 1 and 100 (but it can go above 100). - -getServerBaseSecurityLevel -^^^^^^^^^^^^^^^^^^^^^^^^^^ - -.. js:function:: getServerBaseSecurityLevel(hostname/ip) - - :param string hostname/ip: Hostname or IP of target server - - Returns the base security level of the target server. This is the security level that the server starts out with. - This is different than *getServerSecurityLevel()* because *getServerSecurityLevel()* returns the current - security level of a server, which can constantly change due to *hack()*, *grow()*, and *weaken()*, calls on that - server. The base security level will stay the same until you reset by installing an Augmentation(s). - -getServerMinSecurityLevel -^^^^^^^^^^^^^^^^^^^^^^^^^ - -.. js:function:: getServerMinSecurityLevel(hostname/ip) - - :param string hostname/ip: Hostname or IP of target server - - Returns the minimum security level of the target server - -getServerRequiredHackingLevel -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -.. js:function:: getServerRequiredHackingLevel(hostname/ip) - - :param string hostname/ip: Hostname or IP of target server - - Returns the required hacking level of the target server - -getServerNumPortsRequired -^^^^^^^^^^^^^^^^^^^^^^^^^ - -.. js:function:: getServerNumPortsRequired(hostname/ip) - - :param string hostname/ip: Hostname or IP of target server - - Returns the number of open ports required to successfully run NUKE.exe on the specified server. - -getServerRam -^^^^^^^^^^^^ - -.. js:function:: getServerRam(hostname/ip) - - :param string hostname/ip: Hostname or IP of target server - - Returns an array with two elements that gives information about a server's memory (RAM). The first - element in the array is the amount of RAM that the server has total (in GB). The second element in - the array is the amount of RAM that is currently being used on the server (in GB). - - Example:: - - res = getServerRam("helios"); - totalRam = res[0]; - ramUsed = res[1]; - -serverExists -^^^^^^^^^^^^ - -.. js:function:: serverExists(hostname/ip) - - :param string hostname/ip: Hostname or IP of target server - - Returns a boolean denoting whether or not the specified server exists - -fileExists -^^^^^^^^^^ - -.. js:function:: fileExists(filename, [hostname/ip]) - - :param string filename: Filename of file to check - :param string hostname/ip: - Hostname or IP of target server. This is optional. If it is not specified then the - function will use the current server as the target server - - Returns a boolean indicating whether the specified file exists on the target server. 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/ip* argument is omitted, then the function will search through the current server (the server - running the script that calls this function) for the file. - - Examples:: - - fileExists("foo.script", "foodnstuff"); - fileExists("ftpcrack.exe"); - - The first example above will return true if the script named *foo.script* 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. - -isRunning -^^^^^^^^^ - -.. js:function:: isRunning(filename, hostname/ip, [args...]) - - :param string filename: Filename of script to check. This is case-sensitive. - :param string hostname/ip: Hostname or IP of target server - :param args...: Arguments to specify/identify which scripts to search for - - Returns a boolean indicating whether the specified script is running on the target server. 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.script* with no arguments - running on the *foodnstuff* server, and false otherwise:: - - isRunning("foo.script", "foodnstuff"); - - In this second example below, the function call will return true if there is a script named *foo.script* with no arguments - running on the current server, and false otherwise:: - - isRunning("foo.script", 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:: - - isRunning("foo.script", "joesguns", 1, 5, "test"); - -getNextHacknetNodeCost -^^^^^^^^^^^^^^^^^^^^^^ - -.. js:function:: getNextHacknetNodeCost() - - Returns the cost of purchasing a new Hacknet Node - -purchaseHacknetNode -^^^^^^^^^^^^^^^^^^^ - -.. js:function:: purchaseHacknetNode() - - Purchases a new Hacknet Node. Returns a number with the index of the Hacknet Node. This index is equivalent to the number at the - end of the Hacknet Node's name (e.g The Hacknet Node named 'hacknet-node-4' will have an index of 4). If the player cannot afford - to purchase a new Hacknet Node then the function will return false. - -purchaseServer -^^^^^^^^^^^^^^ - -.. js:function:: purchaseServer(hostname, ram) - - :param string hostname: Hostname of the purchased server - :param number ram: Amount of RAM of the purchased server. Must be a power of 2 (2, 4, 8, 16, etc.). Maximum value of 1048576 (2^20) - - Purchased 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. - - Returns the hostname of the newly purchased server as a string. If the function fails to purchase a server, then it will return an - empty string. The function will fail if the arguments passed in are invalid, if the player does not have enough money to purchase - the specified server, or if the player has exceeded the maximum amount of servers. - - Example:: - - ram = 64; - hn = "pserv-"; - for (i = 0; i < 5; ++i) { - purchaseServer(hn + i, ram); - } - -deleteServer -^^^^^^^^^^^^ - -.. js:function:: deleteServer(hostname) - - :param string hostname: Hostname of the server to delete - - Deletes one of your purchased servers, which is specified by its hostname. - - 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. - - Returns true if successful, and false otherwise. - -getPurchasedServers -^^^^^^^^^^^^^^^^^^^ - -.. js:function:: getPurchasedServers([hostname=true]) - - :param boolean hostname: - Specifies whether hostnames or IP addresses should be returned. If it's true then hostnames will be returned, and if false - then IPs will be returned. If this argument is omitted then it is true by default - - Returns an array with either the hostnames or IPs of all of the servers you have purchased. - -write -^^^^^ - -.. js:function:: write(port/fn, data="", mode="a") - - :param string/number port/fn: Port or text file that will be written to - :param string data: Data to write - :param string mode: Defines the write mode. Only valid when writing to text files. - - This function can be used to either write data to a port or to a text file (.txt). - - 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 - about how `Netscript Ports work here `_. The third argument, *mode*, is not used - 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 - 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* - 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 - 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. - -read -^^^^ - -.. js:function:: read(port/fn) - - :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). - - 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 - about how `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. - - 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 - the text file does not exist, an empty string will be returned. - -peek -^^^^ - -.. js:function:: peek(port) - - :param number port: Port to peek. Must be an integer between 1 and 10 - - 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. - - Read about how `Netscript Ports work here `_. - -clear -^^^^^ - -.. js:function:: clear(port/fn) - - :param string/number port/fn: Port or text file to clear - - This function is used to clear data in a `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 string, then it specifies the name of a text file (.txt) and will delete all data from that text file. - -rm -^^ - -.. js:function:: rm(fn) - - :param string fn: Filename of file to remove. Must include the extension - :returns: True if it successfully deletes the file, and false otherwise - - Removes the specified file from the current server. This function works for every file type except message (.msg) files. - -scriptRunning -^^^^^^^^^^^^^ - -.. js:function:: scriptRunning(scriptname, hostname/ip) - - :param string scriptname: Filename of script to check. This is case-sensitive. - :param string hostname/ip: Hostname or IP of target server - - Returns a boolean indicating whether any instance of the specified script is running on the target server, regardless of - its arguments. - - This is different than the *isRunning()* function because it does not try to identify a specific instance of a running script - by its arguments. - - **Examples:** - - The example below will return true if there is any script named *foo.script* running on the *foodnstuff* server, and false otherwise:: - - scriptRunning("foo.script", "foodnstuff"); - - The example below will return true if there is any script named "foo.script" running on the current server, and false otherwise:: - - scriptRunning("foo.script", getHostname()); - -scriptKill -^^^^^^^^^^ - -.. js:function:: scriptKill(scriptname, hostname/ip) - - :param string scriptname: Filename of script to kill. This is case-sensitive. - :param string hostname/ip: Hostname or IP of target server - - Kills all scripts with the specified filename on the target server specified by *hostname/ip*, regardless of arguments. Returns - true if one or more scripts were successfully killed, and false if none were. - -getScriptName -^^^^^^^^^^^^^ - -.. js:function:: getScriptName() - - Returns the current script name - -getScriptRam -^^^^^^^^^^^^ - -.. js:function:: getScriptRam(scriptname[, hostname/ip]) - - :param string scriptname: Filename of script. This is case-sensitive. - :param string hostname/ip: Hostname or IP of target server the script is located on. This is optional, If it is not specified then the function will se the current server as the target server. - - Returns the amount of RAM required to run the specified script on the target server. Returns - 0 if the script does not exist. - -getHackTime -^^^^^^^^^^^ - -.. js:function:: getHackTime(hostname/ip) - - :param string hostname/ip: Hostname or IP of target server - - Returns the amount of time in seconds it takes to execute the *hack()* Netscript function on the target server. - -getGrowTime -^^^^^^^^^^^ - -.. js:function:: getGrowTime(hostname/ip) - - :param string hostname/ip: Hostname or IP of target server - - Returns the amount of time in seconds it takes to execute the *grow()* Netscript function on the target server. - -getWeakenTime -^^^^^^^^^^^^^ - -.. js:function:: getWeakenTime(hostname/ip) - - :param string hostname/ip: Hostname or IP of target server - - Returns the amount of time in seconds it takes to execute the *weaken()* Netscript function on the target server. - -getScriptIncome -^^^^^^^^^^^^^^^ - -.. js:function:: getScriptIncome([scriptname], [hostname/ip], [args...]) - - :param string scriptname: Filename of script - :param string hostname/ip: Server on which script is running - :param args...: Arguments that the script is running with - - Returns the amount of income the specified script generates while online (when the game is open, does not apply for offline income). - Remember that a script is uniquely identified by both its name and its arguments. So for example if you ran a script with the arguments - "foodnstuff" and "5" then in order to use this function to get that script's income you must specify those same arguments in the same order - in this function call. - - This function can also be called with no arguments. If called with no arguments, then this function will return an array of two values. The - first value is the total income ($ / second) of all of your active scripts (scripts that are currently running on any server). The second value - is the total income ($ / second) that you've earned from scripts since you last installed Augmentations. - -getScriptExpGain -^^^^^^^^^^^^^^^^ - -.. js:function:: getScriptExpGain([scriptname], [hostname/ip], [args...]) - - :param string scriptname: Filename of script - :param string hostname/ip: Server on which script is running - :param args...: Arguments that the script is running with - - Returns the amount of hacking experience the specified script generates while online (when the game is open, does not apply for offline experience gains). - Remember that a script is uniquely identified by both its name and its arguments. - - This function can also return the total experience gain rate of all of your active scripts by running the function with no arguments. - -getTimeSinceLastAug -^^^^^^^^^^^^^^^^^^^ - -.. js:function:: getTimeSinceLastAug() - - Returns the amount of time in milliseconds that have passed since you last installed Augmentations - -sprintf -^^^^^^^ - -.. js:function:: sprintf() - - See `this link `_ for details. - -vsprintf -^^^^^^^^ - -.. js:function:: vsprintf() - - See `this link `_ for details. - -prompt -^^^^^^ - -.. js:function:: prompt(txt) - - :param string txt: Text to appear in the prompt dialog box - - Prompts the player with a dialog box with two options: "Yes" and "No". This function will return true if the player click "Yes" and - false if the player clicks "No". The script's execution is halted until the player selects one of the options. - - -Defining your own Functions ---------------------------- - -Note that the following information is only applicable for Netscript 1.0. -:doc:`netscriptjs` allows you to define your functions using native Javascript -techniques. - -You can define your own functions in Netscript 1.0 using the following syntax:: - - function name(args...) { - function code here... - return some_value - } - -Functions should have some return value. Here is an example of defining and using a function:: - - function sum(values) { - res = 0; - for (i = 0; i < values.length; ++i) { - res += values[i]; - } - return res; - } - - print(sum([1, 2, 3, 4, 5])); //Prints 15 - print(sum([1, 10])); //Prints 11 - -For those with experience in other languages, especially Javascript, it may be important to note that -function declarations are not hoisted and must be declared BEFORE you use them. -For example, the following will cause an error saying `variable hello not defined`:: - - print(hello()); - - function hello() { - return "world"; - } - -The following will work fine:: - - function hello() { - return "world"; - } - - print(hello()); //Prints out "world" - -**Note about variable scope in functions:** - -Functions can access "global" variables declared outside of the function's scope. However, they cannot change the value of any "global" variables. -Any changes to "global" variables will only be applied locally to the function. - -The following example shows that any change to a "global" variable -from inside a function only applies in the function's local scope:: - - function foo() { - i = 5; - return "foo"; - } - - i = 0; - print(i); //Prints 0 - foo(); - print(i); //Prints 0 - -Furthermore, this also means that any variable that is first defined inside a -function will NOT be accessible outside of the function as shown in the following example:: - - function sum(values) { - res = 0; - for (i = 0; i < values.length; ++i) { - res += values[i]; - } - return res; - } - print(res); - -results in the following runtime error:: - - Script runtime error: - Server Ip: 75.7.4.1 - Script name: test.script - Args:[] - variable res not defined - - -**Other Notes about creating your own functions:** - -Defining a function does not create a Javascript function object in the underlying game code. This means that you cannot use any function -you create in functions such as `Array.sort() `_ (not yet at least, I'll try to make it work in the future). diff --git a/doc/build/html/_sources/netscripthacknetnodeapi.rst.txt b/doc/build/html/_sources/netscripthacknetnodeapi.rst.txt deleted file mode 100644 index 34ac33cf8..000000000 --- a/doc/build/html/_sources/netscripthacknetnodeapi.rst.txt +++ /dev/null @@ -1,171 +0,0 @@ -Netscript Hacknet Node API -========================== - -Netscript provides the following API for accessing and upgrading your Hacknet Nodes -through scripts. - -Note that none of these functions will write to the script's logs. If you want -to see what your script is doing you will have to print to the logs yourself. - -hacknetnodes -^^^^^^^^^^^^ - - *hacknetnodes* is a special variable. It is an array that maps to the player's - Hacknet Nodes. The Hacknet Nodes are accessed through indexed. These indexes - correspond to the number at the end of the name of the Hacknet Node. For example, - the first Hacknet Node you purchase will have the name "hacknet-node-0" and can be - accessed using *hacknetnodes[0]*. The fourth Hacknet Node you purchase will have the name - "hacknet-node-3" and can be accessed using *hacknetnodes[3]*. - -Purchasing Hacknet Nodes -^^^^^^^^^^^^^^^^^^^^^^^^ - -The following is a list of supported functions for purchasing Hacknet Nodes. - -.. js:function:: getNextHacknetNodeCost() - - Returns the cost of purchasing a new Hacknet Node - -.. js:function:: purchaseHacknetNode() - - Purchases a new Hacknet Node. Returns a number with the index of the Hacknet Node. This index is equivalent to the number at the - end of the Hacknet Node's name (e.g The Hacknet Node named 'hacknet-node-4' will have an index of 4). If the player cannot afford - to purchase a new Hacknet Node then the function will return false. - - -Hacknet Node Member Variables -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -The following is a list of member variables for a Hacknet Node object. These variables are read-only, which means you cannot assign -a value to these. - -Note that these must be called on an element inside the *hacknetnodes* array, not the array itself. - -.. js:attribute:: hacknetnodes[i].name - - Returns the name of the corresponding Hacknet Node - - -.. js:attribute:: hacknetnodes[i].level - - Returns the level of the corresponding Hacknet Node - -.. js:attribute:: hacknetnodes[i].ram - - Returns the amount of RAM on the corresponding Hacknet Node - -.. js:attribute:: hacknetnodes[i].cores - - Returns the number of cores on the corresponding Hacknet Node - -.. js:attribute:: hacknetnodes[i].totalMoneyGenerated - - Returns the total amount of money that the corresponding Hacknet Node has earned - -.. js:attribute:: hacknetnodes[i].onlineTimeSeconds - - Returns the total amount of time (in seconds) that the corresponding Hacknet Node has existed - -.. js:attribute:: hacknetnodes[i].moneyGainRatePerSecond - - Returns the amount of income that the corresponding Hacknet Node earns - -Hacknet Node Methods -^^^^^^^^^^^^^^^^^^^^ - -The following is a list of supported functions/methods for a Hacknet Node object. - -Note that these must be called on an element inside the *hacknetnodes* array, not the -array itself. - -.. js:method:: hacknetnodes[i].upgradeLevel(n) - - :param number n: Number of levels to upgrade. Must be positive. Rounded to nearest integer - - Tries to upgrade the level of the corresponding Hacknet Node *n* times. Returns true if the - Hacknet Node's level is successfully upgraded *n* times or up to the max level (200), and false - otherwise. - -.. js:method:: hacknetnodes[i].upgradeRam() - - Tries to upgrade the amount of RAM on the corresponding Hacknet Node. Returns true if the RAM is - successfully upgraded and false otherwise. - -.. js:method:: hacknetnodes[i].upgradeCore() - - Tries to purchase an additional core for the corresponding Hacknet Node. Returns true if the - additional core is successfully purchased, and false otherwise. - -.. js:method:: hacknetnodes[i].getLevelUpgradeCost(n) - - :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 - -.. js:method:: hacknetnodes[i].getRamUpgradeCost() - - Returns the cost of upgrading the RAM of the specified Hacknet Node. Upgrading a Node's RAM doubles it. - -.. js:method:: hacknetnodes[i].getCoreUpgradeCost() - - Returns the cost of upgrading the number of cores of the specified Hacknet Node. Upgrading a Node's - number of cores adds one additional core. - -Utils -^^^^^ - -.. js:function:: getHacknetMultipliers() - - Returns an object containing the Player's hacknet related multipliers. These multipliers are - returned in integer forms, not percentages (e.g. 1.5 instead of 150%). The object has the following 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 of how this can be used:: - - mults = getHacknetMultipliers(); - print(mults.production); - print(mults.purchaseCost); - - -Example(s) -^^^^^^^^^^ - -The following is an example of one way a script can be used to automate the purchasing and upgrading of Hacknet Nodes. -This script purchases new Hacknet Nodes until the player has four. Then, it iteratively upgrades each of those four Hacknet -Nodes to a level of at least 75, RAM to at least 8GB, and number of cores to at least 2:: - - //Purchase 4 Hacknet Nodes - while(hacknetnodes.length < 4) { - purchaseHacknetNode(); - } - - //Upgrade all 4 Hacknet Nodes to at least level 75 - for (i = 0; i < 4; i = i++) { - while (hacknetnodes[i].level <= 75) { - hacknetnodes[i].upgradeLevel(5); - sleep(10000); - } - } - - //Upgrade RAM on all Hacknet Nodes to 8GB - for (i = 0; i < 4; i = i++) { - while (hacknetnodes[i].ram < 8) { - hacknetnodes[i].upgradeRam(); - sleep(10000); - } - } - - //Upgrade cores on all Hacknet Nodes to 2 - for (i = 0; i < 4; i = i++) { - while (hacknetnodes[i].cores < 2) { - hacknetnodes[i].upgradeCore(); - sleep(10000); - } - } diff --git a/doc/build/html/_sources/netscriptixapi.rst.txt b/doc/build/html/_sources/netscriptixapi.rst.txt deleted file mode 100644 index 8f34f99ae..000000000 --- a/doc/build/html/_sources/netscriptixapi.rst.txt +++ /dev/null @@ -1,174 +0,0 @@ -Netscript Trade Information eXchange (TIX) API -============================================== - -The Trade Information eXchange (TIX) is the communications protocol supported by the World Stock Exchange (WSE). -The WESE provides an API that allows you to automatically communicate with the -`Stock Market `_. This API lets you write code using Netscript -to build automated trading systems and create your own algorithmic trading strategies. Access to this -TIX API can be purchased by visiting the World Stock Exchange in-game. - -Access to the TIX API currently costs $5 billion. After you purchase it, you will retain this -access even after you 'reset' by installing Augmentations - -getStockPrice -------------- - -.. js:function:: getStockPrice(sym) - - :param string sym: Stock symbol - - Returns the price of a stock, given its symbol (NOT the company name). The symbol is a sequence - of two to four capital letters. - - Example:: - - getStockPrice("FISG"); - -getStockPosition ----------------- - -.. js:function:: getStockPosition(sym) - - :param string sym: Stock symbol - - Returns an array of four elements that represents the player's position in a stock. - - The first element is the returned array is the number of shares the player owns of the stock in the - `Long position `_. The second - element in the array is the average price of the player's shares in the Long position. - - The third element in the array is the number of shares the player owns of the stock in the - `Short position `_. The fourth - element in the array is the average price of the player's Short position. - - All elements in the returned array are numeric. - - Example:: - - pos = getStockPosition("ECP"); - shares = pos[0]; - avgPx = pos[1]; - sharesShort = pos[2]; - avgPxShort = pos[3]; - -buyStock --------- - -.. js:function:: buyStock(sym, shares) - - :param string sym: Symbol of stock to purchase - :param number shares: Number of shares to purchased. Must be positive. Will be rounded to nearest integer - - Attempts to purchase shares of a stock using a `Market Order `_. - - If the player does not have enough money to purchase the specified number of shares, then no shares will be purchased. Remember - that every transaction on the stock exchange costs a certain commission fee. - - If this function successfully purchases the shares, it will return the stock price at which each share was purchased. Otherwise, - it will return 0. - -sellStock ---------- - -.. js:function:: sellStock(sym, shares) - - :param string sym: Symbol of stock to sell - :param number shares: Number of shares to sell. Must be positive. Will be rounded to nearest integer - - Attempts to sell shares of a stock using a `Market Order `_. - - If the specified number of shares in the function exceeds the amount that the player actually owns, then this function will - sell all owned shares. Remember that every transaction on the stock exchange costs a certain commission fee. - - The net profit made from selling stocks with this function is reflected in the script's statistics. - This net profit is calculated as:: - - shares * (sell price - average price of purchased shares) - - If the sale is successful, this function will return the stock price at which each share was sold. Otherwise, it will return 0. - -shortStock ----------- - -.. js:function:: shortStock(sym, shares) - - :param string sym: Symbol of stock to short - :param number shares: Number of shares to short. Must be positive. Will be rounded to nearest integer - - Attempts to purchase a `short `_ position of a stock - using a `Market Order `_. - - The ability to short a stock is **not** immediately available to the player and must be unlocked later on in the game. - - If the player does not have enough money to purchase the specified number of shares, then no shares will be purchased. - Remember that every transaction on the stock exchange costs a certain commission fee. - - If the purchase is successful, this function will return the stock price at which each share was purchased. Otherwise, it will return 0. - -sellShort ---------- - -.. js:function:: sellShort(sym, shares) - - :param string sym: Symbol of stock to sell - :param number shares: Number of shares to sell. Must be positive. Will be rounded to nearest integer - - Attempts to sell a `short `_ position of a stock - using a `Market Order `_. - - The ability to short a stock is **not** immediately available to the player and must be unlocked later on in the game. - - If the specified number of shares exceeds the amount that the player actually owns, then this function will sell all owned - shares. Remember that every transaction on the stock exchange costs a certain commission fee. - - If the sale is successful, this function will return the stock price at which each share was sold. Otherwise it will return 0. - -placeOrder ----------- - -.. js:function:: placeOrder(sym, shares, price, type, pos) - - :param string sym: Symbol of stock to player order for - :param number shares: Number of shares for order. Must be positive. Will be rounded to nearest integer - :param number price: Execution price for the order - :param string type: Type of order. It must specify "limit" or "stop", and must also specify "buy" or "sell". This is NOT - case-sensitive. Here are four examples that will work: - - * limitbuy - * limitsell - * stopbuy - * stopsell - - :param string pos: - Specifies whether the order is a "Long" or "Short" position. The Values "L" or "S" can also be used. This is - NOT case-sensitive. - - Places an order on the stock market. This function only works for `Limit and Stop Orders `_. - - The ability to place limit and stop orders is **not** immediately available to the player and must be unlocked later on in the game. - - Returns true if the order is successfully placed, and false otherwise. - -cancelOrder ------------ - -.. js:function:: cancelOrder(sym, shares, price, type, pos) - - :param string sym: Symbol of stock to player order for - :param number shares: Number of shares for order. Must be positive. Will be rounded to nearest integer - :param number price: Execution price for the order - :param string type: Type of order. It must specify "limit" or "stop", and must also specify "buy" or "sell". This is NOT - case-sensitive. Here are four examples that will work: - - * limitbuy - * limitsell - * stopbuy - * stopsell - - :param string pos: - Specifies whether the order is a "Long" or "Short" position. The Values "L" or "S" can also be used. This is - NOT case-sensitive. - - Cancels an oustanding Limit or Stop order on the stock market. - - The ability to use limit and stop orders is **not** immediately available to the player and must be unlocked later on in the game. diff --git a/doc/build/html/_sources/netscriptjs.rst.txt b/doc/build/html/_sources/netscriptjs.rst.txt deleted file mode 100644 index 2508d686d..000000000 --- a/doc/build/html/_sources/netscriptjs.rst.txt +++ /dev/null @@ -1,206 +0,0 @@ -.. _netscriptjs: - -NetscriptJS (Netscript 2.0) -=========================== -Netscript 2.0, or Netscript JS, is the new and improved version of Netscript that -allows users to write (almost) full-fledged Javascript code in their scripts, while -still being able to access the Netscript functions. - -NetscriptJS was developed primarily by `Github user jaguilar `_ - -On top of having almost all of the features and capabilities of Javascript, NetscriptJS is also -significantly faster than Netscript 1.0. - -This documentation will not go over any of the additional features of NetscriptJS, since -there is plenty of documentation on Javascript available on the web. - -NetscriptJS in Mozilla Firefox ------------------------------- -As of the time of writing this, the Mozilla Firefox browser does not support -dynamic import functionality and therefore cannot run NetscriptJS scripts. - -(This may be some option/method for enabling this in Firefox, but I don't know -what is it) - -How to use NetscriptJS ----------------------- -Working with NetscriptJS scripts is the same as Netscript 1.0 scripts. The only difference -is that NetscriptJS scripts use the ".ns" or ".js" extension rather than ".script". E.g.:: - - $ nano foo.ns - $ run foo.ns -t 100 arg1 arg2 arg3 - exec("foo.ns", "purchasedServer1", "100", "randomArg"); - -The caveat when using NetscriptJS to write scripts is that your code must be -asynchronous. Furthermore, instead of using the global scope and executing your code -sequentially, NetscriptJS uses a :code:`main()` function as an entry point. - -Furthermore, the "Netscript environment" must be passed into a NetscriptJS script through -the main function. This environment includes all of the pre-defined Netscript functions -(:code:`hack()`, :code:`exec`, etc.) as well as the arguments you pass to the script. - -Therefore, the signature of the :code:`main()` function must be:: - - export async function main(ns) { - ns.print("Starting script here"); - await ns.hack("foodnstuff"); //Use Netscript hack function - ns.print(ns.args); //The script arguments must be prefaced with ns as well - } - -Here is a summary of all rules you need to follow when writing Netscript JS code: - -* Write :code:`await` before any call to the following Netscript functions: - - * hack - * grow - * weaken - * sleep - * run - * exec - * prompt - -* Any function that contains :code:`await` must be declared as :code:`async` - -* Always :code:`await` any function that is marked as :code:`async` - -* Any functions that you want to be visible from other scripts must be marked with :code:`export`. - -* **Do not write any infinite loops without using a** :code:`sleep` **or one of the timed Netscript functions like** :code:`hack`. Doing so will crash your game. - -* Any global variable declared in a NetscriptJS script is shared between all instances of that - script. For example, assume you write a script *foo.ns* and declared a global variable like so:: - - //foo.ns - let globalVariable; - - export async function main(ns) { - globalVariable = ns.args.length; - while(true) { - ns.tprint(globalVariable); - await ns.sleep(3000); - } - } - - Then, you ran multiple instances of *foo.ns*:: - - $ run foo.ns 1 - $ run foo.ns 1 2 3 - $ run foo.ns 1 2 3 4 5 - - Then all three instances of foo.ns will share the same instance of :code:`globalVariable`. - (In this example, the value of :code:`globalVariable` will be set to 5 because the - last instance of *foo.ns* to run has 5 arguments. This means that all three instances of - the script will repeatedly print the value 5). - - These global variables can be thought of as `C++ static class members `_, - where a NetscriptJS script is a class and a global variable is a static member within that class. - -Warnings --------- -The NetscriptJS evaluation engine works by converting your code into a blob URL and then -using a dynamic import to load your code as a module. Every unique NetscriptJS script -is loaded as its own module. This means that -making a small edit to a NetscriptJS script results in a new module being generated. - -At this point, we have been unable to find a method for deleting modules from browsers so that -they get garbage collected. - -The result is that these modules from NetscriptJS scripts accumulate in your browser, -using memory that never gets released. Over time, this results in a memory-leak type -situation that can slow down your computer. - -Therefore, there are two recommendations for those who decide to use NetscriptJS: - -1. Every now and then, close and re-open the game. This will clear all of the modules. -To be safe, I recommend **completely** closing the game's tab and then re-opening it. -Depending on your browser, a refresh or page reload does not always clear the modules. - -2. Only use NetscriptJS scripts when needed. It is very unlikely that NetscriptJS -is needed for very simple scripts. By doing this, you will reduce the number of modules -that are loaded. - -Examples --------- - -**DOM Manipulation (tprintColored.ns)** - -Directly alter the game's terminal and print colored text:: - - export function tprintColored(txt, color) { - let terminalInput = document.getElementById("terminal-input"); - let rowElement = document.createElement("tr"); - let cellElement = document.createElement("td"); - - rowElement.classList.add("posted"); - cellElement.classList.add("terminal-line"); - cellElement.style.color = color; - cellElement.innerText = txt; - - rowElement.appendChild(cellElement); - terminalInput.before(rowElement); - } - - export async function main(ns) { - tprintColored("Red Text!", "red"); - tprintColored("Blue Text!", "blue"); - tprintColored("Use Hex Codes!", "#3087E3"); - } - -**Script Scheduler (scriptScheduler.ns)** - -This script shows some of the new functionality that is available in NetscriptJS, -including objects and object constructors, changing an object's prototype, and -importing other NetscriptJS scripts:: - - import {tprintColored} from "tprintColored.ns"; //Importing from other NetscriptJS scripts works! - - function ScriptJob(params) { - if (params.fn == null) { - throw new Error("No Filename (fn) passed into ScriptJob ctor"); - } - - this.fn = params.fn; - this.threads = params.threads ? params.threads : 1; - this.args = params.args ? params.args : []; - } - - ScriptJob.prototype.run = async function(ns) { - let runArgs = [this.fn, this.threads].concat(this.args); - await ns.run.apply(this, runArgs); - tprintColored("Running " + this.fn + " on " + ns.getHostname(), "blue"); - } - - ScriptJob.prototype.exec = async function(ns, target) { - ns.scp(this.fn, target); - - let execArgs = [this.fn, target, this.threads].concat(this.args); - await ns.exec.apply(this, execArgs); - - tprintColored("Executing " + this.fn + " on " + target, "blue"); - } - - export async function main(ns) { - tprintColored("Starting scriptScheduler.ns", "red"); - try { - let job = new ScriptJob({ - fn: "test.js", - threads: 1, - args: ["foodnstuff"] - }); - await job.run(ns); - await job.exec(ns, "foodnstuff"); - } catch (e) { - ns.tprint("Exception thrown in scriptScheduler.ns: " + e); - } - } - -Final Note ----------- -NetscriptJS opens up a lot of possibilities when scripting. I look forward to seeing -the scripts that people come up with. Just remember that the power and capabilities of -NetscriptJS come with risks. Please backup your save if you're going to experiment with -NetscriptJS and report any serious exploits. - -With great power comes great responsibility - -Happy hacking diff --git a/doc/build/html/_sources/netscriptloopsandconditionals.rst.txt b/doc/build/html/_sources/netscriptloopsandconditionals.rst.txt deleted file mode 100644 index e47e16fd9..000000000 --- a/doc/build/html/_sources/netscriptloopsandconditionals.rst.txt +++ /dev/null @@ -1,39 +0,0 @@ -Netscript Loops and Conditionals -================================ - - -Netscript loops and conditionals are the same as Javascript. However, the one caveat is that when declaring variables such as the -iterator for traversing a loop, you should not use the 'var' or 'let' keyword. For reference, you can see the Javascript -documentation for loops/conditionals here: - -`While loops `_ - -`For loops `_ - -`Conditionals (If/Else statements) `_ - -Here are some simple code examples that show the use of loops and conditionals in Netscript. - -The following is a while loop that runs the hack() Netscript function ten times:: - - i = 0; - while (i < 10) { - hack('foodnstuff'); - i = i + 1; - } - -The following is a for loop that runs the hack() Netscript function ten times:: - - for (i = 0; i < 10; ++i) { - hack("foodnstuff"); - } - -The following is a conditional that uses the getServerMoneyAvailable() Netscript function to check how much money -exists on the 'foodnstuff' server. If there is more than $200,000 on the server, then the server will be hacked. -Otherwise, the money available on the server will be grown using the grow() Netscript function:: - - if (getServerMoneyAvailable('foodnstuff') > 200000) { - hack("foodnstuff"); - } else { - grow("foodnstuff"); - } diff --git a/doc/build/html/_sources/netscriptmisc.rst.txt b/doc/build/html/_sources/netscriptmisc.rst.txt deleted file mode 100644 index ad32469b2..000000000 --- a/doc/build/html/_sources/netscriptmisc.rst.txt +++ /dev/null @@ -1,238 +0,0 @@ -Netscript Miscellaneous -======================= - -Netscript Ports ---------------- -Netscript ports are endpoints that can be used to communicate between scripts. -A port is implemented as a sort of serialized queue, where you can only write -and read one element at a time from the port. When you read data from a port, -the element that is read is removed from the port. - -The :js:func:`read`, :js:func:`write`, :js:func:`clear`, and :js:func:`peek` -Netscript functions can be used to interact with ports. - -Right now, there are only 20 ports for Netscript, denoted by the number 1 -through 20. When using the functions above, the ports are specified -by passing the number as the first argument. - -IMPORTANT: The data inside ports are not saved! This means if you close and -re-open the game, or reload the page then you will lose all of the data in -the ports! - -**Example Usage** - -Here's a brief example of how ports work. For the sake of simplicity we'll only deal with port 1. - -Let's assume Port 1 starts out empty (no data inside). We'll represent the port as such:: - - [] - -Now assume we ran the following simple script:: - - for (i = 0; i < 10; ++i) { - write(1, i); //Writes the value of i to port 1 - } - -After this script executes, our script will contain every number from 0 through 9, as so:: - - [0, 1, 2, 3, 4, 5, 6, 7 , 8, 9] - -Then, assume we run the following script:: - - for (i = 0; i < 3; ++i) { - print(read(1)); //Reads a value from port 1 and then prints it - } - -This script above will read the first three values from port 1 and then print them to the script's log. The log will end up looking like:: - - 0 - 1 - 2 - -And the data in port 1 will look like:: - - [3, 4, 5, 6, 7, 8, 9] - -**Port Handles** - -The :js:func:`getPortHandle` Netscript function can be used to get a handle to a Netscript Port. -This handle allows you to access several new port-related functions and the -port's underlying data structure, which is just a Javascript array. The functions are: - -.. js:method:: NetscriptPort.write(data) - - :param data: Data to write to the port - :returns: If the port is full, the item that is removed from the port is returned. - Otherwise, null is returned. - - Writes `data` to the port. Works the same as the Netscript function `write`. - -.. js:method:: NetscriptPort.tryWrite(data) - - :param data: Data to try to write to the port - :returns: True if the data is successfully written to the port, and false otherwise. - - Attempts to write `data` to the Netscript port. If the port is full, the data will - not be written. Otherwise, the data will be written normally. - -.. js::method:: NetscriptPort.read() - - :returns: The data read from the port. If the port is empty, "NULL PORT DATA" is returned - - Removes and returns the first element from the port. - Works the same as the Netscript function `read` - -.. js::method:: NetscriptPort.peek() - - :returns: The first element in the port, or "NULL PORT DATA" if the port is empty. - - Returns the first element in the port, but does not remove it. - Works the same as the Netscript function `peek` - -.. js:method:: NetscriptPort.full() - - :returns: True if the Netscript Port is full, and false otherwise - -.. js:method:: NetscriptPort.empty() - - :returns: True if the Netscript Port is empty, and false otherwise - -.. js:method:: NetscriptPort.clear() - - Clears all data from the port. Works the same as the Netscript function `clear` - -.. js:attribute:: NetscriptPort.data - - The Netscript port underlying data structure, which is just a Javascript array. All - valid Javascript Array methods can be called on this. - -Port Handle Example:: - - port = getPortHandle(5); - back = port.data.pop(); //Get and remove last element in port - - //Remove an element from the port - i = port.data.findIndex("foo"); - if (i != -1) { - port.data.slice(i, 1); - } - - //Wait for port data before reading - while(port.empty()) { - sleep(10000); - } - res = port.read(); - - //Wait for there to be room in a port before writing - while (!port.tryWrite(5)) { - sleep(5000); - } - - //Successfully wrote to port! - - -Comments --------- -Netscript supports comments using the same syntax as `Javascript comments `_. -Comments are not evaluated as code, and can be used to document and/or explain code:: - - //This is a comment and will not get executed even though its in the code - /* Multi - * line - * comment */ - print("This code will actually get executed"); - -Importing Functions -------------------- - -In Netscript you can import functions that are declared in other scripts. -The script will incur the RAM usage of all imported functions. -There are two ways of doing this:: - - import * as namespace from "script filename"; //Import all functions from script - import {fn1, fn2, ...} from "script filename"; //Import specific functions from script - -Suppose you have a library script called *testlibrary.script*:: - - function foo1(args) { - //function definition... - } - - function foo2(args) { - //function definition... - } - - function foo3(args) { - //function definition... - } - - function foo4(args) { - //function definition... - } - -Then, if you wanted to use these functions in another script, you can import them like so:: - - import * as testlib from "testlibrary.script"; - - values = [1,2,3]; - - //The imported functions must be specified using the namespace - someVal1 = testlib.foo3(values); - someVal2 = testlib.foo1(values); - if (someVal1 > someVal2) { - //... - } else { - //... - } - -If you only wanted to import certain functions, you can do so without needing -to specify a namespace for the import:: - - import {foo1, foo3} from "testlibrary.script"; //Saves RAM since not all functions are imported! - - values = [1,2,3]; - - //No namespace needed - someVal1 = foo3(values); - someVal2 = foo1(values); - if (someVal1 > someVal2) { - //... - } else { - //... - } - -Note that exporting functions is not required. - - -Javascript Math Module ----------------------- - -The `Javascript Math Module `_ is -supported in Netscript and is used in the same way:: - - numThreads = Math.floor(getServerRam("foodnstuff")[1] / 3.4); - -Javascript Date Module ----------------------- - -The `Javascript Date Module `_ is supported in Netscript. -However, since the 'new' operator does not work in Netscript, only the Date module's static functions can be used: - -* now() -* UTC() -* Parse() -* Maybe some others I don't know about - -Example:: - - time = Date.now(); - -Javascript Number Module ------------------------- - -The `Javascript Number module `_ is supported in Netscript. - -Example:: - - tprint(Number.isInteger(1)); //True - tprint(Number.isInteger(1.534059)); //False diff --git a/doc/build/html/_sources/netscriptoperators.rst.txt b/doc/build/html/_sources/netscriptoperators.rst.txt deleted file mode 100644 index 84ca09f3c..000000000 --- a/doc/build/html/_sources/netscriptoperators.rst.txt +++ /dev/null @@ -1,53 +0,0 @@ -Netscript Operators -=================== - -Operators ---------- - -Binary Operators -^^^^^^^^^^^^^^^^ - -Binary operators require two operands and produce a result based on their values. In general, binary -operators do not change the value of the operands. - -=========== =========================== ============================================================== -Operator Name Example/Comments -=========== =========================== ============================================================== -= Assignment i = 5 would assign the value 5 to the variable i -\+ Addition 5 + 12 would return 17 -\- Subtraction 20 - 8 would return 12 -\* Multiplication 4 * 5 would return 20 -\/ Division 50 / 10 would return 5 -% Modulo 50 % 9 would return 5 -&& Logical AND true && false would return false -|| Logical OR true || false would return true -< Less than 4 < 5 would return true -> Greater than 4 > 5 would return false -<= Less than or equal to 5 <= 5 would return true ->= Greater than or equal to 5 >= 4 would return true -== Equality 1 == 1 would return true -!= Inequality 4 != 5 would return true -=== Strict equality 1 === "1" would return false -!== Strict inequality 1 !== "1" would return true -=========== =========================== ============================================================== - -Unary Operators -^^^^^^^^^^^^^^^ - -Unary operators require only a single operand and produce a result based on their values. Some unary operators will -change the value of their operands. For example:: - - i = 0; - ++i; - -Running the pre-increment unary operator (++) in the code above changes the value of the variable i. - - -=============== =========================== ============================================================================================== -Operator Name Example/comments -=============== =========================== ============================================================================================== -! Logical NOT operator !true would return false, and !false would return true. Does not change operand's value -\- Negation Negates a number. Only works for numerics. Does not change operand's value -++ Pre-increment ++i or i++. WARNING: This only pre-increments, even if you put i++. Changes operand's value --- Pre-decrement --i or i--. WARNING: This only pre-decrements, even if you put i--. Changes operand's value -=============== =========================== ============================================================================================== diff --git a/doc/build/html/_sources/netscriptscriptarguments.rst.txt b/doc/build/html/_sources/netscriptscriptarguments.rst.txt deleted file mode 100644 index b52403d28..000000000 --- a/doc/build/html/_sources/netscriptscriptarguments.rst.txt +++ /dev/null @@ -1,17 +0,0 @@ -Netscript Script Arguments -========================== - -Arguments passed into a script can be accessed in Netscript using a special array called *args*. The arguments can be -accessed using a normal array using the [] operator (args[0], args[1], etc...). - -For example, let's say we want to make a generic script 'generic-run.script' and we plan to pass two arguments into that script. -The first argument will be the name of another script, and the second argument will be a number. This generic script will run the -script specified in the first argument with the amount of threads specified in the second element. The code would look like:: - - run(args[0], args[1]); - -It is also possible to get the number of arguments that was passed into a script using:: - - args.length - -WARNING: Do not try to modify the args array. This will break the game. I will do my best to prevent players from doing this. diff --git a/doc/build/html/_sources/netscriptsingularityfunctions.rst.txt b/doc/build/html/_sources/netscriptsingularityfunctions.rst.txt deleted file mode 100644 index 9d687b230..000000000 --- a/doc/build/html/_sources/netscriptsingularityfunctions.rst.txt +++ /dev/null @@ -1,537 +0,0 @@ -Netscript Singularity Functions -=============================== - -The Singularity Functions are a special set of Netscript functions. These functions allow you to control -many additional aspects of the game through scripts, such as working for factions/companies, purchasing/installing Augmentations, -and creating programs. - -The Singularity Functions are **not** immediately available to the player and must be unlocked later in the game. - -**WARNING: This page contains spoilers for the game**. - -The Singularity Functions are unlocked in BitNode-4. If you are in BitNode-4, then you will automatically have access to all of these functions. -You can use the Singularity Functions in other BitNodes if and only if you have the Source-File for BitNode-4 (aka Source-File 4). Each level of -Source-File 4 will open up additional Singularity Functions that you can use in other BitNodes. If your Source-File 4 is upgraded all the way to -level 3, then you will be able to access all of the Singularity Functions. - -Note that Singularity Functions require a lot of RAM outside of BitNode-4 (their RAM costs are multiplied by 10 if you are not in BitNode-4) - -universityCourse ----------------- - -.. js:function:: universityCourse(universityName, courseName) - - :param string universityName: - Name of university. Not case-sensitive. You must be in the correct city for whatever university you specify. - - * Summit University - * Rothman University - * ZB Institute Of Technology - :param string courseName: - Name of course. Not case-sensitive. - - * Study Computer Science - * Data Strucures - * Networks - * Algorithms - * Management - * Leadership - - If you are not in BitNode-4, then you must have Level 1 of Source-File 4 in order to use this function. - - This function will automatically set you to start taking a course at a university. If you are already in the middle of some - "working" action (such as working at a company, for a faction, or on a program), then running this function will automatically - cancel that action and give you your earnings. - - The cost and experience gains for all of these universities and classes are the same as if you were to manually visit and take these classes. - - This function will return true if you successfully start taking the course, and false otherwise. - -gymWorkout ----------- - -.. js:function:: gymWorkout(gymName, stat) - - :param string gymName: - Name of gym. Not case-sensitive. You must be in the correct city for whatever gym you specify. - - * Crush Fitness Gym - * Snap Fitness Gym - * Iron Gym - * Powerhouse Gym - * Millenium Fitness Gym - :param string stat: - The stat you want to train. Not case-sensitive. - - * strength OR str - * defense OR def - * dexterity OR dex - * agility OR agi - - If you are not in BitNode-4, then you must have Level 1 of Source-File 4 in order to use this function. - - This function will automatically set you to start working out at a gym to train a particular stat. If you are - already in the middle of some "working" action (such as working at a company, for a faction, or on a program), - then running this function will automatically cancel that action and give you your earnings. - - The cost and experience gains for all of these gyms are the same as if you were to manually visit these gyms and train - - This function will return true if you successfully start working out at the gym, and false otherwise. - -travelToCity ------------- - -.. js:function:: travelToCity(cityName) - - :param string cityName: - City to travel to. CASE-SENSITIVE. - - * Aevum - * Chongqing - * Sector-12 - * New Tokyo - * Ishima - * Volhaven - - If you are not in BitNode-4, then you must have Level 1 of Source-File 4 in order to use this function. - - This function allows the player to travel to any city. The cost for using this function is the same as the cost for traveling through the Travel Agency. - - This function will return true if you successfully travel to the specified city and false otherwise. - -purchaseTor ------------ - -.. js:function:: purchaseTor() - - If you are not in BitNode-4, then you must have Level 1 of Source-File 4 in order to use this function. - - This function allows you to automatically purchase a TOR router. The cost for purchasing a TOR router using this - function is the same as if you were to manually purchase one. - - This function will return true if it successfully purchase a TOR router and false otherwise. - -purchaseProgram ---------------- - -.. js:function:: purchaseProgram(programName) - - :param string programName: Name of program to purchase. Must include '.exe' extension. Not case-sensitive. - - If you are not in BitNode-4, then you must have Level 1 of Source-File 4 in order to use this function. - - This function allows you to automatically purchase programs. You MUST have a TOR router in order to use this function. - The cost of purchasing programs using this function is the same as if you were purchasing them through the Dark Web using the - Terminal *buy* command. - - Example:: - - purchaseProgram("brutessh.exe"); - - This function will return true if the specified program is purchased, and false otherwise. - -getStats --------- - -.. js:function:: getStats() - - If you are not in BitNode-4, then you must have Level 1 of Source-File 4 in order to run this function. - - Returns an object with the Player's stats. The object has the following properties:: - - { - hacking - strength - defense - dexterity - agility - charisma - intelligence - } - - Example:: - - res = getStats(); - print('My charisma level is: ' + res.charisma); - -getCharacterInformation ------------------------ - - If you are not in BitNode-4, then you must have Level 1 of Source-File 4 in order to run this function. - - Returns an object with various information about your character. The object has the following properties:: - - { - bitnode: Current BitNode number - company: Name of company - jobTitle: Name of job - city: Name of city you are currently in - factions: Array of factions you are currently a member of - tor: Boolean indicating whether or not you have a tor router - - //The following apply to when the character is performing - //some type of working action, such as working for a company/faction - timeWorked: Timed worked in ms - workHackExpGain: Hacking experience earned so far from work - workStrExpGain: Str experience earned so far from work - workDefExpGain: Def experience earned so far from work - workDexExpGain: Dex experience earned so far from work - workAgiExpGain: Agi experience earned so far from work - workChaExpGain: Cha experience earned so far from work - workRepGain: Reputation earned so far from work, if applicable - workMoneyGain: Money earned so far from work, if applicable - } - -isBusy ------- - -.. js:function:: isBusy() - - If you are not in BitNode-4, then you must have Level 1 of Source-File 4 in order to run this function. - - Returns a boolean indicating whether or not the player is currently performing an 'action'. These actions include - working for a company/faction, studying at a univeristy, working out at a gym, creating a program, or committing a crime. - -stopAction ----------- - -.. js:function:: stopAction() - - If you are not in BitNode-4, then you must have Level 1 of Source-File 4 in order to run this function. - This function is used to end whatever 'action' the player is currently performing. The player - will receive whatever money/experience/etc. he has earned from that action. - - The actions that can be stopped with this function are: - - * Studying at a university - * Working for a company/faction - * Creating a program - * Committing a Crime - - This function will return true if the player's action was ended. It will return false if the player was not - performing an action when this function was called. - -upgradeHomeRam --------------- - -.. js:function:: upgradeHomeRam() - - If you are not in BitNode-4, then you must have Level 2 of Source-File 4 in order to use this function. - - This function will upgrade amount of RAM on the player's home computer. The cost is the same as if you were to do it manually. - - This function will return true if the player's home computer RAM is successfully upgraded, and false otherwise. - -getUpgradeHomeRamCost ---------------------- - -.. js:function:: getUpgradeHomeRamCost() - - If you are not in BitNode-4, then you must have Level 2 of Source-File 4 in order to use this function. - - Returns the cost of upgrading the player's home computer RAM. - -workForCompany --------------- - -.. js:function:: workForCompany() - - If you are not in BitNode-4, then you must have Level 2 of Source-File 4 in order to use this function. - - This function will automatically set you to start working at the company at which you are employed. - If you are already in the middle of some "working" action (such as working for a faction, training at - a gym, or creating a program), then running this function will automatically cancel that action and give you your earnings. - - This function will return true if the player starts working, and false otherwise. - - Note that when you are working for a company, you will not actually receive your earnings - (reputation, money, experience) until you FINISH the action. This can be an issue if, for example, - you only want to work until you get 100,000 company reputation. One small hack to get around this is to - continuously restart the action to receive your earnings:: - - while (getCompanyRep(COMPANY HERE) < VALUE) { - workForCompany(); - sleep(60000); - } - - This way, your company reputation will be updated every minute. - -applyToCompany --------------- - -.. js:function:: applyToCompany(companyName, field) - - :param string companyName: Name of company to apply to. CASE-SENSITIVE. - :param string field: - Field to which you want to apply. Not case-sensitive - - * software - * software consultant - * it - * security engineer - * network engineer - * business - * business consultant - * security - * agent - * employee - * part-time employee - * waiter - * part-time waiter - - If you are not in BitNode-4, then you must have Level 2 of Source-File 4 in order to use this function. - - This function will automatically try to apply to the specified company for a position in the specified - field. This function can also be used to apply for promotions by specifying the company and field you - are already employed at. - - This function will return true if you successfully get a job/promotion, and false otherwise. Note that - if you are trying to use this function to apply for a promotion and you don't get one, it will return false. - -getCompanyRep -------------- - -.. js:function:: getCompanyRep(companyName) - - :param string companyName: Name of the company. CASE-SENSITIVE - - If you are not in BitNode-4, then you must have Level 2 of Source-File 4 in order to use this function. - - This function will return the amount of reputation you have at the specified company. - If the company passed in as an argument is invalid, -1 will be returned. - -getCompanyFavor ---------------- - -.. js:function:: getCompanyFavor(companyName) - - :param string companyName: Name of the company. CASE-SENSITIVE - - If you are not in BitNode-4, then you must have Level 2 of Source-File 4 in order to use this function. - - This function will return the amount of favor you have at the specified company. - If the company passed in as an argument is invalid, -1 will be returned. - -checkFactionInvitations ------------------------ - -.. js:function:: checkFactionInvitations() - - If you are not in BitNode-4, then you must have Level 2 of Source-File 4 in order to use this function. - - Returns an array with the name of all Factions you currently have oustanding invitations from. - -joinFaction ------------ - -.. js:function:: joinFaction(name) - - :param string name: Name of faction to join. CASE-SENSITIVE - - If you are not in BitNode-4, then you must have Level 2 of Source-File 4 in order to use this function. - - This function will automatically accept an invitation from a faction and join it. - -workForFaction --------------- - -.. js:function:: workForFaction(factionName, workType) - - :param string factionName: Name of faction to work for. CASE-SENSITIVE - :param string workType: - Type of work to perform for the faction - - * hacking/hacking contracts/hackingcontracts - * field/fieldwork/field work - * security/securitywork/security work - - If you are not in BitNode-4, then you must have Level 2 of Source-File 4 in order to use this function. - - This function will automatically set you to start working for the specified faction. - Obviously, you must be a member of the faction or else this function will fail. If you are already in - the middle of some "working" action (such as working for a company, training at a gym, or creating a program), - then running this function will automatically cancel that action and give you your earnings. - - This function will return true if you successfully start working for the specified faction, and false otherwise. - - Note that when you are working for a faction, you will not actually receive your earnings (reputation, experience) - until you FINISH the action. This can be an issue if, for example, you only want to work until you get 100,000 faction - reputation. One small hack to get around this is to continuously restart the action to receive your earnings:: - - while (getFactionRep(FACTION NAME) < VALUE) { - workForFaction(FACNAME, WORKTYPE); - sleep(60000); - } - - This way, your faction reputation will be updated every minute. - -getFactionRep -------------- - -.. js:function:: getFactionRep(factionName) - - :param string factionName: Name of faction. CASE-SENSITIVE - - If you are not in BitNode-4, then you must have Level 2 of Source-File 4 in order to use this function. - - This function returns the amount of reputation you have for the specified faction. - -getFactionFavor ---------------- - -.. js:function:: getFactionFavor(factionName) - - :param string factionName: Name of faction. CASE-SENSITIVE - - If you are not in BitNode-4, then you must have Level 2 of Source-File 4 in order to use this function. - - This function returns the amount of favor you have for the specified faction. - -createProgram -------------- - -.. js:function:: createProgram(programName) - - :param string programName: Name of program to create. Not case-sensitive - - If you are not in BitNode-4, then you must have Level 3 of Source-File 4 in order to use this function. - - This function will automatically set you to start working on creating the specified program. If you are - already in the middle of some "working" action (such as working for a company, training at a gym, or taking a course), - then running this function will automatically cancel that action and give you your earnings. - - Example: - - createProgram("relaysmtp.exe"); - - Note that creating a program using this function has the same hacking level requirements as it normally would. These level requirements are: - - * BruteSSH.exe: 50 - * FTPCrack.exe: 100 - * relaySMTP.exe: 250 - * HTTPWorm.exe: 500 - * SQLInject.exe: 750 - * DeepscanV1.exe: 75 - * DeepscanV2.exe: 400 - * ServerProfiler.exe: 75 - * AutoLink.exe: 25 - - This function returns true if you successfully start working on the specified program, and false otherwise. - -commitCrime ------------ - -.. js:function:: commitCrime(crime) - - :param string crime: - Name of crime to attempt. Not case-sensitive. This argument is fairly lenient in terms of what inputs it accepts. - Here is a list of valid inputs for all of the crimes: - - * shoplift - * rob store - * mug - * larceny - * deal drugs - * bond forgery - * traffick arms - * homicide - * grand theft auto - * kidnap - * assassinate - * heist - - If you are not in BitNode-4, then you must have Level 3 of Source-File 4 in order to use this function. - - This function is used to automatically attempt to commit crimes. If you are already in the middle of some 'working' action - (such as working for a company or training at a gym), then running this function will automatically cancel that action and give you your earnings. - - Note that crimes committed using this function will have all of their earnings halved (this applied for both money and experience!) - - This function returns the number of seconds it takes to attempt the specified crime (e.g It takes 60 seconds to attempt the 'Rob Store' crime, - so running *commitCrime('rob store')* will return 60). - - Warning: I do not recommend using the time returned from this function to try and schedule your crime attempts. - Instead, I would use the isBusy() Singularity function to check whether you have finished attempting a crime. - This is because although the game sets a certain crime to be X amount of seconds, there is no guarantee that your - browser will follow that time limit. - -getCrimeChance --------------- - -.. js:function:: getCrimeChance(crime) - - :param string crime: - Name of crime. Not case-sensitive. This argument is fairlyn lenient in terms of what inputs it accepts. - Check the documentation for the *commitCrime()* function for a list of example inputs. - - If you are not in BitNode-4, then you must have Level 3 of Source-File 4 in order to use this function. - - This function returns your chance of success at commiting the specified crime. The chance is returned as a decimal (i.e. 60% would be returned as 0.6). - -getOwnedAugmentations ---------------------- - -.. js:function:: getOwnedAugmentations(purchased=false) - - :param boolean purchase: - Specifies whether the returned array should include Augmentations you have purchased but not yet installed. - By default, this argument is false which means that the return value will NOT have the purchased Augmentations. - - If you are not in BitNode-4, then you must have Level 3 of Source-File 4 in order to use this function. - - This function returns an array containing the names (as strings) of all Augmentations you have. - -getAugmentationsFromFaction ---------------------------- - -.. js:function:: getAugmentationsFromFaction(facName) - - :param string facName: Name of faction. CASE-SENSITIVE - - If you are not in BitNode-4, then you must have Level 3 of Source-File 4 in order to use this function. - - Returns an array containing the names (as strings) of all Augmentations that are available from the specified faction. - -getAugmentationCost -------------------- - -.. js:function:: getAugmentationCost(augName) - - :param string augName: Name of Augmentation. CASE-SENSITIVE - - If you are not in BitNode-4, then you must have Level 3 of Source-File 4 in order to use this function. - - This function returns an array with two elements that gives the cost for the specified Augmentation. - The first element in the returned array is the reputation requirement of the Augmentation, and the second element is the money cost. - - If an invalid Augmentation name is passed in for the *augName* argument, this function will return the array [-1, -1]. - -purchaseAugmentation --------------------- - -.. js:function:: purchaseAugmentation(factionName, augName) - - :param string factionName: Name of faction to purchase Augmentation from. CASE-SENSITIVE - :param string augName: Name of Augmentation to purchase. CASE-SENSITIVE - - - If you are not in BitNode-4, then you must have Level 3 of Source-File 4 in order to use this function. - - This function will try to purchase the specified Augmentation through the given Faction. - - This function will return true if the Augmentation is successfully purchased, and false otherwise. - -installAugmentations --------------------- - -.. js:function:: installAugmentations(cbScript) - - :param string cbScript: - Optional callback script. This is a script that will automatically be run after Augmentations are installed (after the reset). - This script will be run with no arguments and 1 thread. It must be located on your home computer. - - If you are not in BitNode-4, then you must have Level 3 of Source-File 4 in order to use this function. - - This function will automatically install your Augmentations, resetting the game as usual. - - It will return true if successful, and false otherwise. diff --git a/doc/build/html/_sources/shortcuts.rst.txt b/doc/build/html/_sources/shortcuts.rst.txt deleted file mode 100644 index ffb19eb6b..000000000 --- a/doc/build/html/_sources/shortcuts.rst.txt +++ /dev/null @@ -1,101 +0,0 @@ -.. _shortcuts: - -Keyboard Shortcuts -================== -This page documents the various keyboard shortcuts that can be used in the game. - -Game Navigation ---------------- -These are used to switch between the different menus/tabs in the game. -These shortcuts are almost always available. Exceptions include: - -* Working at a company or for a faction -* Creating a program -* Taking a university class -* Training at a gym -* Active Mission (aka Hacking Mission) - -========== =========================================================================== -Shortcut Action -========== =========================================================================== -Alt + t Switch to :doc:`terminal` -Alt + c Switch to 'Stats' page -Alt + e Switch to Script Editor. Will open up the last-edited file or a new file -Alt + s Switch to 'Active Scripts' page -Alt + h Switch to 'Hacknet Nodes' page -Alt + w Switch to 'City' page -Alt + j Go to the company where you are employed ('Job' page on navigation menu) -Alt + r Go to Travel Agency in current City ('Travel' page on navigation menu) -Alt + p Switch to 'Create Program' page -Alt + f Switch to 'Factions' page -Alt + a Switch to 'Augmentations' page -Alt + u Switch to 'Tutorial' page -Alt + o Switch to 'Options' page -========== =========================================================================== - -Script Editor -------------- -These shortcuts are available only in the Script Editor - -============= =========================================================================== -Shortcut Action -============= =========================================================================== -Ctrl + b Save script and return to :doc:`terminal` -Ctrl + space Function autocompletion -============= =========================================================================== - -In the Script Editor you can configure your key binding mode to three preset options: - -* `Ace `_ -* Vim -* Emacs - -Terminal Shortcuts ------------------- -These shortcuts are available only in the :doc:`terminal` - -============= =========================================================================== -Shortcut Action -============= =========================================================================== -Up/Down arrow Cycle through previous commands -Ctrl + c Cancel a hack/analyze action -Ctrl + l Clear screen -Tab Autocomplete command -============= =========================================================================== - -Terminal Bash Shortcuts ------------------------ -These shortcuts were implemented to better emulate a bash shell. They must be enabled -in your :doc:`terminal`'s *.fconf* file. This can be done be entering the Terminal command:: - - nano .fconf - -and then setting the *ENABLE_BASH_HOTKEYS* option to 1. - -**Note that these Bash shortcuts override any other shortcuts defined in the game (unless otherwise noted), -as well as your browser's shortcuts** - -**Also note that more Bash-like shortcuts will be implemented in the future** - -============= =========================================================================== -Shortcut Action -============= =========================================================================== -Ctrl + c Clears current Terminal input (does NOT override default Ctrl + c command) -Ctrl + p Same as Up Arrow -Ctrl + m Same as Down Arrow -Ctrl + a Move cursor to beginning of line (same as 'Home' key) -Ctrl + e Move cursor to end of line (same as 'End' key) -Ctrl + b Move cursor to previous character -Alt + b Move cursor to previous word -Ctrl + f Move cursor to next character -Alt + f Move cursor to next word -Ctrl + h/d Delete previous character ('Backspace') -============= =========================================================================== - -Misc Shortcuts --------------- -============= =========================================================================== -Shortcut Action -============= =========================================================================== -Esc Close a script's log window -============= =========================================================================== diff --git a/doc/build/html/_sources/terminal.rst.txt b/doc/build/html/_sources/terminal.rst.txt deleted file mode 100644 index dcdd0a9c7..000000000 --- a/doc/build/html/_sources/terminal.rst.txt +++ /dev/null @@ -1,414 +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 keyboard -shortcut Alt + t can be used to open the Terminal. - -Configuration -------------- - -The terminal has a configuration file called .fconf. To edit this file, go to -the terminal and enter:: - - nano .fconf - -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 -^^^^^^^ - -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. - -buy -^^^ - - $ buy [-l/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. - -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 - -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.script 1 2 foodnstuff - -Then to run the 'check' command on this script you would have to pass the same arguments in:: - - $ check foo.script 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 -^^^^^^^ - - $ connect [hostname/ip] - -Connect to a remote server. The hostname or IP address 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 - -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 (TODO Add link here when page gets made) - -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 -^^^^ - -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. - -ifconfig -^^^^^^^^ - -Prints the IP address of the server you are currently connected to. - -kill -^^^^ - - $ kill [script name] [args...] - -Kill 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 are used to start it. So, if a script -was ran with the following arguments:: - - $ run foo.script 50e3 sigma-cosmetics - -Then to kill this script the same arguments would have to be used:: - - $ kill foo.script 50e3 sigma-cosmetics - -Note that after issuing the 'kill' command for a script, it may take a few seconds for -the script to actually stop running. - -killall -^^^^^^^ - -Kills all scripts on the current server. - -ls -^^ - - $ ls [| grep pattern] - -Prints files on the current server to the Terminal screen. - -If this command is run with no arguments, then it prints all files on the current -server to the Terminal screen. The files will be displayed in alphabetical -order. - -The '| grep pattern' is an optional parameter that can be used to only display files -whose filenames match the specified pattern. For example, if you wanted to only display -files with the .script extension, you could use:: - - $ ls | grep .script - -Alternatively, if you wanted to display all files with the word *purchase* in the filename, -you could use:: - - $ ls | grep purchase - - -lscpu -^^^^^ - -Prints the number of CPU cores the current server has. - -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.script - $ mem foo.script -t 50 - -The first example above will print the amount of RAM needed to run 'foo.script' -with a single thread. The second example above will print the amount of RAM needed -to run 'foo.script' with 50 threads. - -nano -^^^^ - - $ nano [filename] - -Opens up the specified file in the Text Editor. Only scripts (.script, .ns, .js) and -text files (.txt) can be edited. If the file does not already exist, then a new -empty file will be created. - -ps -^^ - -Prints all scripts that are currently running on the current server. - -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 -^^^ - - $ run [file name] [-t] [num threads] [args...] - -Execute a program or a script. - -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 number of threads. If the flag is omitted, then -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.script* with 50 threads and the arguments [1e3, 0.5, foodnstuff]:: - - run foo.script -t 50 1e3 0.5 foodnstuff - -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 -^^^^^^^^^^^^ - - $ 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. - -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 -^^^^ - - $ 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.script 10 50000 - -Then in order to check its logs with 'tail' the same arguments must be used:: - - $ tail foo.script 10 50000 - -theme -^^^^^ - - $ theme [preset] | [#background #text #highlight] - -Change the color of the game's user interface - -This command can be called with a preset theme. Currently, the supported presets are: - -* default -* muted -* solarized - -However, you can also specify your own color scheme using hex values. -To do so, you must specify three hex color values for the background -color, the text color, and the highlight color. These hex values must -be preceded by a pound sign (#) and must be either 3 or 6 digits. Example:: - - $ theme #ffffff #385 #235012 - -A color picker such as Google's can be used to get your desired hex color values - -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' diff --git a/doc/build/html/_static/agogo.css b/doc/build/html/_static/agogo.css deleted file mode 100644 index 3ff9bd04b..000000000 --- a/doc/build/html/_static/agogo.css +++ /dev/null @@ -1,541 +0,0 @@ -/* - * agogo.css_t - * ~~~~~~~~~~~ - * - * Sphinx stylesheet -- agogo theme. - * - * :copyright: Copyright 2007-2017 by the Sphinx team, see AUTHORS. - * :license: BSD, see LICENSE for details. - * - */ - -* { - margin: 0px; - padding: 0px; -} - -body { - font-family: "Verdana", Arial, sans-serif; - line-height: 1.4em; - color: black; - background-color: #eeeeec; -} - - -/* Page layout */ - -div.header, div.content, div.footer { - width: 70em; - margin-left: auto; - margin-right: auto; -} - -div.header-wrapper { - background: #555573 url(bgtop.png) top left repeat-x; - border-bottom: 3px solid #2e3436; -} - - -/* Default body styles */ -a { - color: #ce5c00; -} - -div.bodywrapper a, div.footer a { - text-decoration: underline; -} - -.clearer { - clear: both; -} - -.left { - float: left; -} - -.right { - float: right; -} - -.line-block { - display: block; - margin-top: 1em; - margin-bottom: 1em; -} - -.line-block .line-block { - margin-top: 0; - margin-bottom: 0; - margin-left: 1.5em; -} - -h1, h2, h3, h4 { - font-family: "Georgia", "Times New Roman", serif; - font-weight: normal; - color: #3465a4; - margin-bottom: .8em; -} - -h1 { - color: #204a87; -} - -h2 { - padding-bottom: .5em; - border-bottom: 1px solid #3465a4; -} - -a.headerlink { - visibility: hidden; - color: #dddddd; - padding-left: .3em; -} - -h1:hover > a.headerlink, -h2:hover > a.headerlink, -h3:hover > a.headerlink, -h4:hover > a.headerlink, -h5:hover > a.headerlink, -h6:hover > a.headerlink, -dt:hover > a.headerlink, -caption:hover > a.headerlink, -p.caption:hover > a.headerlink, -div.code-block-caption:hover > a.headerlink { - visibility: visible; -} - -img { - border: 0; -} - -div.admonition { - margin-top: 10px; - margin-bottom: 10px; - padding: 2px 7px 1px 7px; - border-left: 0.2em solid black; -} - -p.admonition-title { - margin: 0px 10px 5px 0px; - font-weight: bold; -} - -dt:target, .highlighted { - background-color: #fbe54e; -} - -/* Header */ - -div.header { - padding-top: 10px; - padding-bottom: 10px; -} - -div.header .headertitle { - font-family: "Georgia", "Times New Roman", serif; - font-weight: normal; - font-size: 180%; - letter-spacing: .08em; - margin-bottom: .8em; -} - -div.header .headertitle a { - color: white; -} - -div.header div.rel { - margin-top: 1em; -} - -div.header div.rel a { - color: #fcaf3e; - letter-spacing: .1em; - text-transform: uppercase; -} - -p.logo { - float: right; -} - -img.logo { - border: 0; -} - - -/* Content */ -div.content-wrapper { - background-color: white; - padding-top: 20px; - padding-bottom: 20px; -} - -div.document { - width: 50em; - float: left; -} - -div.body { - padding-right: 2em; - text-align: justify; -} - -div.document h1 { - line-height: 120%; -} - -div.document ul { - margin: 1.5em; - list-style-type: square; -} - -div.document dd { - margin-left: 1.2em; - margin-top: .4em; - margin-bottom: 1em; -} - -div.document .section { - margin-top: 1.7em; -} -div.document .section:first-child { - margin-top: 0px; -} - -div.document div.highlight { - padding: 3px; - background-color: #eeeeec; - border-top: 2px solid #dddddd; - border-bottom: 2px solid #dddddd; - margin-top: .8em; - margin-bottom: .8em; -} - -div.document div.literal-block-wrapper { - margin-top: .8em; - margin-bottom: .8em; -} - -div.document div.literal-block-wrapper div.highlight { - margin: 0; -} - -div.document div.code-block-caption span.caption-number { - padding: 0.1em 0.3em; - font-style: italic; -} - -div.document div.code-block-caption span.caption-text { -} - -div.document h2 { - margin-top: .7em; -} - -div.document p { - margin-bottom: .5em; -} - -div.document li.toctree-l1 { - margin-bottom: 1em; -} - -div.document .descname { - font-weight: bold; -} - -div.document .sig-paren { - font-size: larger; -} - -div.document .docutils.literal { - background-color: #eeeeec; - padding: 1px; -} - -div.document .docutils.xref.literal { - background-color: transparent; - padding: 0px; -} - -div.document blockquote { - margin: 1em; -} - -div.document ol { - margin: 1.5em; -} - - -/* Sidebar */ - -div.sidebar { - width: 20em; - position:fixed; - right: 10%; - height:75%; - font-size: .9em; - overflow-y:auto; -} -/* -div.sidebar { - width: 20em; - float: right; - font-size: .9em; -} -*/ - -div.sidebar a, div.header a { - text-decoration: none; -} - -div.sidebar a:hover, div.header a:hover { - text-decoration: underline; -} - -div.sidebar h3 { - color: #2e3436; - text-transform: uppercase; - font-size: 130%; - letter-spacing: .1em; -} - -div.sidebar ul { - list-style-type: none; -} - -div.sidebar li.toctree-l1 a { - display: block; - padding: 1px; - border: 1px solid #dddddd; - background-color: #eeeeec; - margin-bottom: .4em; - padding-left: 3px; - color: #2e3436; -} - -div.sidebar li.toctree-l2 a { - background-color: transparent; - border: none; - margin-left: 1em; - border-bottom: 1px solid #dddddd; -} - -div.sidebar li.toctree-l3 a { - background-color: transparent; - border: none; - margin-left: 2em; - border-bottom: 1px solid #dddddd; -} - -div.sidebar li.toctree-l2:last-child a { - border-bottom: none; -} - -div.sidebar li.toctree-l1.current a { - border-right: 5px solid #fcaf3e; -} - -div.sidebar li.toctree-l1.current li.toctree-l2 a { - border-right: none; -} - -div.sidebar input[type="text"] { - width: 170px; -} - -div.sidebar input[type="submit"] { - width: 30px; -} - - -/* Footer */ - -div.footer-wrapper { - background: url(bgfooter.png) top left repeat-x; - border-top: 4px solid #babdb6; - padding-top: 10px; - padding-bottom: 10px; - min-height: 80px; -} - -div.footer, div.footer a { - color: #888a85; -} - -div.footer .right { - text-align: right; -} - -div.footer .left { - text-transform: uppercase; -} - - -/* Styles copied from basic theme */ - -img.align-left, .figure.align-left, object.align-left { - clear: left; - float: left; - margin-right: 1em; -} - -img.align-right, .figure.align-right, object.align-right { - clear: right; - float: right; - margin-left: 1em; -} - -img.align-center, .figure.align-center, object.align-center { - display: block; - margin-left: auto; - margin-right: auto; -} - -.align-left { - text-align: left; -} - -.align-center { - text-align: center; -} - -.align-right { - text-align: right; -} - -table caption span.caption-number { - font-style: italic; -} - -table caption span.caption-text { -} - -div.figure p.caption span.caption-number { - font-style: italic; -} - -div.figure p.caption span.caption-text { -} - -/* -- search page ----------------------------------------------------------- */ - -ul.search { - margin: 10px 0 0 20px; - padding: 0; -} - -ul.search li { - padding: 5px 0 5px 20px; - background-image: url(file.png); - background-repeat: no-repeat; - background-position: 0 7px; -} - -ul.search li a { - font-weight: bold; -} - -ul.search li div.context { - color: #888; - margin: 2px 0 0 30px; - text-align: left; -} - -ul.keywordmatches li.goodmatch a { - font-weight: bold; -} - -/* -- index page ------------------------------------------------------------ */ - -table.contentstable { - width: 90%; -} - -table.contentstable p.biglink { - line-height: 150%; -} - -a.biglink { - font-size: 1.3em; -} - -span.linkdescr { - font-style: italic; - padding-top: 5px; - font-size: 90%; -} - -/* -- general index --------------------------------------------------------- */ - -table.indextable td { - text-align: left; - vertical-align: top; -} - -table.indextable ul { - margin-top: 0; - margin-bottom: 0; - list-style-type: none; -} - -table.indextable > tbody > tr > td > ul { - padding-left: 0em; -} - -table.indextable tr.pcap { - height: 10px; -} - -table.indextable tr.cap { - margin-top: 10px; - background-color: #f2f2f2; -} - -img.toggler { - margin-right: 3px; - margin-top: 3px; - cursor: pointer; -} - -/* -- domain module index --------------------------------------------------- */ - -table.modindextable td { - padding: 2px; - border-collapse: collapse; -} - -/* -- viewcode extension ---------------------------------------------------- */ - -.viewcode-link { - float: right; -} - -.viewcode-back { - float: right; - font-family:: "Verdana", Arial, sans-serif; -} - -div.viewcode-block:target { - margin: -1px -3px; - padding: 0 3px; - background-color: #f4debf; - border-top: 1px solid #ac9; - border-bottom: 1px solid #ac9; -} - -div.code-block-caption { - background-color: #ddd; - color: #333; - padding: 2px 5px; - font-size: small; -} - -/* -- math display ---------------------------------------------------------- */ - -div.body div.math p { - text-align: center; -} - -span.eqno { - float: right; -} diff --git a/doc/build/html/_static/ajax-loader.gif b/doc/build/html/_static/ajax-loader.gif deleted file mode 100644 index 61faf8cab..000000000 Binary files a/doc/build/html/_static/ajax-loader.gif and /dev/null differ diff --git a/doc/build/html/_static/basic.css b/doc/build/html/_static/basic.css deleted file mode 100644 index 90acfde50..000000000 --- a/doc/build/html/_static/basic.css +++ /dev/null @@ -1,639 +0,0 @@ -/* - * basic.css - * ~~~~~~~~~ - * - * Sphinx stylesheet -- basic theme. - * - * :copyright: Copyright 2007-2017 by the Sphinx team, see AUTHORS. - * :license: BSD, see LICENSE for details. - * - */ - -/* -- main layout ----------------------------------------------------------- */ - -div.clearer { - clear: both; -} - -/* -- relbar ---------------------------------------------------------------- */ - -div.related { - width: 100%; - font-size: 90%; -} - -div.related h3 { - display: none; -} - -div.related ul { - margin: 0; - padding: 0 0 0 10px; - list-style: none; -} - -div.related li { - display: inline; -} - -div.related li.right { - float: right; - margin-right: 5px; -} - -/* -- sidebar --------------------------------------------------------------- */ - -div.sphinxsidebarwrapper { - padding: 10px 5px 0 10px; -} - -div.sphinxsidebar { - float: left; - width: 0px; - margin-left: -100%; - font-size: 90%; - word-wrap: break-word; - overflow-wrap : break-word; -} - -div.sphinxsidebar ul { - list-style: none; -} - -div.sphinxsidebar ul ul, -div.sphinxsidebar ul.want-points { - margin-left: 20px; - list-style: square; -} - -div.sphinxsidebar ul ul { - margin-top: 0; - margin-bottom: 0; -} - -div.sphinxsidebar form { - margin-top: 10px; -} - -div.sphinxsidebar input { - border: 1px solid #98dbcc; - font-family: sans-serif; - font-size: 1em; -} - -div.sphinxsidebar #searchbox input[type="text"] { - width: 170px; -} - -img { - border: 0; - max-width: 100%; -} - -/* -- search page ----------------------------------------------------------- */ - -ul.search { - margin: 10px 0 0 20px; - padding: 0; -} - -ul.search li { - padding: 5px 0 5px 20px; - background-image: url(file.png); - background-repeat: no-repeat; - background-position: 0 7px; -} - -ul.search li a { - font-weight: bold; -} - -ul.search li div.context { - color: #888; - margin: 2px 0 0 30px; - text-align: left; -} - -ul.keywordmatches li.goodmatch a { - font-weight: bold; -} - -/* -- index page ------------------------------------------------------------ */ - -table.contentstable { - width: 90%; - margin-left: auto; - margin-right: auto; -} - -table.contentstable p.biglink { - line-height: 150%; -} - -a.biglink { - font-size: 1.3em; -} - -span.linkdescr { - font-style: italic; - padding-top: 5px; - font-size: 90%; -} - -/* -- general index --------------------------------------------------------- */ - -table.indextable { - width: 100%; -} - -table.indextable td { - text-align: left; - vertical-align: top; -} - -table.indextable ul { - margin-top: 0; - margin-bottom: 0; - list-style-type: none; -} - -table.indextable > tbody > tr > td > ul { - padding-left: 0em; -} - -table.indextable tr.pcap { - height: 10px; -} - -table.indextable tr.cap { - margin-top: 10px; - background-color: #f2f2f2; -} - -img.toggler { - margin-right: 3px; - margin-top: 3px; - cursor: pointer; -} - -div.modindex-jumpbox { - border-top: 1px solid #ddd; - border-bottom: 1px solid #ddd; - margin: 1em 0 1em 0; - padding: 0.4em; -} - -div.genindex-jumpbox { - border-top: 1px solid #ddd; - border-bottom: 1px solid #ddd; - margin: 1em 0 1em 0; - padding: 0.4em; -} - -/* -- domain module index --------------------------------------------------- */ - -table.modindextable td { - padding: 2px; - border-collapse: collapse; -} - -/* -- general body styles --------------------------------------------------- */ - -div.body p, div.body dd, div.body li, div.body blockquote { - -moz-hyphens: auto; - -ms-hyphens: auto; - -webkit-hyphens: auto; - hyphens: auto; -} - -a.headerlink { - visibility: hidden; -} - -h1:hover > a.headerlink, -h2:hover > a.headerlink, -h3:hover > a.headerlink, -h4:hover > a.headerlink, -h5:hover > a.headerlink, -h6:hover > a.headerlink, -dt:hover > a.headerlink, -caption:hover > a.headerlink, -p.caption:hover > a.headerlink, -div.code-block-caption:hover > a.headerlink { - visibility: visible; -} - -div.body p.caption { - text-align: inherit; -} - -div.body td { - text-align: left; -} - -.first { - margin-top: 0 !important; -} - -p.rubric { - margin-top: 30px; - font-weight: bold; -} - -img.align-left, .figure.align-left, object.align-left { - clear: left; - float: left; - margin-right: 1em; -} - -img.align-right, .figure.align-right, object.align-right { - clear: right; - float: right; - margin-left: 1em; -} - -img.align-center, .figure.align-center, object.align-center { - display: block; - margin-left: auto; - margin-right: auto; -} - -.align-left { - text-align: left; -} - -.align-center { - text-align: center; -} - -.align-right { - text-align: right; -} - -/* -- sidebars -------------------------------------------------------------- */ - -div.sidebar { - margin: 0 0 0.5em 1em; - border: 1px solid #ddb; - padding: 7px 7px 0 7px; - background-color: #ffe; - width: 40%; - float: right; -} - -p.sidebar-title { - font-weight: bold; -} - -/* -- topics ---------------------------------------------------------------- */ - -div.topic { - border: 1px solid #ccc; - padding: 7px 7px 0 7px; - margin: 10px 0 10px 0; -} - -p.topic-title { - font-size: 1.1em; - font-weight: bold; - margin-top: 10px; -} - -/* -- admonitions ----------------------------------------------------------- */ - -div.admonition { - margin-top: 10px; - margin-bottom: 10px; - padding: 7px; -} - -div.admonition dt { - font-weight: bold; -} - -div.admonition dl { - margin-bottom: 0; -} - -p.admonition-title { - margin: 0px 10px 5px 0px; - font-weight: bold; -} - -div.body p.centered { - text-align: center; - margin-top: 25px; -} - -/* -- tables ---------------------------------------------------------------- */ - -table.docutils { - border: 0; - border-collapse: collapse; -} - -table caption span.caption-number { - font-style: italic; -} - -table caption span.caption-text { -} - -table.docutils td, table.docutils th { - padding: 1px 8px 1px 5px; - border-top: 0; - border-left: 0; - border-right: 0; - border-bottom: 1px solid #aaa; -} - -table.footnote td, table.footnote th { - border: 0 !important; -} - -th { - text-align: left; - padding-right: 5px; -} - -table.citation { - border-left: solid 1px gray; - margin-left: 1px; -} - -table.citation td { - border-bottom: none; -} - -/* -- figures --------------------------------------------------------------- */ - -div.figure { - margin: 0.5em; - padding: 0.5em; -} - -div.figure p.caption { - padding: 0.3em; -} - -div.figure p.caption span.caption-number { - font-style: italic; -} - -div.figure p.caption span.caption-text { -} - -/* -- field list styles ----------------------------------------------------- */ - -table.field-list td, table.field-list th { - border: 0 !important; -} - -.field-list ul { - margin: 0; - padding-left: 1em; -} - -.field-list p { - margin: 0; -} - -.field-name { - -moz-hyphens: manual; - -ms-hyphens: manual; - -webkit-hyphens: manual; - hyphens: manual; -} - -/* -- other body styles ----------------------------------------------------- */ - -ol.arabic { - list-style: decimal; -} - -ol.loweralpha { - list-style: lower-alpha; -} - -ol.upperalpha { - list-style: upper-alpha; -} - -ol.lowerroman { - list-style: lower-roman; -} - -ol.upperroman { - list-style: upper-roman; -} - -dl { - margin-bottom: 15px; -} - -dd p { - margin-top: 0px; -} - -dd ul, dd table { - margin-bottom: 10px; -} - -dd { - margin-top: 3px; - margin-bottom: 10px; - margin-left: 30px; -} - -dt:target, .highlighted { - background-color: #fbe54e; -} - -dl.glossary dt { - font-weight: bold; - font-size: 1.1em; -} - -.optional { - font-size: 1.3em; -} - -.sig-paren { - font-size: larger; -} - -.versionmodified { - font-style: italic; -} - -.system-message { - background-color: #fda; - padding: 5px; - border: 3px solid red; -} - -.footnote:target { - background-color: #ffa; -} - -.line-block { - display: block; - margin-top: 1em; - margin-bottom: 1em; -} - -.line-block .line-block { - margin-top: 0; - margin-bottom: 0; - margin-left: 1.5em; -} - -.guilabel, .menuselection { - font-family: sans-serif; -} - -.accelerator { - text-decoration: underline; -} - -.classifier { - font-style: oblique; -} - -abbr, acronym { - border-bottom: dotted 1px; - cursor: help; -} - -/* -- code displays --------------------------------------------------------- */ - -pre { - overflow: auto; - overflow-y: hidden; /* fixes display issues on Chrome browsers */ -} - -span.pre { - -moz-hyphens: none; - -ms-hyphens: none; - -webkit-hyphens: none; - hyphens: none; -} - -td.linenos pre { - padding: 5px 0px; - border: 0; - background-color: transparent; - color: #aaa; -} - -table.highlighttable { - margin-left: 0.5em; -} - -table.highlighttable td { - padding: 0 0.5em 0 0.5em; -} - -div.code-block-caption { - padding: 2px 5px; - font-size: small; -} - -div.code-block-caption code { - background-color: transparent; -} - -div.code-block-caption + div > div.highlight > pre { - margin-top: 0; -} - -div.code-block-caption span.caption-number { - padding: 0.1em 0.3em; - font-style: italic; -} - -div.code-block-caption span.caption-text { -} - -div.literal-block-wrapper { - padding: 1em 1em 0; -} - -div.literal-block-wrapper div.highlight { - margin: 0; -} - -code.descname { - background-color: transparent; - font-weight: bold; - font-size: 1.2em; -} - -code.descclassname { - background-color: transparent; -} - -code.xref, a code { - background-color: transparent; - font-weight: bold; -} - -h1 code, h2 code, h3 code, h4 code, h5 code, h6 code { - background-color: transparent; -} - -.viewcode-link { - float: right; -} - -.viewcode-back { - float: right; - font-family: sans-serif; -} - -div.viewcode-block:target { - margin: -1px -10px; - padding: 0 10px; -} - -/* -- math display ---------------------------------------------------------- */ - -img.math { - vertical-align: middle; -} - -div.body div.math p { - text-align: center; -} - -span.eqno { - float: right; -} - -span.eqno a.headerlink { - position: relative; - left: 0px; - z-index: 1; -} - -div.math:hover a.headerlink { - visibility: visible; -} - -/* -- printout stylesheet --------------------------------------------------- */ - -@media print { - div.document, - div.documentwrapper, - div.bodywrapper { - margin: 0 !important; - width: 100%; - } - - div.sphinxsidebar, - div.related, - div.footer, - #top-link { - display: none; - } -} \ No newline at end of file diff --git a/doc/build/html/_static/bgfooter.png b/doc/build/html/_static/bgfooter.png deleted file mode 100644 index b7c7cadd4..000000000 Binary files a/doc/build/html/_static/bgfooter.png and /dev/null differ diff --git a/doc/build/html/_static/bgtop.png b/doc/build/html/_static/bgtop.png deleted file mode 100644 index 05740880f..000000000 Binary files a/doc/build/html/_static/bgtop.png and /dev/null differ diff --git a/doc/build/html/_static/comment-bright.png b/doc/build/html/_static/comment-bright.png deleted file mode 100644 index 15e27edb1..000000000 Binary files a/doc/build/html/_static/comment-bright.png and /dev/null differ diff --git a/doc/build/html/_static/comment-close.png b/doc/build/html/_static/comment-close.png deleted file mode 100644 index 4d91bcf57..000000000 Binary files a/doc/build/html/_static/comment-close.png and /dev/null differ diff --git a/doc/build/html/_static/comment.png b/doc/build/html/_static/comment.png deleted file mode 100644 index dfbc0cbd5..000000000 Binary files a/doc/build/html/_static/comment.png and /dev/null differ diff --git a/doc/build/html/_static/doctools.js b/doc/build/html/_static/doctools.js deleted file mode 100644 index 565497723..000000000 --- a/doc/build/html/_static/doctools.js +++ /dev/null @@ -1,287 +0,0 @@ -/* - * doctools.js - * ~~~~~~~~~~~ - * - * Sphinx JavaScript utilities for all documentation. - * - * :copyright: Copyright 2007-2017 by the Sphinx team, see AUTHORS. - * :license: BSD, see LICENSE for details. - * - */ - -/** - * select a different prefix for underscore - */ -$u = _.noConflict(); - -/** - * make the code below compatible with browsers without - * an installed firebug like debugger -if (!window.console || !console.firebug) { - var names = ["log", "debug", "info", "warn", "error", "assert", "dir", - "dirxml", "group", "groupEnd", "time", "timeEnd", "count", "trace", - "profile", "profileEnd"]; - window.console = {}; - for (var i = 0; i < names.length; ++i) - window.console[names[i]] = function() {}; -} - */ - -/** - * small helper function to urldecode strings - */ -jQuery.urldecode = function(x) { - return decodeURIComponent(x).replace(/\+/g, ' '); -}; - -/** - * small helper function to urlencode strings - */ -jQuery.urlencode = encodeURIComponent; - -/** - * This function returns the parsed url parameters of the - * current request. Multiple values per key are supported, - * it will always return arrays of strings for the value parts. - */ -jQuery.getQueryParameters = function(s) { - if (typeof s == 'undefined') - s = document.location.search; - var parts = s.substr(s.indexOf('?') + 1).split('&'); - var result = {}; - for (var i = 0; i < parts.length; i++) { - var tmp = parts[i].split('=', 2); - var key = jQuery.urldecode(tmp[0]); - var value = jQuery.urldecode(tmp[1]); - if (key in result) - result[key].push(value); - else - result[key] = [value]; - } - return result; -}; - -/** - * highlight a given string on a jquery object by wrapping it in - * span elements with the given class name. - */ -jQuery.fn.highlightText = function(text, className) { - function highlight(node) { - if (node.nodeType == 3) { - var val = node.nodeValue; - var pos = val.toLowerCase().indexOf(text); - if (pos >= 0 && !jQuery(node.parentNode).hasClass(className)) { - var span = document.createElement("span"); - span.className = className; - span.appendChild(document.createTextNode(val.substr(pos, text.length))); - node.parentNode.insertBefore(span, node.parentNode.insertBefore( - document.createTextNode(val.substr(pos + text.length)), - node.nextSibling)); - node.nodeValue = val.substr(0, pos); - } - } - else if (!jQuery(node).is("button, select, textarea")) { - jQuery.each(node.childNodes, function() { - highlight(this); - }); - } - } - return this.each(function() { - highlight(this); - }); -}; - -/* - * backward compatibility for jQuery.browser - * This will be supported until firefox bug is fixed. - */ -if (!jQuery.browser) { - jQuery.uaMatch = function(ua) { - ua = ua.toLowerCase(); - - var match = /(chrome)[ \/]([\w.]+)/.exec(ua) || - /(webkit)[ \/]([\w.]+)/.exec(ua) || - /(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua) || - /(msie) ([\w.]+)/.exec(ua) || - ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua) || - []; - - return { - browser: match[ 1 ] || "", - version: match[ 2 ] || "0" - }; - }; - jQuery.browser = {}; - jQuery.browser[jQuery.uaMatch(navigator.userAgent).browser] = true; -} - -/** - * Small JavaScript module for the documentation. - */ -var Documentation = { - - init : function() { - this.fixFirefoxAnchorBug(); - this.highlightSearchWords(); - this.initIndexTable(); - - }, - - /** - * i18n support - */ - TRANSLATIONS : {}, - PLURAL_EXPR : function(n) { return n == 1 ? 0 : 1; }, - LOCALE : 'unknown', - - // gettext and ngettext don't access this so that the functions - // can safely bound to a different name (_ = Documentation.gettext) - gettext : function(string) { - var translated = Documentation.TRANSLATIONS[string]; - if (typeof translated == 'undefined') - return string; - return (typeof translated == 'string') ? translated : translated[0]; - }, - - ngettext : function(singular, plural, n) { - var translated = Documentation.TRANSLATIONS[singular]; - if (typeof translated == 'undefined') - return (n == 1) ? singular : plural; - return translated[Documentation.PLURALEXPR(n)]; - }, - - addTranslations : function(catalog) { - for (var key in catalog.messages) - this.TRANSLATIONS[key] = catalog.messages[key]; - this.PLURAL_EXPR = new Function('n', 'return +(' + catalog.plural_expr + ')'); - this.LOCALE = catalog.locale; - }, - - /** - * add context elements like header anchor links - */ - addContextElements : function() { - $('div[id] > :header:first').each(function() { - $('\u00B6'). - attr('href', '#' + this.id). - attr('title', _('Permalink to this headline')). - appendTo(this); - }); - $('dt[id]').each(function() { - $('\u00B6'). - attr('href', '#' + this.id). - attr('title', _('Permalink to this definition')). - appendTo(this); - }); - }, - - /** - * workaround a firefox stupidity - * see: https://bugzilla.mozilla.org/show_bug.cgi?id=645075 - */ - fixFirefoxAnchorBug : function() { - if (document.location.hash) - window.setTimeout(function() { - document.location.href += ''; - }, 10); - }, - - /** - * highlight the search words provided in the url in the text - */ - highlightSearchWords : function() { - var params = $.getQueryParameters(); - var terms = (params.highlight) ? params.highlight[0].split(/\s+/) : []; - if (terms.length) { - var body = $('div.body'); - if (!body.length) { - body = $('body'); - } - window.setTimeout(function() { - $.each(terms, function() { - body.highlightText(this.toLowerCase(), 'highlighted'); - }); - }, 10); - $('') - .appendTo($('#searchbox')); - } - }, - - /** - * init the domain index toggle buttons - */ - initIndexTable : function() { - var togglers = $('img.toggler').click(function() { - var src = $(this).attr('src'); - var idnum = $(this).attr('id').substr(7); - $('tr.cg-' + idnum).toggle(); - if (src.substr(-9) == 'minus.png') - $(this).attr('src', src.substr(0, src.length-9) + 'plus.png'); - else - $(this).attr('src', src.substr(0, src.length-8) + 'minus.png'); - }).css('display', ''); - if (DOCUMENTATION_OPTIONS.COLLAPSE_INDEX) { - togglers.click(); - } - }, - - /** - * helper function to hide the search marks again - */ - hideSearchWords : function() { - $('#searchbox .highlight-link').fadeOut(300); - $('span.highlighted').removeClass('highlighted'); - }, - - /** - * make the url absolute - */ - makeURL : function(relativeURL) { - return DOCUMENTATION_OPTIONS.URL_ROOT + '/' + relativeURL; - }, - - /** - * get the current relative url - */ - getCurrentURL : function() { - var path = document.location.pathname; - var parts = path.split(/\//); - $.each(DOCUMENTATION_OPTIONS.URL_ROOT.split(/\//), function() { - if (this == '..') - parts.pop(); - }); - var url = parts.join('/'); - return path.substring(url.lastIndexOf('/') + 1, path.length - 1); - }, - - initOnKeyListeners: function() { - $(document).keyup(function(event) { - var activeElementType = document.activeElement.tagName; - // don't navigate when in search box or textarea - if (activeElementType !== 'TEXTAREA' && activeElementType !== 'INPUT' && activeElementType !== 'SELECT') { - switch (event.keyCode) { - case 37: // left - var prevHref = $('link[rel="prev"]').prop('href'); - if (prevHref) { - window.location.href = prevHref; - return false; - } - case 39: // right - var nextHref = $('link[rel="next"]').prop('href'); - if (nextHref) { - window.location.href = nextHref; - return false; - } - } - } - }); - } -}; - -// quick alias for translations -_ = Documentation.gettext; - -$(document).ready(function() { - Documentation.init(); -}); \ No newline at end of file diff --git a/doc/build/html/_static/down-pressed.png b/doc/build/html/_static/down-pressed.png deleted file mode 100644 index 5756c8cad..000000000 Binary files a/doc/build/html/_static/down-pressed.png and /dev/null differ diff --git a/doc/build/html/_static/down.png b/doc/build/html/_static/down.png deleted file mode 100644 index 1b3bdad2c..000000000 Binary files a/doc/build/html/_static/down.png and /dev/null differ diff --git a/doc/build/html/_static/file.png b/doc/build/html/_static/file.png deleted file mode 100644 index a858a410e..000000000 Binary files a/doc/build/html/_static/file.png and /dev/null differ diff --git a/doc/build/html/_static/jquery-3.1.0.js b/doc/build/html/_static/jquery-3.1.0.js deleted file mode 100644 index f2fc27478..000000000 --- a/doc/build/html/_static/jquery-3.1.0.js +++ /dev/null @@ -1,10074 +0,0 @@ -/*eslint-disable no-unused-vars*/ -/*! - * jQuery JavaScript Library v3.1.0 - * https://jquery.com/ - * - * Includes Sizzle.js - * https://sizzlejs.com/ - * - * Copyright jQuery Foundation and other contributors - * Released under the MIT license - * https://jquery.org/license - * - * Date: 2016-07-07T21:44Z - */ -( function( global, factory ) { - - "use strict"; - - if ( typeof module === "object" && typeof module.exports === "object" ) { - - // For CommonJS and CommonJS-like environments where a proper `window` - // is present, execute the factory and get jQuery. - // For environments that do not have a `window` with a `document` - // (such as Node.js), expose a factory as module.exports. - // This accentuates the need for the creation of a real `window`. - // e.g. var jQuery = require("jquery")(window); - // See ticket #14549 for more info. - module.exports = global.document ? - factory( global, true ) : - function( w ) { - if ( !w.document ) { - throw new Error( "jQuery requires a window with a document" ); - } - return factory( w ); - }; - } else { - factory( global ); - } - -// Pass this if window is not defined yet -} )( typeof window !== "undefined" ? window : this, function( window, noGlobal ) { - -// Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1 -// throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode -// arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common -// enough that all such attempts are guarded in a try block. -"use strict"; - -var arr = []; - -var document = window.document; - -var getProto = Object.getPrototypeOf; - -var slice = arr.slice; - -var concat = arr.concat; - -var push = arr.push; - -var indexOf = arr.indexOf; - -var class2type = {}; - -var toString = class2type.toString; - -var hasOwn = class2type.hasOwnProperty; - -var fnToString = hasOwn.toString; - -var ObjectFunctionString = fnToString.call( Object ); - -var support = {}; - - - - function DOMEval( code, doc ) { - doc = doc || document; - - var script = doc.createElement( "script" ); - - script.text = code; - doc.head.appendChild( script ).parentNode.removeChild( script ); - } -/* global Symbol */ -// Defining this global in .eslintrc would create a danger of using the global -// unguarded in another place, it seems safer to define global only for this module - - - -var - version = "3.1.0", - - // Define a local copy of jQuery - jQuery = function( selector, context ) { - - // The jQuery object is actually just the init constructor 'enhanced' - // Need init if jQuery is called (just allow error to be thrown if not included) - return new jQuery.fn.init( selector, context ); - }, - - // Support: Android <=4.0 only - // Make sure we trim BOM and NBSP - rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, - - // Matches dashed string for camelizing - rmsPrefix = /^-ms-/, - rdashAlpha = /-([a-z])/g, - - // Used by jQuery.camelCase as callback to replace() - fcamelCase = function( all, letter ) { - return letter.toUpperCase(); - }; - -jQuery.fn = jQuery.prototype = { - - // The current version of jQuery being used - jquery: version, - - constructor: jQuery, - - // The default length of a jQuery object is 0 - length: 0, - - toArray: function() { - return slice.call( this ); - }, - - // Get the Nth element in the matched element set OR - // Get the whole matched element set as a clean array - get: function( num ) { - return num != null ? - - // Return just the one element from the set - ( num < 0 ? this[ num + this.length ] : this[ num ] ) : - - // Return all the elements in a clean array - slice.call( this ); - }, - - // Take an array of elements and push it onto the stack - // (returning the new matched element set) - pushStack: function( elems ) { - - // Build a new jQuery matched element set - var ret = jQuery.merge( this.constructor(), elems ); - - // Add the old object onto the stack (as a reference) - ret.prevObject = this; - - // Return the newly-formed element set - return ret; - }, - - // Execute a callback for every element in the matched set. - each: function( callback ) { - return jQuery.each( this, callback ); - }, - - map: function( callback ) { - return this.pushStack( jQuery.map( this, function( elem, i ) { - return callback.call( elem, i, elem ); - } ) ); - }, - - slice: function() { - return this.pushStack( slice.apply( this, arguments ) ); - }, - - first: function() { - return this.eq( 0 ); - }, - - last: function() { - return this.eq( -1 ); - }, - - eq: function( i ) { - var len = this.length, - j = +i + ( i < 0 ? len : 0 ); - return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] ); - }, - - end: function() { - return this.prevObject || this.constructor(); - }, - - // For internal use only. - // Behaves like an Array's method, not like a jQuery method. - push: push, - sort: arr.sort, - splice: arr.splice -}; - -jQuery.extend = jQuery.fn.extend = function() { - var options, name, src, copy, copyIsArray, clone, - target = arguments[ 0 ] || {}, - i = 1, - length = arguments.length, - deep = false; - - // Handle a deep copy situation - if ( typeof target === "boolean" ) { - deep = target; - - // Skip the boolean and the target - target = arguments[ i ] || {}; - i++; - } - - // Handle case when target is a string or something (possible in deep copy) - if ( typeof target !== "object" && !jQuery.isFunction( target ) ) { - target = {}; - } - - // Extend jQuery itself if only one argument is passed - if ( i === length ) { - target = this; - i--; - } - - for ( ; i < length; i++ ) { - - // Only deal with non-null/undefined values - if ( ( options = arguments[ i ] ) != null ) { - - // Extend the base object - for ( name in options ) { - src = target[ name ]; - copy = options[ name ]; - - // Prevent never-ending loop - if ( target === copy ) { - continue; - } - - // Recurse if we're merging plain objects or arrays - if ( deep && copy && ( jQuery.isPlainObject( copy ) || - ( copyIsArray = jQuery.isArray( copy ) ) ) ) { - - if ( copyIsArray ) { - copyIsArray = false; - clone = src && jQuery.isArray( src ) ? src : []; - - } else { - clone = src && jQuery.isPlainObject( src ) ? src : {}; - } - - // Never move original objects, clone them - target[ name ] = jQuery.extend( deep, clone, copy ); - - // Don't bring in undefined values - } else if ( copy !== undefined ) { - target[ name ] = copy; - } - } - } - } - - // Return the modified object - return target; -}; - -jQuery.extend( { - - // Unique for each copy of jQuery on the page - expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ), - - // Assume jQuery is ready without the ready module - isReady: true, - - error: function( msg ) { - throw new Error( msg ); - }, - - noop: function() {}, - - isFunction: function( obj ) { - return jQuery.type( obj ) === "function"; - }, - - isArray: Array.isArray, - - isWindow: function( obj ) { - return obj != null && obj === obj.window; - }, - - isNumeric: function( obj ) { - - // As of jQuery 3.0, isNumeric is limited to - // strings and numbers (primitives or objects) - // that can be coerced to finite numbers (gh-2662) - var type = jQuery.type( obj ); - return ( type === "number" || type === "string" ) && - - // parseFloat NaNs numeric-cast false positives ("") - // ...but misinterprets leading-number strings, particularly hex literals ("0x...") - // subtraction forces infinities to NaN - !isNaN( obj - parseFloat( obj ) ); - }, - - isPlainObject: function( obj ) { - var proto, Ctor; - - // Detect obvious negatives - // Use toString instead of jQuery.type to catch host objects - if ( !obj || toString.call( obj ) !== "[object Object]" ) { - return false; - } - - proto = getProto( obj ); - - // Objects with no prototype (e.g., `Object.create( null )`) are plain - if ( !proto ) { - return true; - } - - // Objects with prototype are plain iff they were constructed by a global Object function - Ctor = hasOwn.call( proto, "constructor" ) && proto.constructor; - return typeof Ctor === "function" && fnToString.call( Ctor ) === ObjectFunctionString; - }, - - isEmptyObject: function( obj ) { - - /* eslint-disable no-unused-vars */ - // See https://github.com/eslint/eslint/issues/6125 - var name; - - for ( name in obj ) { - return false; - } - return true; - }, - - type: function( obj ) { - if ( obj == null ) { - return obj + ""; - } - - // Support: Android <=2.3 only (functionish RegExp) - return typeof obj === "object" || typeof obj === "function" ? - class2type[ toString.call( obj ) ] || "object" : - typeof obj; - }, - - // Evaluates a script in a global context - globalEval: function( code ) { - DOMEval( code ); - }, - - // Convert dashed to camelCase; used by the css and data modules - // Support: IE <=9 - 11, Edge 12 - 13 - // Microsoft forgot to hump their vendor prefix (#9572) - camelCase: function( string ) { - return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); - }, - - nodeName: function( elem, name ) { - return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); - }, - - each: function( obj, callback ) { - var length, i = 0; - - if ( isArrayLike( obj ) ) { - length = obj.length; - for ( ; i < length; i++ ) { - if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { - break; - } - } - } else { - for ( i in obj ) { - if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { - break; - } - } - } - - return obj; - }, - - // Support: Android <=4.0 only - trim: function( text ) { - return text == null ? - "" : - ( text + "" ).replace( rtrim, "" ); - }, - - // results is for internal usage only - makeArray: function( arr, results ) { - var ret = results || []; - - if ( arr != null ) { - if ( isArrayLike( Object( arr ) ) ) { - jQuery.merge( ret, - typeof arr === "string" ? - [ arr ] : arr - ); - } else { - push.call( ret, arr ); - } - } - - return ret; - }, - - inArray: function( elem, arr, i ) { - return arr == null ? -1 : indexOf.call( arr, elem, i ); - }, - - // Support: Android <=4.0 only, PhantomJS 1 only - // push.apply(_, arraylike) throws on ancient WebKit - merge: function( first, second ) { - var len = +second.length, - j = 0, - i = first.length; - - for ( ; j < len; j++ ) { - first[ i++ ] = second[ j ]; - } - - first.length = i; - - return first; - }, - - grep: function( elems, callback, invert ) { - var callbackInverse, - matches = [], - i = 0, - length = elems.length, - callbackExpect = !invert; - - // Go through the array, only saving the items - // that pass the validator function - for ( ; i < length; i++ ) { - callbackInverse = !callback( elems[ i ], i ); - if ( callbackInverse !== callbackExpect ) { - matches.push( elems[ i ] ); - } - } - - return matches; - }, - - // arg is for internal usage only - map: function( elems, callback, arg ) { - var length, value, - i = 0, - ret = []; - - // Go through the array, translating each of the items to their new values - if ( isArrayLike( elems ) ) { - length = elems.length; - for ( ; i < length; i++ ) { - value = callback( elems[ i ], i, arg ); - - if ( value != null ) { - ret.push( value ); - } - } - - // Go through every key on the object, - } else { - for ( i in elems ) { - value = callback( elems[ i ], i, arg ); - - if ( value != null ) { - ret.push( value ); - } - } - } - - // Flatten any nested arrays - return concat.apply( [], ret ); - }, - - // A global GUID counter for objects - guid: 1, - - // Bind a function to a context, optionally partially applying any - // arguments. - proxy: function( fn, context ) { - var tmp, args, proxy; - - if ( typeof context === "string" ) { - tmp = fn[ context ]; - context = fn; - fn = tmp; - } - - // Quick check to determine if target is callable, in the spec - // this throws a TypeError, but we will just return undefined. - if ( !jQuery.isFunction( fn ) ) { - return undefined; - } - - // Simulated bind - args = slice.call( arguments, 2 ); - proxy = function() { - return fn.apply( context || this, args.concat( slice.call( arguments ) ) ); - }; - - // Set the guid of unique handler to the same of original handler, so it can be removed - proxy.guid = fn.guid = fn.guid || jQuery.guid++; - - return proxy; - }, - - now: Date.now, - - // jQuery.support is not used in Core but other projects attach their - // properties to it so it needs to exist. - support: support -} ); - -if ( typeof Symbol === "function" ) { - jQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ]; -} - -// Populate the class2type map -jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ), -function( i, name ) { - class2type[ "[object " + name + "]" ] = name.toLowerCase(); -} ); - -function isArrayLike( obj ) { - - // Support: real iOS 8.2 only (not reproducible in simulator) - // `in` check used to prevent JIT error (gh-2145) - // hasOwn isn't used here due to false negatives - // regarding Nodelist length in IE - var length = !!obj && "length" in obj && obj.length, - type = jQuery.type( obj ); - - if ( type === "function" || jQuery.isWindow( obj ) ) { - return false; - } - - return type === "array" || length === 0 || - typeof length === "number" && length > 0 && ( length - 1 ) in obj; -} -var Sizzle = -/*! - * Sizzle CSS Selector Engine v2.3.0 - * https://sizzlejs.com/ - * - * Copyright jQuery Foundation and other contributors - * Released under the MIT license - * http://jquery.org/license - * - * Date: 2016-01-04 - */ -(function( window ) { - -var i, - support, - Expr, - getText, - isXML, - tokenize, - compile, - select, - outermostContext, - sortInput, - hasDuplicate, - - // Local document vars - setDocument, - document, - docElem, - documentIsHTML, - rbuggyQSA, - rbuggyMatches, - matches, - contains, - - // Instance-specific data - expando = "sizzle" + 1 * new Date(), - preferredDoc = window.document, - dirruns = 0, - done = 0, - classCache = createCache(), - tokenCache = createCache(), - compilerCache = createCache(), - sortOrder = function( a, b ) { - if ( a === b ) { - hasDuplicate = true; - } - return 0; - }, - - // Instance methods - hasOwn = ({}).hasOwnProperty, - arr = [], - pop = arr.pop, - push_native = arr.push, - push = arr.push, - slice = arr.slice, - // Use a stripped-down indexOf as it's faster than native - // https://jsperf.com/thor-indexof-vs-for/5 - indexOf = function( list, elem ) { - var i = 0, - len = list.length; - for ( ; i < len; i++ ) { - if ( list[i] === elem ) { - return i; - } - } - return -1; - }, - - booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped", - - // Regular expressions - - // http://www.w3.org/TR/css3-selectors/#whitespace - whitespace = "[\\x20\\t\\r\\n\\f]", - - // http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier - identifier = "(?:\\\\.|[\\w-]|[^\0-\\xa0])+", - - // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors - attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace + - // Operator (capture 2) - "*([*^$|!~]?=)" + whitespace + - // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]" - "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace + - "*\\]", - - pseudos = ":(" + identifier + ")(?:\\((" + - // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments: - // 1. quoted (capture 3; capture 4 or capture 5) - "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" + - // 2. simple (capture 6) - "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" + - // 3. anything else (capture 2) - ".*" + - ")\\)|)", - - // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter - rwhitespace = new RegExp( whitespace + "+", "g" ), - rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ), - - rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), - rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ), - - rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g" ), - - rpseudo = new RegExp( pseudos ), - ridentifier = new RegExp( "^" + identifier + "$" ), - - matchExpr = { - "ID": new RegExp( "^#(" + identifier + ")" ), - "CLASS": new RegExp( "^\\.(" + identifier + ")" ), - "TAG": new RegExp( "^(" + identifier + "|[*])" ), - "ATTR": new RegExp( "^" + attributes ), - "PSEUDO": new RegExp( "^" + pseudos ), - "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace + - "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace + - "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), - "bool": new RegExp( "^(?:" + booleans + ")$", "i" ), - // For use in libraries implementing .is() - // We use this for POS matching in `select` - "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + - whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) - }, - - rinputs = /^(?:input|select|textarea|button)$/i, - rheader = /^h\d$/i, - - rnative = /^[^{]+\{\s*\[native \w/, - - // Easily-parseable/retrievable ID or TAG or CLASS selectors - rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, - - rsibling = /[+~]/, - - // CSS escapes - // http://www.w3.org/TR/CSS21/syndata.html#escaped-characters - runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ), - funescape = function( _, escaped, escapedWhitespace ) { - var high = "0x" + escaped - 0x10000; - // NaN means non-codepoint - // Support: Firefox<24 - // Workaround erroneous numeric interpretation of +"0x" - return high !== high || escapedWhitespace ? - escaped : - high < 0 ? - // BMP codepoint - String.fromCharCode( high + 0x10000 ) : - // Supplemental Plane codepoint (surrogate pair) - String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); - }, - - // CSS string/identifier serialization - // https://drafts.csswg.org/cssom/#common-serializing-idioms - rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g, - fcssescape = function( ch, asCodePoint ) { - if ( asCodePoint ) { - - // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER - if ( ch === "\0" ) { - return "\uFFFD"; - } - - // Control characters and (dependent upon position) numbers get escaped as code points - return ch.slice( 0, -1 ) + "\\" + ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " "; - } - - // Other potentially-special ASCII characters get backslash-escaped - return "\\" + ch; - }, - - // Used for iframes - // See setDocument() - // Removing the function wrapper causes a "Permission Denied" - // error in IE - unloadHandler = function() { - setDocument(); - }, - - disabledAncestor = addCombinator( - function( elem ) { - return elem.disabled === true; - }, - { dir: "parentNode", next: "legend" } - ); - -// Optimize for push.apply( _, NodeList ) -try { - push.apply( - (arr = slice.call( preferredDoc.childNodes )), - preferredDoc.childNodes - ); - // Support: Android<4.0 - // Detect silently failing push.apply - arr[ preferredDoc.childNodes.length ].nodeType; -} catch ( e ) { - push = { apply: arr.length ? - - // Leverage slice if possible - function( target, els ) { - push_native.apply( target, slice.call(els) ); - } : - - // Support: IE<9 - // Otherwise append directly - function( target, els ) { - var j = target.length, - i = 0; - // Can't trust NodeList.length - while ( (target[j++] = els[i++]) ) {} - target.length = j - 1; - } - }; -} - -function Sizzle( selector, context, results, seed ) { - var m, i, elem, nid, match, groups, newSelector, - newContext = context && context.ownerDocument, - - // nodeType defaults to 9, since context defaults to document - nodeType = context ? context.nodeType : 9; - - results = results || []; - - // Return early from calls with invalid selector or context - if ( typeof selector !== "string" || !selector || - nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) { - - return results; - } - - // Try to shortcut find operations (as opposed to filters) in HTML documents - if ( !seed ) { - - if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) { - setDocument( context ); - } - context = context || document; - - if ( documentIsHTML ) { - - // If the selector is sufficiently simple, try using a "get*By*" DOM method - // (excepting DocumentFragment context, where the methods don't exist) - if ( nodeType !== 11 && (match = rquickExpr.exec( selector )) ) { - - // ID selector - if ( (m = match[1]) ) { - - // Document context - if ( nodeType === 9 ) { - if ( (elem = context.getElementById( m )) ) { - - // Support: IE, Opera, Webkit - // TODO: identify versions - // getElementById can match elements by name instead of ID - if ( elem.id === m ) { - results.push( elem ); - return results; - } - } else { - return results; - } - - // Element context - } else { - - // Support: IE, Opera, Webkit - // TODO: identify versions - // getElementById can match elements by name instead of ID - if ( newContext && (elem = newContext.getElementById( m )) && - contains( context, elem ) && - elem.id === m ) { - - results.push( elem ); - return results; - } - } - - // Type selector - } else if ( match[2] ) { - push.apply( results, context.getElementsByTagName( selector ) ); - return results; - - // Class selector - } else if ( (m = match[3]) && support.getElementsByClassName && - context.getElementsByClassName ) { - - push.apply( results, context.getElementsByClassName( m ) ); - return results; - } - } - - // Take advantage of querySelectorAll - if ( support.qsa && - !compilerCache[ selector + " " ] && - (!rbuggyQSA || !rbuggyQSA.test( selector )) ) { - - if ( nodeType !== 1 ) { - newContext = context; - newSelector = selector; - - // qSA looks outside Element context, which is not what we want - // Thanks to Andrew Dupont for this workaround technique - // Support: IE <=8 - // Exclude object elements - } else if ( context.nodeName.toLowerCase() !== "object" ) { - - // Capture the context ID, setting it first if necessary - if ( (nid = context.getAttribute( "id" )) ) { - nid = nid.replace( rcssescape, fcssescape ); - } else { - context.setAttribute( "id", (nid = expando) ); - } - - // Prefix every selector in the list - groups = tokenize( selector ); - i = groups.length; - while ( i-- ) { - groups[i] = "#" + nid + " " + toSelector( groups[i] ); - } - newSelector = groups.join( "," ); - - // Expand context for sibling selectors - newContext = rsibling.test( selector ) && testContext( context.parentNode ) || - context; - } - - if ( newSelector ) { - try { - push.apply( results, - newContext.querySelectorAll( newSelector ) - ); - return results; - } catch ( qsaError ) { - } finally { - if ( nid === expando ) { - context.removeAttribute( "id" ); - } - } - } - } - } - } - - // All others - return select( selector.replace( rtrim, "$1" ), context, results, seed ); -} - -/** - * Create key-value caches of limited size - * @returns {function(string, object)} Returns the Object data after storing it on itself with - * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) - * deleting the oldest entry - */ -function createCache() { - var keys = []; - - function cache( key, value ) { - // Use (key + " ") to avoid collision with native prototype properties (see Issue #157) - if ( keys.push( key + " " ) > Expr.cacheLength ) { - // Only keep the most recent entries - delete cache[ keys.shift() ]; - } - return (cache[ key + " " ] = value); - } - return cache; -} - -/** - * Mark a function for special use by Sizzle - * @param {Function} fn The function to mark - */ -function markFunction( fn ) { - fn[ expando ] = true; - return fn; -} - -/** - * Support testing using an element - * @param {Function} fn Passed the created element and returns a boolean result - */ -function assert( fn ) { - var el = document.createElement("fieldset"); - - try { - return !!fn( el ); - } catch (e) { - return false; - } finally { - // Remove from its parent by default - if ( el.parentNode ) { - el.parentNode.removeChild( el ); - } - // release memory in IE - el = null; - } -} - -/** - * Adds the same handler for all of the specified attrs - * @param {String} attrs Pipe-separated list of attributes - * @param {Function} handler The method that will be applied - */ -function addHandle( attrs, handler ) { - var arr = attrs.split("|"), - i = arr.length; - - while ( i-- ) { - Expr.attrHandle[ arr[i] ] = handler; - } -} - -/** - * Checks document order of two siblings - * @param {Element} a - * @param {Element} b - * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b - */ -function siblingCheck( a, b ) { - var cur = b && a, - diff = cur && a.nodeType === 1 && b.nodeType === 1 && - a.sourceIndex - b.sourceIndex; - - // Use IE sourceIndex if available on both nodes - if ( diff ) { - return diff; - } - - // Check if b follows a - if ( cur ) { - while ( (cur = cur.nextSibling) ) { - if ( cur === b ) { - return -1; - } - } - } - - return a ? 1 : -1; -} - -/** - * Returns a function to use in pseudos for input types - * @param {String} type - */ -function createInputPseudo( type ) { - return function( elem ) { - var name = elem.nodeName.toLowerCase(); - return name === "input" && elem.type === type; - }; -} - -/** - * Returns a function to use in pseudos for buttons - * @param {String} type - */ -function createButtonPseudo( type ) { - return function( elem ) { - var name = elem.nodeName.toLowerCase(); - return (name === "input" || name === "button") && elem.type === type; - }; -} - -/** - * Returns a function to use in pseudos for :enabled/:disabled - * @param {Boolean} disabled true for :disabled; false for :enabled - */ -function createDisabledPseudo( disabled ) { - // Known :disabled false positives: - // IE: *[disabled]:not(button, input, select, textarea, optgroup, option, menuitem, fieldset) - // not IE: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable - return function( elem ) { - - // Check form elements and option elements for explicit disabling - return "label" in elem && elem.disabled === disabled || - "form" in elem && elem.disabled === disabled || - - // Check non-disabled form elements for fieldset[disabled] ancestors - "form" in elem && elem.disabled === false && ( - // Support: IE6-11+ - // Ancestry is covered for us - elem.isDisabled === disabled || - - // Otherwise, assume any non-