mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-20 08:13:50 +02:00
work to make documentation unified.
This commit is contained in:
@@ -4,10 +4,12 @@ getActionAutolevel() Netscript Function
|
||||
.. js:function:: getActionAutolevel(type, name)
|
||||
|
||||
:RAM cost: 4 GB
|
||||
|
||||
:param string type: Type of action. See :ref:`bladeburner_action_types`
|
||||
:param string name: Name of action. Must be an exact match
|
||||
:returns: ``true`` if this action is set to auto level.
|
||||
|
||||
Return a boolean indicating whether or not this action is currently set to autolevel.
|
||||
Examples:
|
||||
|
||||
Returns false if an invalid action is specified.
|
||||
.. code-block:: javascript
|
||||
|
||||
bladeburner.getActionAutolevel("Contracts", "Tracking"); // returns: true
|
||||
@@ -4,12 +4,18 @@ getActionCountRemaining() Netscript Function
|
||||
.. js:function:: getActionCountRemaining(type, name)
|
||||
|
||||
:RAM cost: 4 GB
|
||||
|
||||
:param string type: Type of action. See :ref:`bladeburner_action_types`
|
||||
:param string name: Name of action. Must be an exact match
|
||||
:returns: Remaining action count. -1 for invalid actions.
|
||||
|
||||
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
|
||||
wether the player has the required rank to attempt the mission or not.
|
||||
|
||||
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 wether the player has the required rank to attempt the mission or not.
|
||||
Example:
|
||||
|
||||
.. code-block:: javascript
|
||||
|
||||
bladeburner.getActionCountRemaining("Contracts", "Tracking"); // returns: 124
|
||||
@@ -4,10 +4,12 @@ getActionCurrentLevel() Netscript Function
|
||||
.. js:function:: getActionCurrentLevel(type, name)
|
||||
|
||||
:RAM cost: 4 GB
|
||||
|
||||
:param string type: Type of action. See :ref:`bladeburner_action_types`
|
||||
:param string name: Name of action. Must be an exact match
|
||||
:param string name: Name of action. Must be an exact match.
|
||||
:returns: Action current level, -1 for invalid actions.
|
||||
|
||||
Returns the current level of this action.
|
||||
Example:
|
||||
|
||||
Returns -1 if an invalid action is specified.
|
||||
.. code-block:: javascript
|
||||
|
||||
bladeburner.getActionCountRemaining("Contracts", "Tracking"); // returns: 7
|
||||
@@ -4,10 +4,12 @@ getActionEstimatedSuccessChance() Netscript Function
|
||||
.. js:function:: getActionEstimatedSuccessChance(type, name)
|
||||
|
||||
:RAM cost: 4 GB
|
||||
|
||||
:param string type: Type of action. See :ref:`bladeburner_action_types`
|
||||
:param string name: Name of action. Must be an exact match
|
||||
:returns: Estimated success chance in decimal
|
||||
|
||||
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).
|
||||
Example:
|
||||
|
||||
.. code-block:: javascript
|
||||
|
||||
bladeburner.getActionEstimatedSuccessChance("Contracts", "Tracking"); // returns: .3
|
||||
|
||||
@@ -4,10 +4,12 @@ getActionMaxLevel() Netscript Function
|
||||
.. js:function:: getActionMaxLevel(type, name)
|
||||
|
||||
:RAM cost: 4 GB
|
||||
|
||||
:param string type: Type of action. See :ref:`bladeburner_action_types`
|
||||
:param string name: Name of action. Must be an exact match
|
||||
:returns: Action max level, -1 for invalid actions.
|
||||
|
||||
Returns the maximum level for this action.
|
||||
Example:
|
||||
|
||||
Returns -1 if an invalid action is specified.
|
||||
.. code-block:: javascript
|
||||
|
||||
bladeburner.getActionMaxLevel("Contracts", "Tracking"); // returns: 15
|
||||
|
||||
@@ -4,11 +4,15 @@ getActionRepGain() Netscript Function
|
||||
.. js:function:: getActionRepGain(type, name[, level=current level])
|
||||
|
||||
:RAM cost: 4 GB
|
||||
|
||||
:param string type: Type of action. See :ref:`bladeburner_action_types`
|
||||
:param string name: Name of action. Must be an exact match
|
||||
:param number level: Optional action level at which to calculate the gain
|
||||
:param number level: Optional action level at which to calculate the gain.
|
||||
:returns: 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.
|
||||
|
||||
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.
|
||||
Example:
|
||||
|
||||
.. code-block:: javascript
|
||||
|
||||
bladeburner.getActionRepGain("Contracts", "Tracking"); // returns: 341
|
||||
@@ -4,8 +4,13 @@ getActionTime() Netscript Function
|
||||
.. js:function:: getActionTime(type, name)
|
||||
|
||||
:RAM cost: 4 GB
|
||||
|
||||
:param string type: Type of action. See :ref:`bladeburner_action_types`
|
||||
:param string name: Name of action. Must be an exact match
|
||||
:returns: Number of seconds it takes to complete the specified action.
|
||||
|
||||
Returns the number of seconds it takes to complete the specified action
|
||||
|
||||
Example:
|
||||
|
||||
.. code-block:: javascript
|
||||
|
||||
bladeburner.getActionTime("Contracts", "Tracking"); // returns: 4
|
||||
|
||||
@@ -4,5 +4,10 @@ getBlackOpNames() Netscript Function
|
||||
.. js:function:: getBlackOpNames()
|
||||
|
||||
:RAM cost: 0.4 GB
|
||||
:returns: Array of strings containing the names of all Bladeburner Black Ops.
|
||||
|
||||
Returns an array of strings containing the names of all Bladeburner Black Ops
|
||||
Example:
|
||||
|
||||
.. code-block:: javascript
|
||||
|
||||
bladeburner.getBlackOpNames(); // returns: ["Operation Typhoon"]
|
||||
@@ -4,9 +4,11 @@ getBlackOpRank() Netscript Function
|
||||
.. js:function:: getBlackOpRank(name)
|
||||
|
||||
:RAM cost: 2 GB
|
||||
|
||||
:param string name: name of the BlackOp. Must be an exact match.
|
||||
:returns: Rank required to complete this BlackOp. -1 for invalid BlackOp.
|
||||
|
||||
Returns the rank required to complete this BlackOp.
|
||||
Example:
|
||||
|
||||
Returns -1 if an invalid action is specified.
|
||||
.. code-block:: javascript
|
||||
|
||||
bladeburner.getBlackOpRank("Operation Typhoon"); // returns: 2500
|
||||
@@ -4,8 +4,7 @@ getBonusTime() Netscript Function
|
||||
.. js:function:: getBonusTime()
|
||||
|
||||
:RAM cost: 0 GB
|
||||
|
||||
Returns the amount of accumulated "bonus time" (seconds) for the Bladeburner mechanic.
|
||||
:returns: Amount of accumulated "bonus time" (seconds) for the Bladeburner mechanic.
|
||||
|
||||
"Bonus time" is accumulated when the game is offline or if the game is
|
||||
inactive in the browser.
|
||||
@@ -14,3 +13,9 @@ getBonusTime() Netscript Function
|
||||
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.
|
||||
|
||||
Example:
|
||||
|
||||
.. code-block:: javascript
|
||||
|
||||
bladeburner.getBonusTime(); // returns: 130
|
||||
|
||||
@@ -4,5 +4,10 @@ getCity() Netscript Function
|
||||
.. js:function:: getCity()
|
||||
|
||||
:RAM cost: 4 GB
|
||||
:returns: City that the player is currently in (for Bladeburner).
|
||||
|
||||
Returns the city that the player is currently in (for Bladeburner).
|
||||
Example:
|
||||
|
||||
.. code-block:: javascript
|
||||
|
||||
bladeburner.getCity(); // returns: "Sector-12"
|
||||
|
||||
@@ -4,7 +4,11 @@ getCityChaos() Netscript Function
|
||||
.. js:function:: getCityChaos(cityName)
|
||||
|
||||
:RAM cost: 4 GB
|
||||
|
||||
:param string cityName: Name of city. Case-sensitive
|
||||
:returns: Chaos in the specified city, or -1 if an invalid city was specified.
|
||||
|
||||
Returns the chaos in the specified city, or -1 if an invalid city was specified
|
||||
Example:
|
||||
|
||||
.. code-block:: javascript
|
||||
|
||||
bladeburner.getCityChaos("Sector-12"); // returns: 3800.1
|
||||
|
||||
@@ -4,8 +4,12 @@ getCityEstimatedCommunities() Netscript Function
|
||||
.. js:function:: getCityEstimatedCommunities(cityName)
|
||||
|
||||
:RAM cost: 4 GB
|
||||
|
||||
:param string cityName: Name of city. Case-sensitive
|
||||
:returns: Estimated number of Synthoid communities in the specified city,
|
||||
or -1 if an invalid city was specified.
|
||||
|
||||
Returns the estimated number of Synthoid communities in the specified city,
|
||||
or -1 if an invalid city was specified.
|
||||
Example:
|
||||
|
||||
.. code-block:: javascript
|
||||
|
||||
bladeburner.getCityEstimatedCommunities("Sector-12"); // returns: 76
|
||||
@@ -4,8 +4,12 @@ getCityEstimatedPopulation() Netscript Function
|
||||
.. js:function:: getCityEstimatedPopulation(cityName)
|
||||
|
||||
:RAM cost: 4 GB
|
||||
|
||||
:param string cityName: Name of city. Case-sensitive
|
||||
:returns: Estimated number of Synthoids in the specified city, or -1 if an
|
||||
invalid city was specified.
|
||||
|
||||
Returns the estimated number of Synthoids in the specified city, or -1
|
||||
if an invalid city was specified.
|
||||
Example:
|
||||
|
||||
.. code-block:: javascript
|
||||
|
||||
bladeburner.getCityEstimatedPopulation("Sector-12"); // returns: 1240000
|
||||
@@ -4,5 +4,10 @@ getContractNames() Netscript Function
|
||||
.. js:function:: getContractNames()
|
||||
|
||||
:RAM cost: 0.4 GB
|
||||
:returns: Array of strings containing the names of all Bladeburner contracts.
|
||||
|
||||
Returns an array of strings containing the names of all Bladeburner contracts
|
||||
Example:
|
||||
|
||||
.. code-block:: javascript
|
||||
|
||||
bladeburner.getContractNames(); // returns: ["Tracking"]
|
||||
@@ -4,8 +4,9 @@ getCurrentAction() Netscript Function
|
||||
.. js:function:: getCurrentAction()
|
||||
|
||||
:RAM cost: 1 GB
|
||||
:returns: An object that represents the player's current Bladeburner action.
|
||||
|
||||
Returns an object that represents the player's current Bladeburner action::
|
||||
Result::
|
||||
|
||||
{
|
||||
type: Type of Action
|
||||
@@ -14,3 +15,11 @@ getCurrentAction() Netscript Function
|
||||
|
||||
If the player is not performing an action, the function will return an object
|
||||
with the 'type' property set to "Idle".
|
||||
|
||||
Example:
|
||||
|
||||
.. code-block:: javascript
|
||||
|
||||
action = bladeburner.getCurrentAction();
|
||||
print(action.type); // "Contracts"
|
||||
print(action.name); // "Tracking"
|
||||
|
||||
@@ -4,5 +4,10 @@ getGeneralActionNames() Netscript Function
|
||||
.. js:function:: getGeneralActionNames()
|
||||
|
||||
:RAM cost: 0.4 GB
|
||||
:returns: Array of strings containing the names of all general Bladeburner actions.
|
||||
|
||||
Returns an array of strings containing the names of all general Bladeburner actions
|
||||
Example:
|
||||
|
||||
.. code-block:: javascript
|
||||
|
||||
bladeburner.getGeneralActionNames(); // returns: ["Training"]
|
||||
|
||||
@@ -4,5 +4,10 @@ getOperationNames() Netscript Function
|
||||
.. js:function:: getOperationNames()
|
||||
|
||||
:RAM cost: 0.4 GB
|
||||
:returns: Array of strings containing the names of all Bladeburner operations.
|
||||
|
||||
Returns an array of strings containing the names of all Bladeburner operations
|
||||
Example:
|
||||
|
||||
.. code-block:: javascript
|
||||
|
||||
bladeburner.getOperationNames(); // returns: ["Investigation"]
|
||||
|
||||
@@ -4,5 +4,10 @@ getRank() Netscript Function
|
||||
.. js:function:: getRank()
|
||||
|
||||
:RAM cost: 4 GB
|
||||
:returns: Player's Bladeburner Rank.
|
||||
|
||||
Returns the player's Bladeburner Rank
|
||||
Example:
|
||||
|
||||
.. code-block:: javascript
|
||||
|
||||
bladeburner.getRank(); // returns: 87135
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
getSkillLevel() Netscript Function
|
||||
==================================
|
||||
|
||||
.. js:function:: getSkillLevel(skillName="")
|
||||
.. js:function:: getSkillLevel(skillName)
|
||||
|
||||
:RAM cost: 4 GB
|
||||
:param string skillName: Name of skill. Case-sensitive.
|
||||
:returns: Level of specified skill, -1 for invalid skills.
|
||||
|
||||
:param string skillName: Name of skill. Case-sensitive and must be an exact match
|
||||
Example:
|
||||
|
||||
This function returns your level in the specified skill.
|
||||
.. code-block:: javascript
|
||||
|
||||
The function returns -1 if an invalid skill name is passed in
|
||||
bladeburner.getSkillLevel("Overclock"); // returns: 90
|
||||
@@ -4,5 +4,10 @@ getSkillNames() Netscript Function
|
||||
.. js:function:: getSkillNames()
|
||||
|
||||
:RAM cost: 0.4 GB
|
||||
:returns: Array of strings containing the names of all Bladeburner skills.
|
||||
|
||||
Returns an array of strings containing the names of all Bladeburner skills
|
||||
Example:
|
||||
|
||||
.. code-block:: javascript
|
||||
|
||||
bladeburner.getSkillNames(); // returns: ["Overclock"]
|
||||
|
||||
@@ -4,5 +4,10 @@ getSkillPoints() Netscript Function
|
||||
.. js:function:: getSkillPoints()
|
||||
|
||||
:RAM cost: 4 GB
|
||||
:returns: Amount of Bladeburner skill points you have.
|
||||
|
||||
Returns the number of Bladeburner skill points you have
|
||||
Example:
|
||||
|
||||
.. code-block:: javascript
|
||||
|
||||
bladeburner.getSkillPoints(); // returns: 1630
|
||||
@@ -1,13 +1,14 @@
|
||||
getSkillUpgradeCost() Netscript Function
|
||||
========================================
|
||||
|
||||
.. js:function:: getSkillUpgradeCost(skillName="")
|
||||
.. js:function:: getSkillUpgradeCost(skillName)
|
||||
|
||||
:RAM cost: 4 GB
|
||||
|
||||
:param string skillName: Name of skill. Case-sensitive and must be an exact match
|
||||
:returns: Amount of skill points needed to upgrade the specified skill. -1 for invalid skills.
|
||||
|
||||
This function returns the number of skill points needed to upgrade the
|
||||
specified skill.
|
||||
Example:
|
||||
|
||||
The function returns -1 if an invalid skill name is passed in.
|
||||
.. code-block:: javascript
|
||||
|
||||
bladeburner.getSkillUpgradeCost("Overclock"); // returns: 120
|
||||
|
||||
@@ -4,14 +4,11 @@ getStamina() Netscript Function
|
||||
.. js:function:: getStamina()
|
||||
|
||||
:RAM cost: 4 GB
|
||||
:returns: Array with two elements [Current stamina, Max stamina]
|
||||
|
||||
Returns an array with two elements:
|
||||
Example:
|
||||
|
||||
[Current stamina, Max stamina]
|
||||
.. code-block:: javascript
|
||||
|
||||
Example usage::
|
||||
|
||||
function getStaminaPercentage() {
|
||||
let res = bladeburner.getStamina();
|
||||
return res[0] / res[1];
|
||||
}
|
||||
res = bladeburner.getStamina();
|
||||
percentage = res[0] / res[1];
|
||||
|
||||
@@ -4,12 +4,16 @@ getTeamSize() Netscript Function
|
||||
.. js:function:: getTeamSize(type, name)
|
||||
|
||||
:RAM cost: 4 GB
|
||||
|
||||
: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.
|
||||
:returns: 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.
|
||||
|
||||
Example:
|
||||
|
||||
.. code-block:: javascript
|
||||
|
||||
bladeburner.getTeamSize("Operations", "Investigation"); // returns: 7
|
||||
@@ -4,10 +4,13 @@ joinBladeburnerDivision() Netscript Function
|
||||
.. js:function:: joinBladeburnerDivision()
|
||||
|
||||
:RAM cost: 4 GB
|
||||
:returns: ``true`` if you successfully join the Bladeburner division, or if you
|
||||
are already a member.
|
||||
|
||||
Attempts to join the Bladeburner division.
|
||||
|
||||
Returns true if you successfully join the Bladeburner division, or if you
|
||||
are already a member.
|
||||
Example:
|
||||
|
||||
Returns false otherwise
|
||||
.. code-block:: javascript
|
||||
|
||||
bladeburner.joinBladeburnerDivision(); // returns: true
|
||||
@@ -4,10 +4,13 @@ joinBladeburnerFaction() Netscript Function
|
||||
.. js:function:: joinBladeburnerFaction()
|
||||
|
||||
:RAM cost: 4 GB
|
||||
:returns: ``true`` if you successfully join the Bladeburner faction, or if
|
||||
you are already a member.
|
||||
|
||||
Attempts to join the Bladeburner faction.
|
||||
|
||||
Returns true if you successfully join the Bladeburner faction, or if
|
||||
you are already a member.
|
||||
Example:
|
||||
|
||||
Returns false otherwise.
|
||||
.. code-block:: javascript
|
||||
|
||||
bladeburner.joinBladeburnerFaction(); // returns: true
|
||||
@@ -4,9 +4,14 @@ setActionAutolevel() Netscript Function
|
||||
.. js:function:: setActionAutolevel(type, name, autoLevel)
|
||||
|
||||
:RAM cost: 4 GB
|
||||
|
||||
:param string type: Type of action. See :ref:`bladeburner_action_types`
|
||||
:param string name: Name of action. Must be an exact match
|
||||
:param boolean autoLevel: Whether or not to autolevel this action
|
||||
|
||||
Enable/disable autoleveling for the specified action.
|
||||
|
||||
Example:
|
||||
|
||||
.. code-block:: javascript
|
||||
|
||||
bladeburner.setActionAutolevel("Contracts", "Tracking", true);
|
||||
|
||||
@@ -4,9 +4,14 @@ setActionLevel() Netscript Function
|
||||
.. js:function:: setActionLevel(type, name, level)
|
||||
|
||||
:RAM cost: 4 GB
|
||||
|
||||
:param string type: Type of action. See :ref:`bladeburner_action_types`
|
||||
:param string name: Name of action. Must be an exact match
|
||||
:param level int: Level to set this action to
|
||||
|
||||
Set the level for the specified action.
|
||||
|
||||
Example:
|
||||
|
||||
.. code-block:: javascript
|
||||
|
||||
bladeburner.setActionLevel("Contracts", "Tracking", 10);
|
||||
|
||||
@@ -4,11 +4,15 @@ setTeamSize() Netscript Function
|
||||
.. js:function:: setTeamSize(type, name, size)
|
||||
|
||||
:RAM cost: 4 GB
|
||||
|
||||
: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()
|
||||
:returns: Team size or -1 for invalid actions.
|
||||
|
||||
Set the team size for the specified Bladeburner action.
|
||||
|
||||
Returns the team size that was set, or -1 if the function failed.
|
||||
Example:
|
||||
|
||||
.. code-block:: javascript
|
||||
|
||||
bladeburner.setTeamSize("Operations", "Investigation", 7);
|
||||
@@ -4,9 +4,14 @@ startAction() Netscript Function
|
||||
.. js:function:: startAction(type, name)
|
||||
|
||||
:RAM cost: 4 GB
|
||||
|
||||
:param string type: Type of action. See :ref:`bladeburner_action_types`
|
||||
:param string name: Name of action. Must be an exact match
|
||||
:returns: ``true`` if the action was started successfully.
|
||||
|
||||
Attempts to start the specified Bladeburner action. Returns true if the action
|
||||
was started successfully, and false otherwise.
|
||||
Attempts to start the specified Bladeburner action.
|
||||
|
||||
Example:
|
||||
|
||||
.. code-block:: javascript
|
||||
|
||||
bladeburner.startAction("Contracts", "Tracking"); // returns: true
|
||||
@@ -6,3 +6,9 @@ stopBladeburnerAction() Netscript Function
|
||||
:RAM cost: 2 GB
|
||||
|
||||
Stops the current Bladeburner action
|
||||
|
||||
Example:
|
||||
|
||||
.. code-block:: javascript
|
||||
|
||||
bladeburner.stopBladeburnerAction();
|
||||
@@ -4,9 +4,13 @@ switchCity() Netscript Function
|
||||
.. js:function:: switchCity(cityName)
|
||||
|
||||
:RAM cost: 4 GB
|
||||
|
||||
:param string cityName: Name of city
|
||||
:returns: ``true`` if successful.
|
||||
|
||||
Attempts to switch to the specified city (for Bladeburner only).
|
||||
|
||||
Returns true if successful, and false otherwise
|
||||
Example:
|
||||
|
||||
.. code-block:: javascript
|
||||
|
||||
bladeburner.switchCity("Sector-12"); // returns: true
|
||||
|
||||
@@ -4,8 +4,13 @@ upgradeSkill() Netscript Function
|
||||
.. js:function:: upgradeSkill(skillName)
|
||||
|
||||
:RAM cost: 4 GB
|
||||
|
||||
:param string skillName: Name of Skill to be upgraded. Case-sensitive and must be an exact match
|
||||
:returns: ``true`` if the skill is successfully upgraded.
|
||||
|
||||
Attempts to upgrade the specified Bladeburner skill. Returns true if the
|
||||
skill is successfully upgraded, and false otherwise
|
||||
Attempts to upgrade the specified Bladeburner skill.
|
||||
|
||||
Example:
|
||||
|
||||
.. code-block:: javascript
|
||||
|
||||
bladeburner.upgradeSkill("Overclock"); // returns: true
|
||||
Reference in New Issue
Block a user