mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-21 00:32:51 +02:00
Updated documentation
This commit is contained in:
+22
-8
@@ -285,6 +285,18 @@ joinBladeburnerFaction
|
||||
|
||||
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
|
||||
--------
|
||||
|
||||
@@ -327,11 +339,13 @@ identifier by attaching the Bladeburner API functions to an object::
|
||||
|
||||
this.fieldAnalysis = {
|
||||
inProgress: params.startFieldAnalysis ? true : false,
|
||||
cyclesRemaining: FIELD_ANALYSIS_DURATION,
|
||||
cyclesSince: FIELD_ANALYSIS_INTERVAL
|
||||
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]);
|
||||
@@ -360,7 +374,7 @@ identifier by attaching the Bladeburner API functions to an object::
|
||||
this.startAction("general", "Field Analysis");
|
||||
this.ns.print("handler is doing field analyis for " +
|
||||
(this.fieldAnalysis.cyclesRemaining+1) + " more mins");
|
||||
return;
|
||||
return 31; //Field Analysis Time + 1
|
||||
}
|
||||
} else {
|
||||
++(this.fieldAnalysis.cyclesSince);
|
||||
@@ -377,10 +391,12 @@ identifier by attaching the Bladeburner API functions to an object::
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -423,12 +439,10 @@ identifier by attaching the Bladeburner API functions to an object::
|
||||
|
||||
|
||||
BladeburnerHandler.prototype.process = async function() {
|
||||
this.handle();
|
||||
await this.ns.sleep(60000);
|
||||
}
|
||||
await this.ns.sleep(this.handle() * 1000);
|
||||
}
|
||||
|
||||
export async function main(ns) {
|
||||
ns.disableLog("sleep");
|
||||
export async function main(ns) {
|
||||
//Check if Bladeburner is available. This'll throw a runtime error if it's not
|
||||
ns.bladeburner.getContractNames();
|
||||
|
||||
|
||||
+2
-1
@@ -846,7 +846,8 @@ getScriptRam
|
||||
: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 the amount of RAM required to run the specified script on the target server. Returns
|
||||
0 if the script does not exist.
|
||||
|
||||
getHackTime
|
||||
^^^^^^^^^^^
|
||||
|
||||
Vendored
+3
-1
@@ -311,10 +311,12 @@
|
||||
<h2 id="J">J</h2>
|
||||
<table style="width: 100%" class="indextable genindextable"><tr>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="netscriptbladeburnerapi.html#joinBladeburnerFaction">joinBladeburnerFaction() (built-in function)</a>
|
||||
<li><a href="netscriptbladeburnerapi.html#joinBladeburnerDivision">joinBladeburnerDivision() (built-in function)</a>
|
||||
</li>
|
||||
</ul></td>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="netscriptbladeburnerapi.html#joinBladeburnerFaction">joinBladeburnerFaction() (built-in function)</a>
|
||||
</li>
|
||||
<li><a href="netscriptsingularityfunctions.html#joinFaction">joinFaction() (built-in function)</a>
|
||||
</li>
|
||||
</ul></td>
|
||||
|
||||
Vendored
+1
@@ -235,6 +235,7 @@ secrets that you've been searching for.</p>
|
||||
<li class="toctree-l3"><a class="reference internal" href="netscriptbladeburnerapi.html#switchcity">switchCity</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="netscriptbladeburnerapi.html#getstamina">getStamina</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="netscriptbladeburnerapi.html#joinbladeburnerfaction">joinBladeburnerFaction</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="netscriptbladeburnerapi.html#joinbladeburnerdivision">joinBladeburnerDivision</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="netscriptbladeburnerapi.html#examples">Examples</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
Vendored
+1
@@ -236,6 +236,7 @@ to reach out to the developer!</p>
|
||||
<li class="toctree-l2"><a class="reference internal" href="netscriptbladeburnerapi.html#switchcity">switchCity</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="netscriptbladeburnerapi.html#getstamina">getStamina</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="netscriptbladeburnerapi.html#joinbladeburnerfaction">joinBladeburnerFaction</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="netscriptbladeburnerapi.html#joinbladeburnerdivision">joinBladeburnerDivision</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="netscriptbladeburnerapi.html#examples">Examples</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
+23
-8
@@ -483,6 +483,18 @@ you are already a member.</p>
|
||||
<p>Returns false otherwise.</p>
|
||||
</dd></dl>
|
||||
|
||||
</div>
|
||||
<div class="section" id="joinbladeburnerdivision">
|
||||
<h2>joinBladeburnerDivision<a class="headerlink" href="#joinbladeburnerdivision" title="Permalink to this headline">¶</a></h2>
|
||||
<dl class="function">
|
||||
<dt id="joinBladeburnerDivision">
|
||||
<code class="descname">joinBladeburnerDivision</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#joinBladeburnerDivision" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Attempts to join the Bladeburner division.</p>
|
||||
<p>Returns true if you successfully join the Bladeburner division, or if you
|
||||
are already a member.</p>
|
||||
<p>Returns false otherwise</p>
|
||||
</dd></dl>
|
||||
|
||||
</div>
|
||||
<div class="section" id="examples">
|
||||
<h2>Examples<a class="headerlink" href="#examples" title="Permalink to this headline">¶</a></h2>
|
||||
@@ -524,11 +536,13 @@ function BladeburnerHandler(ns, params) {
|
||||
|
||||
this.fieldAnalysis = {
|
||||
inProgress: params.startFieldAnalysis ? true : false,
|
||||
cyclesRemaining: FIELD_ANALYSIS_DURATION,
|
||||
cyclesSince: FIELD_ANALYSIS_INTERVAL
|
||||
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]);
|
||||
@@ -557,7 +571,7 @@ BladeburnerHandler.prototype.handle = function() {
|
||||
this.startAction("general", "Field Analysis");
|
||||
this.ns.print("handler is doing field analyis for " +
|
||||
(this.fieldAnalysis.cyclesRemaining+1) + " more mins");
|
||||
return;
|
||||
return 31; //Field Analysis Time + 1
|
||||
}
|
||||
} else {
|
||||
++(this.fieldAnalysis.cyclesSince);
|
||||
@@ -574,10 +588,12 @@ BladeburnerHandler.prototype.handle = function() {
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -620,12 +636,10 @@ BladeburnerHandler.prototype.chooseAction = function() {
|
||||
|
||||
|
||||
BladeburnerHandler.prototype.process = async function() {
|
||||
this.handle();
|
||||
await this.ns.sleep(60000);
|
||||
}
|
||||
await this.ns.sleep(this.handle() * 1000);
|
||||
}
|
||||
|
||||
export async function main(ns) {
|
||||
ns.disableLog("sleep");
|
||||
export async function main(ns) {
|
||||
//Check if Bladeburner is available. This'll throw a runtime error if it's not
|
||||
ns.bladeburner.getContractNames();
|
||||
|
||||
@@ -690,6 +704,7 @@ BladeburnerHandler.prototype.process = async function() {
|
||||
<li class="toctree-l3"><a class="reference internal" href="#switchcity">switchCity</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="#getstamina">getStamina</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="#joinbladeburnerfaction">joinBladeburnerFaction</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="#joinbladeburnerdivision">joinBladeburnerDivision</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="#examples">Examples</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
+2
-1
@@ -1402,7 +1402,8 @@ true if one or more scripts were successfully killed, and false if none were.</p
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p>Returns the amount of RAM required to run the specified script on the target server</p>
|
||||
<p>Returns the amount of RAM required to run the specified script on the target server. Returns
|
||||
0 if the script does not exist.</p>
|
||||
</dd></dl>
|
||||
|
||||
</div>
|
||||
|
||||
+3
@@ -275,6 +275,7 @@ Nodes to a level of at least 75, RAM to at least 8GB, and number of cores to at
|
||||
<p class="caption"><span class="caption-text">Contents:</span></p>
|
||||
<ul class="current">
|
||||
<li class="toctree-l1 current"><a class="reference internal" href="netscript.html"> Netscript</a><ul class="current">
|
||||
<li class="toctree-l2"><a class="reference internal" href="netscriptjs.html"> NetscriptJS (Netscript 2.0)</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="netscriptdatatypes.html"> Data Types and Variables</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="netscriptoperators.html"> Operators</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="netscriptloopsandconditionals.html"> Loops and Conditionals</a></li>
|
||||
@@ -292,11 +293,13 @@ Nodes to a level of at least 75, RAM to at least 8GB, and number of cores to at
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="netscriptixapi.html"> Trade Information eXchange (TIX) API</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="netscriptsingularityfunctions.html"> Singularity Functions</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="netscriptbladeburnerapi.html"> Bladeburner API</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="netscriptmisc.html"> Miscellaneous</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="terminal.html"> Terminal</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="shortcuts.html"> Keyboard Shortcuts</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="changelog.html"> Changelog</a></li>
|
||||
</ul>
|
||||
|
||||
<div role="search">
|
||||
|
||||
Vendored
+1
@@ -273,6 +273,7 @@ NetscriptJS and report any serious exploits.</p>
|
||||
<li class="toctree-l2"><a class="reference internal" href="netscripthacknetnodeapi.html"> Hacknet Node API</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="netscriptixapi.html"> Trade Information eXchange (TIX) API</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="netscriptsingularityfunctions.html"> Singularity Functions</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="netscriptbladeburnerapi.html"> Bladeburner API</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="netscriptmisc.html"> Miscellaneous</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
+7
-3
@@ -24,7 +24,7 @@
|
||||
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
|
||||
<link rel="index" title="Index" href="genindex.html" />
|
||||
<link rel="search" title="Search" href="search.html" />
|
||||
<link rel="next" title="Netscript Miscellaneous" href="netscriptmisc.html" />
|
||||
<link rel="next" title="Netscript Bladeburner API" href="netscriptbladeburnerapi.html" />
|
||||
<link rel="prev" title="Netscript Trade Information eXchange (TIX) API" href="netscriptixapi.html" />
|
||||
</head>
|
||||
<body>
|
||||
@@ -35,7 +35,7 @@
|
||||
<div class="rel" role="navigation" aria-label="related navigation">
|
||||
<a href="netscriptixapi.html" title="Netscript Trade Information eXchange (TIX) API"
|
||||
accesskey="P">previous</a> |
|
||||
<a href="netscriptmisc.html" title="Netscript Miscellaneous"
|
||||
<a href="netscriptbladeburnerapi.html" title="Netscript Bladeburner API"
|
||||
accesskey="N">next</a> |
|
||||
<a href="genindex.html" title="General Index"
|
||||
accesskey="I">index</a>
|
||||
@@ -779,6 +779,7 @@ This script will be run with no arguments and 1 thread. It must be located on yo
|
||||
<p class="caption"><span class="caption-text">Contents:</span></p>
|
||||
<ul class="current">
|
||||
<li class="toctree-l1 current"><a class="reference internal" href="netscript.html"> Netscript</a><ul class="current">
|
||||
<li class="toctree-l2"><a class="reference internal" href="netscriptjs.html"> NetscriptJS (Netscript 2.0)</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="netscriptdatatypes.html"> Data Types and Variables</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="netscriptoperators.html"> Operators</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="netscriptloopsandconditionals.html"> Loops and Conditionals</a></li>
|
||||
@@ -818,10 +819,13 @@ This script will be run with no arguments and 1 thread. It must be located on yo
|
||||
<li class="toctree-l3"><a class="reference internal" href="#installaugmentations">installAugmentations</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="netscriptbladeburnerapi.html"> Bladeburner API</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="netscriptmisc.html"> Miscellaneous</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="terminal.html"> Terminal</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="shortcuts.html"> Keyboard Shortcuts</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="changelog.html"> Changelog</a></li>
|
||||
</ul>
|
||||
|
||||
<div role="search">
|
||||
@@ -844,7 +848,7 @@ This script will be run with no arguments and 1 thread. It must be located on yo
|
||||
<div role="navigation" aria-label="related navigaton">
|
||||
<a href="netscriptixapi.html" title="Netscript Trade Information eXchange (TIX) API"
|
||||
>previous</a> |
|
||||
<a href="netscriptmisc.html" title="Netscript Miscellaneous"
|
||||
<a href="netscriptbladeburnerapi.html" title="Netscript Bladeburner API"
|
||||
>next</a> |
|
||||
<a href="genindex.html" title="General Index"
|
||||
>index</a>
|
||||
|
||||
Vendored
BIN
Binary file not shown.
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+6
@@ -24,6 +24,7 @@
|
||||
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
|
||||
<link rel="index" title="Index" href="genindex.html" />
|
||||
<link rel="search" title="Search" href="search.html" />
|
||||
<link rel="next" title="Changelog" href="changelog.html" />
|
||||
<link rel="prev" title="Terminal" href="terminal.html" />
|
||||
</head>
|
||||
<body>
|
||||
@@ -34,6 +35,8 @@
|
||||
<div class="rel" role="navigation" aria-label="related navigation">
|
||||
<a href="terminal.html" title="Terminal"
|
||||
accesskey="P">previous</a> |
|
||||
<a href="changelog.html" title="Changelog"
|
||||
accesskey="N">next</a> |
|
||||
<a href="genindex.html" title="General Index"
|
||||
accesskey="I">index</a>
|
||||
</div>
|
||||
@@ -268,6 +271,7 @@ as well as your browser's shortcuts</strong></p>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#misc-shortcuts">Misc Shortcuts</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="changelog.html"> Changelog</a></li>
|
||||
</ul>
|
||||
|
||||
<div role="search">
|
||||
@@ -290,6 +294,8 @@ as well as your browser's shortcuts</strong></p>
|
||||
<div role="navigation" aria-label="related navigaton">
|
||||
<a href="terminal.html" title="Terminal"
|
||||
>previous</a> |
|
||||
<a href="changelog.html" title="Changelog"
|
||||
>next</a> |
|
||||
<a href="genindex.html" title="General Index"
|
||||
>index</a>
|
||||
</div>
|
||||
|
||||
Vendored
+1
@@ -469,6 +469,7 @@ thread count and how much RAM they are using in total.</p>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="shortcuts.html"> Keyboard Shortcuts</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="changelog.html"> Changelog</a></li>
|
||||
</ul>
|
||||
|
||||
<div role="search">
|
||||
|
||||
Reference in New Issue
Block a user