Get whether an action is set to autolevel.
Type of action.
Name of action. Must be an exact match.
True if the action is set to autolevel, and false otherwise.
RAM cost: 4 GB
Return a boolean indicating whether or not this action is currently set to autolevel.
Returns false if an invalid action is specified.
Get action count remaining.
Type of action.
Name of action. Must be an exact match.
Remaining count of the specified action.
RAM cost: 4 GB
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. This function will return 1 for BlackOps not yet completed regardless of whether the player has the required rank to attempt the mission or not.
Get the current level of an action.
Type of action.
Name of action. Must be an exact match.
Current level of the specified action.
RAM cost: 4 GB
Returns the current level of this action.
Returns -1 if an invalid action is specified.
Get estimate success chance of an action.
Type of action.
Name of action. Must be an exact match.
Estimated success chance for the specified action.
RAM cost: 4 GB
Returns the estimated success chance for the specified action. This chance is returned as a decimal value, NOT a percentage (e.g. if you have an estimated success chance of 80%, then this function will return 0.80, NOT 80). Returns 2 values, value[0] - MIN Chance, value[1] - MAX Chance
Get the maximum level of an action.
Type of action.
Name of action. Must be an exact match.
Maximum level of the specified action.
RAM cost: 4 GB
Returns the maximum level for this action.
Returns -1 if an invalid action is specified.
Get the reputation gain of an action.
Type of action.
Name of action. Must be an exact match.
Optional number. Action level at which to calculate the gain. Will be the action's current level if not given.
Average Bladeburner reputation gain for successfully completing the specified action.
RAM cost: 4 GB
Returns the average Bladeburner reputation gain for successfully completing the specified action. Note that this value is an ‘average’ and the real reputation gain may vary slightly from this value.
Get action successes.
Type of action.
Name of action. Must be an exact match.
a number with how many successes you have with action.
RAM cost: 4 GB
Return a number with how many successes you have with action.
Get the time to complete an action.
Type of action.
Name of action. Must be an exact match.
Number of milliseconds it takes to complete the specified action.
RAM cost: 4 GB
Returns the number of milliseconds it takes to complete the specified action
Get Bladeburner bonus time.
Amount of accumulated “bonus time” (milliseconds) for the Bladeburner mechanic.
RAM cost: 0 GB
Returns the amount of accumulated “bonus time” (milliseconds) for the Bladeburner mechanic.
“Bonus time” is accumulated when the game is offline or if the game is inactive in the browser.
“Bonus time” makes the game progress faster, up to 5x the normal speed. For example, if an action takes 30 seconds to complete, but you’ve accumulated over 30 seconds in bonus time, then the action will only take 6 seconds in real life to complete.
Get chaos of a city.
Name of city. Case-sensitive
Chaos in the specified city.
RAM cost: 4 GB
Returns the chaos in the specified city, or -1 if an invalid city was specified.
Get number of communities in a city.
Name of city. Case-sensitive
Number of Synthoids communities in the specified city.
RAM cost: 4 GB
Returns the estimated number of Synthoid communities in the specified city, or -1 if an invalid city was specified.
Get estimated population in city.
Name of city. Case-sensitive
Estimated number of Synthoids in the specified city.
RAM cost: 4 GB
Returns the estimated number of Synthoids in the specified city, or -1 if an invalid city was specified.
Get current action.
Object that represents the player’s current Bladeburner action, or null if no action is being performed.
RAM cost: 1 GB
Get an object with the name and rank requirement of the next BlackOp that can be completed.
An object with the .name and .rank properties of the available BlackOp, or null.
RAM cost: 2 GB
Returns the name and rank requirement for the available BlackOp.
Returns null if no BlackOps remain in the BitNode.
Get skill level.
Name of skill. Case-sensitive and must be an exact match.
Level in the specified skill.
RAM cost: 4 GB
This function returns your level in the specified skill.
The function returns -1 if an invalid skill name is passed in.
Get cost to upgrade skill.
Name of skill. Case-sensitive and must be an exact match.
Optional count: numberNumber of times to upgrade the skill. Defaults to 1 if not specified.
Number of skill points needed to upgrade the specified skill.
RAM cost: 4 GB
This function returns the number of skill points needed to upgrade the specified skill the specified number of times.
The function returns -1 if an invalid skill name is passed in, and Infinity if the count overflows the maximum level.
Get Bladeburner stamina.
Array containing current stamina and max stamina.
RAM cost: 4 GB Returns an array with two elements:
function getStaminaPercentage() {
const [current, max] = ns.bladeburner.getStamina();
return current / max;
}
Get team size.
Type of action.
Name of action. Must be an exact match.
Number of Bladeburner team members that were assigned to the specified action.
RAM cost: 4 GB
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.
Join the Bladeburner division.
True if you successfully join the Bladeburner division, or if you are already a member, false otherwise.
RAM cost: 4 GB
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.
Join the Bladeburner faction.
True if you successfully join the Bladeburner faction, or if you are already a member, false otherwise.
RAM cost: 4 GB 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.
Sleep until the next Bladeburner update has happened.
Promise that resolves to the number of milliseconds of Bladeburner time that were processed in the previous update (1000 - 5000 ms).
RAM cost: 1 GB
The amount of real time spent asleep between updates can vary due to "bonus time" (usually 1 second).
while (true) {
const duration = await ns.bladeburner.nextUpdate();
ns.print(`Bladeburner Division completed ${ns.tFormat(duration)} of actions.`);
ns.print(`Bonus time remaining: ${ns.tFormat(ns.bladeburner.getBonusTime())}`);
// Manage the Bladeburner division
}
Set an action autolevel.
Type of action.
Name of action. Must be an exact match.
Whether or not to autolevel this action
RAM cost: 4 GB
Enable/disable autoleveling for the specified action.
Set team size.
Type of action.
Name of action. Must be an exact match.
Number of team members to set. Will be converted using Math.round().
Number of Bladeburner team members you assigned to the specified action.
RAM cost: 4 GB
Set the team size for the specified Bladeburner action.
Returns the team size that was set, or -1 if the function failed.
Start an action.
Type of action.
Name of action. Must be an exact match
True if the action was started successfully, and false otherwise.
RAM cost: 4 GB
Attempts to start the specified Bladeburner action. Returns true if the action was started successfully, and false otherwise.
ns.bladeburner.startAction("Contracts", "Tracking")
// This will start the Bladeburner Contracts action of Tracking
Travel to another city in Bladeburner.
Name of city. Case-sensitive
true if successful, and false otherwise
RAM cost: 4 GB Attempts to switch to the specified city (for Bladeburner only).
Returns true if successful, and false otherwise
Upgrade skill.
Name of skill to be upgraded. Case-sensitive and must be an exact match.
Optional count: numberNumber of times to upgrade the skill. Defaults to 1 if not specified.
true if the skill is successfully upgraded, and false otherwise.
RAM cost: 4 GB
Attempts to upgrade the specified Bladeburner skill the specified number of times.
Returns true if the skill is successfully upgraded, and false otherwise.
Bladeburner API
Remarks
You have to be employed in the Bladeburner division and be in BitNode-7 or have Source-File 7 in order to use this API.