Skip to content

Commit

Permalink
DOCUMENTATION: Clarify isBusy and stopAction Singularity APIs (#1822)
Browse files Browse the repository at this point in the history
  • Loading branch information
catloversg authored Dec 12, 2024
1 parent f07c442 commit 4137a0e
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 21 deletions.
22 changes: 20 additions & 2 deletions markdown/bitburner.singularity.isbusy.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,29 @@ isBusy(): boolean;

boolean

True if the player is currently performing an action, false otherwise.
True if the player is currently performing an action, false otherwise.

## Remarks

RAM cost: 0.5 GB \* 16/4/1

Returns a boolean indicating whether or not the player is currently performing an ‘action’. These actions include working for a company/faction, studying at a university, working out at a gym, creating a program, committing a crime, etc.
Returns a boolean indicating if the player is currently performing an action. These actions include:

- Studying at a university

- Working out at a gym

- Working for a company/faction

- Creating a program

- Committing a crime

- Grafting an augmentation

Note:

- This function returns true when the UI is showing the infiltration UI or the BitVerse.

- This function does not take Bladeburner actions into account. You can use [getCurrentAction](./bitburner.bladeburner.getcurrentaction.md) to check if you are performing a Bladeburner action.

18 changes: 14 additions & 4 deletions markdown/bitburner.singularity.stopaction.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,27 @@ stopAction(): boolean;

boolean

True if the player’s action was ended, false if the player was not performing an action.
True if the player’s action is stopped, false if the player is not performing an action.

## Remarks

RAM cost: 1 GB \* 16/4/1

This function is used to end whatever ‘action the player is currently performing. The player will receive whatever money/experience/etc. he has earned from that action.
This function stops the action the player is currently performing. The player will receive rewards (money, experience, etc.) they have earned from that action.

The actions that can be stopped with this function are:

\* Studying at a university \* Working out at a gym \* Working for a company/faction \* Creating a program \* Committing a crime
- Studying at a university

This function will return true if the player’s action was ended. It will return false if the player was not performing an action when this function was called.
- Working out at a gym

- Working for a company/faction

- Creating a program

- Committing a crime

- Grafting an augmentation

This function will return true if the player's action is stopped. It will return false if the player is not performing an action when this function is called.

53 changes: 38 additions & 15 deletions src/ScriptEditor/NetscriptDefinitions.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1924,39 +1924,62 @@ export interface Singularity {

/**
* Check if the player is busy.
*
* @remarks
* RAM cost: 0.5 GB * 16/4/1
*
* Returns a boolean indicating if the player is currently performing an action. These actions include:
*
* - Studying at a university
*
* - Working out at a gym
*
* - Working for a company/faction
*
* - Creating a program
*
* - Committing a crime
*
* - Grafting an augmentation
*
* Note:
*
* Returns a boolean indicating whether or not the player is currently performing an
* ‘action’. These actions include working for a company/faction, studying at a university,
* working out at a gym, creating a program, committing a crime, etc.
* - This function returns true when the UI is showing the infiltration UI or the BitVerse.
*
* @returns True if the player is currently performing an ‘action’, false otherwise.
* - This function does not take Bladeburner actions into account. You can use {@link Bladeburner.getCurrentAction | getCurrentAction}
* to check if you are performing a Bladeburner action.
*
* @returns True if the player is currently performing an action, false otherwise.
*/
isBusy(): boolean;

/**
* Stop the current action.
*
* @remarks
* RAM cost: 1 GB * 16/4/1
*
*
* This function is used to end whatever ‘action’ the player is currently performing.
* The player will receive whatever money/experience/etc. he has earned from that action.
* This function stops the action the player is currently performing. The player will receive rewards (money,
* experience, etc.) they have earned from that action.
*
* The actions that can be stopped with this function are:
*
* * Studying at a university
* * Working out at a gym
* * Working for a company/faction
* * Creating a program
* * Committing a crime
* - Studying at a university
*
* - Working out at a gym
*
* - Working for a company/faction
*
* - Creating a program
*
* - Committing a crime
*
* - Grafting an augmentation
*
* This function will return true if the players action was ended.
* It will return false if the player was not performing an action when this function was called.
* This function will return true if the player's action is stopped. It will return false if the player is not
* performing an action when this function is called.
*
* @returns True if the player’s action was ended, false if the player was not performing an action.
* @returns True if the player’s action is stopped, false if the player is not performing an action.
*/
stopAction(): boolean;

Expand Down

0 comments on commit 4137a0e

Please sign in to comment.