mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-19 15:54:09 +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
|
||||
^^^^^^^^^^^
|
||||
|
||||
Reference in New Issue
Block a user