mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-18 07:18:38 +02:00
Updated documentation
This commit is contained in:
31
doc/build/html/netscriptbladeburnerapi.html
vendored
31
doc/build/html/netscriptbladeburnerapi.html
vendored
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user