Interface Singularity

Singularity API

Remarks

This API requires Source-File 4 to use. The RAM cost of all these functions is multiplied by 16/4/1 based on Source-File 4 levels.

interface Singularity {
    applyToCompany(companyName, field): null | JobName;
    b1tflum3(nextBN, callbackScript?): void;
    checkFactionInvitations(): string[];
    commitCrime(crime, focus?): number;
    connect(hostname): boolean;
    createProgram(program, focus?): boolean;
    destroyW0r1dD43m0n(nextBN, callbackScript?): void;
    donateToFaction(faction, amount): boolean;
    exportGame(): void;
    exportGameBonus(): boolean;
    getAugmentationBasePrice(augName): number;
    getAugmentationFactions(augName): string[];
    getAugmentationPrereq(augName): string[];
    getAugmentationPrice(augName): number;
    getAugmentationRepReq(augName): number;
    getAugmentationStats(name): Multipliers;
    getAugmentationsFromFaction(faction): string[];
    getCompanyFavor(companyName): number;
    getCompanyFavorGain(companyName): number;
    getCompanyPositionInfo(companyName, positionName): CompanyPositionInfo;
    getCompanyPositions(companyName): JobName[];
    getCompanyRep(companyName): number;
    getCrimeChance(crime): number;
    getCrimeStats(crime): CrimeStats;
    getCurrentServer(): string;
    getCurrentWork(): null | Task;
    getDarkwebProgramCost(programName): number;
    getDarkwebPrograms(): string[];
    getFactionEnemies(faction): string[];
    getFactionFavor(faction): number;
    getFactionFavorGain(faction): number;
    getFactionInviteRequirements(faction): PlayerRequirement[];
    getFactionRep(faction): number;
    getOwnedAugmentations(purchased?): string[];
    getOwnedSourceFiles(): SourceFileLvl[];
    getUpgradeHomeCoresCost(): number;
    getUpgradeHomeRamCost(): number;
    goToLocation(locationName): boolean;
    gymWorkout(gymName, stat, focus?): boolean;
    hospitalize(): void;
    installAugmentations(cbScript?): void;
    installBackdoor(): Promise<void>;
    isBusy(): boolean;
    isFocused(): boolean;
    joinFaction(faction): boolean;
    manualHack(): Promise<number>;
    purchaseAugmentation(faction, augmentation): boolean;
    purchaseProgram(programName): boolean;
    purchaseTor(): boolean;
    quitJob(companyName?): void;
    setFocus(focus): boolean;
    softReset(cbScript): void;
    stopAction(): boolean;
    travelToCity(city): boolean;
    universityCourse(universityName, courseName, focus?): boolean;
    upgradeHomeCores(): boolean;
    upgradeHomeRam(): boolean;
    workForCompany(companyName, focus?): boolean;
    workForFaction(faction, workType, focus?): boolean;
}

Methods

  • Apply for a job at a company.

    Parameters

    • companyName: CompanyName | "ECorp" | "MegaCorp" | "Bachman & Associates" | "Blade Industries" | "NWO" | "Clarke Incorporated" | "OmniTek Incorporated" | "Four Sigma" | "KuaiGong International" | "Fulcrum Technologies" | "Storm Technologies" | "DefComm" | "Helios Labs" | "VitaLife" | "Icarus Microsystems" | "Universal Energy" | "Galactic Cybersystems" | "AeroCorp" | "Omnia Cybersystems" | "Solaris Space Systems" | "DeltaOne" | "Global Pharmaceuticals" | "Nova Medical" | "Central Intelligence Agency" | "National Security Agency" | "Watchdog Security" | "LexoCorp" | "Rho Construction" | "Alpha Enterprises" | "Aevum Police Headquarters" | "SysCore Securities" | "CompuTek" | "NetLink Technologies" | "Carmichael Security" | "FoodNStuff" | "Joe's Guns" | "Omega Software" | "Noodle Bar"

      Name of company to apply to.

    • field: "Security Engineer" | "Network Engineer" | "Waiter" | "Employee" | "Software Consultant" | "Business Consultant" | "Part-time Waiter" | "Part-time Employee" | JobField | "Software" | "IT" | "Business" | "Security" | "Agent"

      Field to which you want to apply.

    Returns null | JobName

    True if the player successfully get a job/promotion, and false otherwise.

    Remarks

    RAM cost: 3 GB * 16/4/1

    This function will automatically try to apply to the specified company for a position in the specified field. This function can also be used to apply for promotions by specifying the company and field you are already employed at.

    This function will return true if you successfully get a job/promotion, and false otherwise. Note that if you are trying to use this function to apply for a promotion and don’t get one, the function will return false.

  • b1t_flum3 into a different BN.

    Parameters

    • nextBN: number

      BN number to jump to

    • Optional callbackScript: string

      Name of the script to launch in the next BN.

    Returns void

    Remarks

    RAM cost: 16 GB * 16/4/1

  • List all current faction invitations.

    Returns string[]

    Array with the name of all Factions you currently have outstanding invitations from.

    Remarks

    RAM cost: 3 GB * 16/4/1

    Performs an immediate check for which factions you qualify for invites from, then returns an array with the name of all Factions you have outstanding invitations from.

  • Commit a crime.

    Parameters

    • crime: CrimeType | "Shoplift" | "Rob Store" | "Mug" | "Larceny" | "Deal Drugs" | "Bond Forgery" | "Traffick Arms" | "Homicide" | "Grand Theft Auto" | "Kidnap" | "Assassination" | "Heist"

      Name of crime to attempt.

    • Optional focus: boolean

      Acquire player focus on this crime. Optional. Defaults to true.

    Returns number

    The number of milliseconds it takes to attempt the specified crime.

    Remarks

    RAM cost: 5 GB * 16/4/1

    This function is used to automatically attempt to commit crimes. If you are already in the middle of some ‘working’ action (such as working for a company or training at a gym), then running this function will automatically cancel that action and give you your earnings.

    This function returns the number of milliseconds it takes to attempt the specified crime (e.g. It takes 60 seconds to attempt the ‘Rob Store’ crime, so running commitCrime('Rob Store') will return 60,000).

  • Connect to a server.

    Parameters

    • hostname: string

    Returns boolean

    True if the connect command was successful, false otherwise.

    Remarks

    RAM cost: 2 GB * 16/4/1

    Run the connect HOSTNAME command in the terminal. Can only connect to neighbors.

  • Create a program.

    Parameters

    • program: string

      Name of program to create.

    • Optional focus: boolean

      Acquire player focus on this program creation. Optional. Defaults to true.

    Returns boolean

    True if you successfully start working on the specified program, and false otherwise.

    Remarks

    RAM cost: 5 GB * 16/4/1

    This function will automatically set you to start working on creating the specified program. If you are already in the middle of some “working” action (such as working for a company, training at a gym, or taking a course), then running this function will automatically cancel that action and give you your earnings.

    This function returns true if you successfully start working on the specified program, and false otherwise.

    Note that creating a program using this function has the same hacking level requirements as it normally would. These level requirements are:

    • BruteSSH.exe: 50
    • FTPCrack.exe: 100
    • relaySMTP.exe: 250
    • HTTPWorm.exe: 500
    • SQLInject.exe: 750
    • DeepscanV1.exe: 75
    • DeepscanV2.exe: 400
    • ServerProfiler.exe: 75
    • AutoLink.exe: 25

    Example

    const programName = "BruteSSH.exe";
    const success = ns.createProgram(programName);
    if (!success) ns.tprint("ERROR: Failed to start working on ${programName}")
  • Destroy the w0r1d_d43m0n and move on to the next BN.

    Parameters

    • nextBN: number

      BN number to jump to

    • Optional callbackScript: string

      Name of the script to launch in the next BN.

    Returns void

    Remarks

    RAM cost: 32 GB * 16/4/1

    You must have the special augment installed and the required hacking level OR Completed the final black op.

  • Donate to a faction.

    Parameters

    • faction: string

      Name of faction to donate to.

    • amount: number

      Amount of money to donate.

    Returns boolean

    True if the money was donated, and false otherwise.

    Remarks

    RAM cost: 5 GB * 16/4/1

    Attempts to donate money to the specified faction in exchange for reputation. Returns true if you successfully donate the money, and false otherwise.

  • Backup game save.

    Returns void

    Remarks

    RAM cost: 1 GB * 16/4/1

    This function will automatically open the backup save prompt and claim the free faction favour if available.

  • Returns Backup save bonus availability.

    Returns boolean

    Remarks

    RAM cost: 0.5 GB * 16/4/1

    This function will check if there is a bonus for backing up your save.

  • Get base price of an augmentation.

    Parameters

    • augName: string

      Name of Augmentation.

    Returns number

    Base price of the augmentation, before price multiplier.

    Remarks

    RAM cost: 2.5 GB * 16/4/1

  • Get a list of faction(s) that have a specific Augmentation.

    Parameters

    • augName: string

      Name of Augmentation.

    Returns string[]

    Array containing the names of all factions.

    Remarks

    RAM cost: 5 GB * 16/4/1

    Returns an array containing the names (as strings) of all factions that offer the specified Augmentation. If no factions offer the Augmentation, a blank array is returned.

  • Get the pre-requisite of an augmentation.

    Parameters

    • augName: string

      Name of Augmentation.

    Returns string[]

    Array with the names of the prerequisite Augmentation(s) for the specified Augmentation.

    Remarks

    RAM cost: 5 GB * 16/4/1

    This function returns an array with the names of the prerequisite Augmentation(s) for the specified Augmentation. If there are no prerequisites, a blank array is returned.

  • Get price of an augmentation.

    Parameters

    • augName: string

      Name of Augmentation.

    Returns number

    Price of the augmentation.

    Remarks

    RAM cost: 2.5 GB * 16/4/1

  • Get reputation requirement of an augmentation.

    Parameters

    • augName: string

      Name of Augmentation.

    Returns number

    Reputation requirement of the augmentation.

    Remarks

    RAM cost: 2.5 GB * 16/4/1

  • Get the stats of an augmentation.

    Parameters

    • name: string

      Name of Augmentation. CASE-SENSITIVE.

    Returns Multipliers

    Augmentation stats.

    Remarks

    RAM cost: 5 GB * 16/4/1

    This function returns augmentation stats.

  • Get a list of augmentation available from a faction.

    Parameters

    • faction: string

      Name of faction.

    Returns string[]

    Array containing the names of all Augmentations.

    Remarks

    RAM cost: 5 GB * 16/4/1

    Returns an array containing the names (as strings) of all Augmentations that are available from the specified faction.

  • Get company favor.

    Parameters

    • companyName: CompanyName | "ECorp" | "MegaCorp" | "Bachman & Associates" | "Blade Industries" | "NWO" | "Clarke Incorporated" | "OmniTek Incorporated" | "Four Sigma" | "KuaiGong International" | "Fulcrum Technologies" | "Storm Technologies" | "DefComm" | "Helios Labs" | "VitaLife" | "Icarus Microsystems" | "Universal Energy" | "Galactic Cybersystems" | "AeroCorp" | "Omnia Cybersystems" | "Solaris Space Systems" | "DeltaOne" | "Global Pharmaceuticals" | "Nova Medical" | "Central Intelligence Agency" | "National Security Agency" | "Watchdog Security" | "LexoCorp" | "Rho Construction" | "Alpha Enterprises" | "Aevum Police Headquarters" | "SysCore Securities" | "CompuTek" | "NetLink Technologies" | "Carmichael Security" | "FoodNStuff" | "Joe's Guns" | "Omega Software" | "Noodle Bar"

      Name of the company.

    Returns number

    Amount of favor you have at the specified company.

    Remarks

    RAM cost: 1 GB * 16/4/1

    This function will return the amount of favor you have at the specified company. If the company passed in as an argument is invalid, -1 will be returned.

  • Get company favor gain.

    Parameters

    • companyName: CompanyName | "ECorp" | "MegaCorp" | "Bachman & Associates" | "Blade Industries" | "NWO" | "Clarke Incorporated" | "OmniTek Incorporated" | "Four Sigma" | "KuaiGong International" | "Fulcrum Technologies" | "Storm Technologies" | "DefComm" | "Helios Labs" | "VitaLife" | "Icarus Microsystems" | "Universal Energy" | "Galactic Cybersystems" | "AeroCorp" | "Omnia Cybersystems" | "Solaris Space Systems" | "DeltaOne" | "Global Pharmaceuticals" | "Nova Medical" | "Central Intelligence Agency" | "National Security Agency" | "Watchdog Security" | "LexoCorp" | "Rho Construction" | "Alpha Enterprises" | "Aevum Police Headquarters" | "SysCore Securities" | "CompuTek" | "NetLink Technologies" | "Carmichael Security" | "FoodNStuff" | "Joe's Guns" | "Omega Software" | "Noodle Bar"

      Name of the company.

    Returns number

    Amount of favor you gain at the specified company when you reset by installing Augmentations.

    Remarks

    RAM cost: 0.75 GB * 16/4/1

    This function will return the amount of favor you will gain for the specified company when you reset by installing Augmentations.

  • Get Requirements for Company Position.

    Parameters

    • companyName: CompanyName | "ECorp" | "MegaCorp" | "Bachman & Associates" | "Blade Industries" | "NWO" | "Clarke Incorporated" | "OmniTek Incorporated" | "Four Sigma" | "KuaiGong International" | "Fulcrum Technologies" | "Storm Technologies" | "DefComm" | "Helios Labs" | "VitaLife" | "Icarus Microsystems" | "Universal Energy" | "Galactic Cybersystems" | "AeroCorp" | "Omnia Cybersystems" | "Solaris Space Systems" | "DeltaOne" | "Global Pharmaceuticals" | "Nova Medical" | "Central Intelligence Agency" | "National Security Agency" | "Watchdog Security" | "LexoCorp" | "Rho Construction" | "Alpha Enterprises" | "Aevum Police Headquarters" | "SysCore Securities" | "CompuTek" | "NetLink Technologies" | "Carmichael Security" | "FoodNStuff" | "Joe's Guns" | "Omega Software" | "Noodle Bar"

      Name of company to get the requirements for. Must be an exact match.

    • positionName: JobName | "Software Engineering Intern" | "Junior Software Engineer" | "Senior Software Engineer" | "Lead Software Developer" | "Head of Software" | "Head of Engineering" | "Vice President of Technology" | "Chief Technology Officer" | "IT Intern" | "IT Analyst" | "IT Manager" | "Systems Administrator" | "Security Engineer" | "Network Engineer" | "Network Administrator" | "Business Intern" | "Business Analyst" | "Business Manager" | "Operations Manager" | "Chief Financial Officer" | "Chief Executive Officer" | "Security Guard" | "Security Officer" | "Security Supervisor" | "Head of Security" | "Field Agent" | "Secret Agent" | "Special Operative" | "Waiter" | "Employee" | "Software Consultant" | "Senior Software Consultant" | "Business Consultant" | "Senior Business Consultant" | "Part-time Waiter" | "Part-time Employee"

      Name of position to get the requirements for. Must be an exact match.

    Returns CompanyPositionInfo

    CompanyPositionInfo object.

    Remarks

    RAM cost: 2 GB * 16/4/1

    This function will return an object that contains the requirements for a specific position at a specific country.

    Example

    const companyName = "ECorp";
    const position = "Chief Executive Officer";

    let requirements = ns.singularity.getCompanyPositionInfo(companyName, position);
  • Get List of Company Positions.

    Parameters

    • companyName: CompanyName | "ECorp" | "MegaCorp" | "Bachman & Associates" | "Blade Industries" | "NWO" | "Clarke Incorporated" | "OmniTek Incorporated" | "Four Sigma" | "KuaiGong International" | "Fulcrum Technologies" | "Storm Technologies" | "DefComm" | "Helios Labs" | "VitaLife" | "Icarus Microsystems" | "Universal Energy" | "Galactic Cybersystems" | "AeroCorp" | "Omnia Cybersystems" | "Solaris Space Systems" | "DeltaOne" | "Global Pharmaceuticals" | "Nova Medical" | "Central Intelligence Agency" | "National Security Agency" | "Watchdog Security" | "LexoCorp" | "Rho Construction" | "Alpha Enterprises" | "Aevum Police Headquarters" | "SysCore Securities" | "CompuTek" | "NetLink Technologies" | "Carmichael Security" | "FoodNStuff" | "Joe's Guns" | "Omega Software" | "Noodle Bar"

      Name of company to get the position list for. Must be an exact match.

    Returns JobName[]

    The position list if the company name is valid.

    Remarks

    RAM cost: 2 GB * 16/4/1

    This function will return a list of positions at a specific company.

    This function will return the position list if the company name is valid.

    Example

    const companyName = "Noodle Bar";
    const jobList = ns.singularity.getCompanyPositions(companyName);
  • Get company reputation.

    Parameters

    • companyName: CompanyName | "ECorp" | "MegaCorp" | "Bachman & Associates" | "Blade Industries" | "NWO" | "Clarke Incorporated" | "OmniTek Incorporated" | "Four Sigma" | "KuaiGong International" | "Fulcrum Technologies" | "Storm Technologies" | "DefComm" | "Helios Labs" | "VitaLife" | "Icarus Microsystems" | "Universal Energy" | "Galactic Cybersystems" | "AeroCorp" | "Omnia Cybersystems" | "Solaris Space Systems" | "DeltaOne" | "Global Pharmaceuticals" | "Nova Medical" | "Central Intelligence Agency" | "National Security Agency" | "Watchdog Security" | "LexoCorp" | "Rho Construction" | "Alpha Enterprises" | "Aevum Police Headquarters" | "SysCore Securities" | "CompuTek" | "NetLink Technologies" | "Carmichael Security" | "FoodNStuff" | "Joe's Guns" | "Omega Software" | "Noodle Bar"

      Name of the company.

    Returns number

    Amount of reputation you have at the specified company.

    Remarks

    RAM cost: 1 GB * 16/4/1

    This function will return the amount of reputation you have at the specified company. If the company passed in as an argument is invalid, -1 will be returned.

  • Get chance to successfully commit a crime.

    Parameters

    • crime: CrimeType | "Shoplift" | "Rob Store" | "Mug" | "Larceny" | "Deal Drugs" | "Bond Forgery" | "Traffick Arms" | "Homicide" | "Grand Theft Auto" | "Kidnap" | "Assassination" | "Heist"

      Name of crime.

    Returns number

    Chance of success at committing the specified crime.

    Remarks

    RAM cost: 5 GB * 16/4/1

    This function returns your chance of success at committing the specified crime.

  • Get stats related to a crime.

    Parameters

    • crime: CrimeType | "Shoplift" | "Rob Store" | "Mug" | "Larceny" | "Deal Drugs" | "Bond Forgery" | "Traffick Arms" | "Homicide" | "Grand Theft Auto" | "Kidnap" | "Assassination" | "Heist"

      Name of crime.

    Returns CrimeStats

    The stats of the crime.

    Remarks

    RAM cost: 5 GB * 16/4/1

    Returns the stats of the crime.

  • Get the current server.

    Returns string

    Name of the current server.

    Remarks

    RAM cost: 2 GB * 16/4/1

  • Get the current work the player is doing.

    Returns null | Task

    • An object representing the current work. Fields depend on the kind of work.

    Remarks

    RAM cost: 0.5 GB * 16/4/1

  • Check the price of an exploit on the dark web

    Parameters

    • programName: string

      Name of program to check the price of

    Returns number

    Price of the specified darkweb program (if not yet purchased), 0 if it has already been purchased, or -1 if Tor has not been purchased. Throws an error if the specified program/exploit does not exist

    Remarks

    RAM cost: 0.5 GB * 16/4/1

    This function allows you to check the price of a darkweb exploit/program. You MUST have a TOR router in order to use this function. The price returned by this function is the same price you would see with buy -l from the terminal. Returns the cost of the program if it has not been purchased yet, 0 if it has already been purchased, or -1 if Tor has not been purchased (and thus the program/exploit is not available for purchase).

    If the program does not exist, an error is thrown.

    Example

    const programName = "BruteSSH.exe";
    const cost = ns.getDarkwebProgramCost(programName);
    if (cost > 0) ns.tprint(`${programName} costs ${ns.formatMoney(cost)}`);
  • Get a list of programs offered on the dark web.

    Returns string[]

    • a list of programs available for purchase on the dark web, or [] if Tor has not been purchased

    Remarks

    RAM cost: 1 GB * 16/4/1

    This function allows the player to get a list of programs available for purchase on the dark web. Players MUST have purchased Tor to get the list of programs available. If Tor has not been purchased yet, this function will return an empty list.

    Example

    const programs = ns.getDarkwebPrograms();
    ns.tprint(`Available programs are: ${programs.split(", ")}`);
  • Get a list of enemies of a faction.

    Parameters

    • faction: string

      Name of faction.

    Returns string[]

    Array containing the names of all enemies of the faction.

    Remarks

    RAM cost: 3 GB * 16/4/1

    Returns an array containing the names (as strings) of all factions that are enemies of the specified faction.

  • Get faction favor.

    Parameters

    • faction: string

      Name of faction.

    Returns number

    Amount of favor you have for the specified faction.

    Remarks

    RAM cost: 1 GB * 16/4/1

    This function returns the amount of favor you have for the specified faction.

  • Get faction favor gain.

    Parameters

    • faction: string

      Name of faction.

    Returns number

    Amount of favor you will gain for the specified faction when you reset by installing Augmentations.

    Remarks

    RAM cost: 0.75 GB * 16/4/1

    This function returns the amount of favor you will gain for the specified faction when you reset by installing Augmentations.

  • List conditions for being invited to a faction.

    Parameters

    • faction: string

      Name of the faction

    Returns PlayerRequirement[]

    Array of PlayerRequirement objects which must all be fulfilled to receive an invitation.

    Remarks

    RAM cost: 3 GB * 16/4/1

    Example

    ns.singularity.getFactionInviteRequirements("The Syndicate")
    [
    { "type": "someCondition", "conditions": [
    { "type": "city", "city": "Aevum" },
    { "type": "city", "city": "Sector-12" }
    ]
    },
    { "type": "not", "condition": {
    "type": "employedBy", "company": "Central Intelligence Agency"
    }
    },
    { "type": "not", "condition": {
    "type": "employedBy", "company": "National Security Agency"
    }
    },
    { "type": "money", "money": 10000000 },
    { "type": "skills", "skills": { "hacking": 200 } },
    { "type": "skills", "skills": { "strength": 200, "defense": 200, "dexterity": 200, "agility": 200 } },
    { "type": "karma", "karma": -90 }
    ]
  • Get faction reputation.

    Parameters

    • faction: string

      Name of faction to work for.

    Returns number

    Amount of reputation you have for the specified faction.

    Remarks

    RAM cost: 1 GB * 16/4/1

    This function returns the amount of reputation you have for the specified faction.

  • Get a list of owned augmentation.

    Parameters

    • Optional purchased: boolean

      Specifies whether the returned array should include Augmentations you have purchased but not yet installed. By default, this argument is false which means that the return value will NOT have the purchased Augmentations.

    Returns string[]

    Array containing the names (as strings) of all Augmentations you have.

    Remarks

    RAM cost: 5 GB * 16/4/1

    This function returns an array containing the names (as strings) of all Augmentations you have.

  • Get the price of upgrading home cores.

    Returns number

    Cost of upgrading the player’s home computer cores.

    Remarks

    RAM cost: 1.5 GB * 16/4/1

    Returns the cost of upgrading the player’s home computer cores.

  • Get the price of upgrading home RAM.

    Returns number

    Cost of upgrading the player’s home computer RAM.

    Remarks

    RAM cost: 1.5 GB * 16/4/1

    Returns the cost of upgrading the player’s home computer RAM.

  • Go to a location.

    Parameters

    • locationName: string

      Name of the location.

    Returns boolean

    True if the player was moved there, false otherwise.

    Remarks

    RAM cost: 5 GB * 16/4/1

    Move the player to a specific location.

  • Workout at the gym.

    Parameters

    • gymName: string

      Name of gym. You must be in the correct city for whatever gym you specify.

    • stat: string

      The stat you want to train.

    • Optional focus: boolean

      Acquire player focus on this gym workout. Optional. Defaults to true.

    Returns boolean

    True if action is successfully started, false otherwise.

    Remarks

    RAM cost: 2 GB * 16/4/1

    This function will automatically set you to start working out at a gym to train a particular stat. If you are already in the middle of some “working” action (such as working at a company, for a faction, or on a program), then running this function will automatically cancel that action and give you your earnings.

    The cost and experience gains for all of these gyms are the same as if you were to manually visit these gyms and train

  • Install your purchased augmentations.

    Parameters

    • Optional cbScript: string

      This is a script that will automatically be run after Augmentations are installed (after the reset). This script will be run with no arguments and 1 thread. It must be located on your home computer.

    Returns void

    Remarks

    RAM cost: 5 GB * 16/4/1

    This function will automatically install your Augmentations, resetting the game as usual. If you do not own uninstalled Augmentations then the game will not reset.

  • Run the backdoor command in the terminal.

    Returns Promise<void>

    Promise waiting for the installation to finish.

    Remarks

    RAM cost: 2 GB * 16/4/1

  • Check if the player is busy.

    Returns boolean

    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, or carrying out a Hacking Mission.

  • Check if the player is focused.

    Returns boolean

    True if the player is focused.

    Remarks

    RAM cost: 0.1 GB * 16/4/1

  • Join a faction.

    Parameters

    • faction: string

      Name of faction to join.

    Returns boolean

    True if player joined the faction, and false otherwise.

    Remarks

    RAM cost: 3 GB * 16/4/1

    This function will automatically accept an invitation from a faction and join it.

  • Run the hack command in the terminal.

    Returns Promise<number>

    Amount of money stolen by manual hacking.

    Remarks

    RAM cost: 2 GB * 16/4/1

  • Purchase an augmentation

    Parameters

    • faction: string

      Name of faction to purchase Augmentation from.

    • augmentation: string

      Name of Augmentation to purchase.

    Returns boolean

    True if the Augmentation is successfully purchased, and false otherwise.

    Remarks

    RAM cost: 5 GB * 16/4/1

    This function will try to purchase the specified Augmentation through the given Faction.

    This function will return true if the Augmentation is successfully purchased, and false otherwise.

  • Purchase a program from the dark web.

    Parameters

    • programName: string

      Name of program to purchase.

    Returns boolean

    True if the specified program is purchased, and false otherwise.

    Remarks

    RAM cost: 2 GB * 16/4/1

    This function allows you to automatically purchase programs. You MUST have a TOR router in order to use this function. The cost of purchasing programs using this function is the same as if you were purchasing them through the Dark Web using the Terminal buy command.

    Example

    const programName = "BruteSSH.exe"
    const success = ns.purchaseProgram(programName);
    if (!success) ns.tprint("ERROR: Failed to purchase ${programName}")
  • Purchase the TOR router.

    Returns boolean

    True if action is successful or if you already own TOR router, false otherwise.

    Remarks

    RAM cost: 2 GB * 16/4/1

    This function allows you to automatically purchase a TOR router. The cost for purchasing a TOR router using this function is the same as if you were to manually purchase one.

  • Quit jobs by company.

    Parameters

    • Optional companyName: CompanyName | "ECorp" | "MegaCorp" | "Bachman & Associates" | "Blade Industries" | "NWO" | "Clarke Incorporated" | "OmniTek Incorporated" | "Four Sigma" | "KuaiGong International" | "Fulcrum Technologies" | "Storm Technologies" | "DefComm" | "Helios Labs" | "VitaLife" | "Icarus Microsystems" | "Universal Energy" | "Galactic Cybersystems" | "AeroCorp" | "Omnia Cybersystems" | "Solaris Space Systems" | "DeltaOne" | "Global Pharmaceuticals" | "Nova Medical" | "Central Intelligence Agency" | "National Security Agency" | "Watchdog Security" | "LexoCorp" | "Rho Construction" | "Alpha Enterprises" | "Aevum Police Headquarters" | "SysCore Securities" | "CompuTek" | "NetLink Technologies" | "Carmichael Security" | "FoodNStuff" | "Joe's Guns" | "Omega Software" | "Noodle Bar"

      Name of the company.

    Returns void

    Remarks

    RAM cost: 3 GB * 16/4/1

    This function will finish work with the company provided and quit any jobs.

  • Set the players focus.

    Parameters

    • focus: boolean

    Returns boolean

    True if the focus was changed.

    Remarks

    RAM cost: 0.1 GB * 16/4/1

  • Soft reset the game.

    Parameters

    • cbScript: string

      This is a script that will automatically be run after Augmentations are installed (after the reset). This script will be run with no arguments and 1 thread. It must be located on your home computer.

    Returns void

    Remarks

    RAM cost: 5 GB * 16/4/1

    This function will perform a reset even if you don’t have any augmentation installed.

  • Stop the current action.

    Returns boolean

    True if the player’s action was ended, false if the player was 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.

    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

    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.

  • Travel to another city.

    Parameters

    • city: CityName | "Aevum" | "Chongqing" | "Sector-12" | "New Tokyo" | "Ishima" | "Volhaven"

      City to travel to.

    Returns boolean

    True if action is successful, false otherwise.

    Remarks

    RAM cost: 2 GB * 16/4/1

    This function allows the player to travel to any city. The cost for using this function is the same as the cost for traveling through the Travel Agency.

  • Take university class.

    Parameters

    • universityName: string

      Name of university. You must be in the correct city for whatever university you specify.

    • courseName: string

      Name of course.

    • Optional focus: boolean

      Acquire player focus on this class. Optional. Defaults to true.

    Returns boolean

    True if action is successfully started, false otherwise.

    Remarks

    RAM cost: 2 GB * 16/4/1

    This function will automatically set you to start taking a course at a university. If you are already in the middle of some “working” action (such as working at a company, for a faction, or on a program), then running this function will automatically cancel that action and give you your earnings.

    The cost and experience gains for all of these universities and classes are the same as if you were to manually visit and take these classes.

  • Upgrade home computer cores.

    Returns boolean

    True if the player’s home computer cores is successfully upgraded, and false otherwise.

    Remarks

    RAM cost: 3 GB * 16/4/1

    This function will upgrade amount of cores on the player’s home computer. The cost is the same as if you were to do it manually.

    This function will return true if the player’s home computer cores is successfully upgraded, and false otherwise.

  • Upgrade home computer RAM.

    Returns boolean

    True if the player’s home computer RAM is successfully upgraded, and false otherwise.

    Remarks

    RAM cost: 3 GB * 16/4/1

    This function will upgrade amount of RAM on the player’s home computer. The cost is the same as if you were to do it manually.

    This function will return true if the player’s home computer RAM is successfully upgraded, and false otherwise.

  • Work for a company.

    Parameters

    • companyName: CompanyName

      Name of company to work for. Must be an exact match. Optional. If not specified, this argument defaults to the last job that you worked.

    • Optional focus: boolean

      Acquire player focus on this work operation. Optional. Defaults to true.

    Returns boolean

    True if the player starts working, and false otherwise.

    Remarks

    RAM cost: 3 GB * 16/4/1

    This function will set you to start working at your current job at a specified company at which you are employed. If you are already in the middle of some “working” action (such as working for a faction, training at a gym, or creating a program), then running this function will cancel that action.

    This function will return true if the player starts working, and false otherwise.

    Example

    const companyName = "Noodle Bar";
    const success = ns.singularity.workForCompany(companyName);
    if (!success) ns.tprint(`ERROR: Failed to start work at ${companyName}.`);
  • Work for a faction.

    Parameters

    • faction: string

      Name of faction to work for.

    • workType: FactionWorkType | "hacking" | "field" | "security"

      Type of work to perform for the faction.

    • Optional focus: boolean

      Acquire player focus on this work operation. Optional. Defaults to true.

    Returns boolean

    True if the player starts working, and false otherwise.

    Remarks

    RAM cost: 3 GB * 16/4/1

    This function will set you to start working for the specified faction. You must be a member of the faction and that faction must have the specified work type, or else this function will fail. If you are already in the middle of some “working” action (such as working for a company, training at a gym, or creating a program), then running this function will cancel that action.

    This function will return true if you successfully start working for the specified faction, and false otherwise.

    Example

    const factionName = "CyberSec";
    const workType = "hacking";

    let success = ns.singularity.workForFaction(factionName, workType);
    if (!success) ns.tprint(`ERROR: Failed to start work for ${factionName} with work type ${workType}.`)