Apply for a job at a company.
Name of company to apply to.
Field to which you want to apply.
True if the player successfully get a job/promotion, and false otherwise.
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.
List all current faction invitations.
Array with the name of all Factions you currently have outstanding invitations from.
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.
Name of crime to attempt.
Optional focus: booleanAcquire player focus on this crime. Optional. Defaults to true.
The number of milliseconds it takes to attempt the specified crime.
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).
Create a program.
Name of program to create.
Optional focus: booleanAcquire player focus on this program creation. Optional. Defaults to true.
True if you successfully start working on the specified program, and false otherwise.
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:
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.
BN number to jump to
Optional callbackScript: stringName of the script to launch in the next BN.
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.
Name of faction to donate to.
Amount of money to donate.
True if the money was donated, and false otherwise.
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.
Get a list of faction(s) that have a specific Augmentation.
Name of Augmentation.
Array containing the names of all factions.
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.
Name of Augmentation.
Array with the names of the prerequisite Augmentation(s) for the specified Augmentation.
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 the stats of an augmentation.
Name of Augmentation. CASE-SENSITIVE.
Augmentation stats.
RAM cost: 5 GB * 16/4/1
This function returns augmentation stats.
Get a list of augmentation available from a faction.
Name of faction.
Array containing the names of all Augmentations.
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.
Name of the company.
Amount of favor you have at the specified company.
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.
Name of the company.
Amount of favor you gain at the specified company when you reset by installing Augmentations.
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.
Name of company to get the requirements for. Must be an exact match.
Name of position to get the requirements for. Must be an exact match.
CompanyPositionInfo object.
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.
const companyName = "ECorp";
const position = "Chief Executive Officer";
let requirements = ns.singularity.getCompanyPositionInfo(companyName, position);
Get List of Company Positions.
Name of company to get the position list for. Must be an exact match.
The position list if the company name is valid.
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.
const companyName = "Noodle Bar";
const jobList = ns.singularity.getCompanyPositions(companyName);
Get company reputation.
Name of the company.
Amount of reputation you have at the specified company.
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.
Name of crime.
Chance of success at committing the specified crime.
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.
Name of crime.
The stats of the crime.
RAM cost: 5 GB * 16/4/1
Returns the stats of the crime.
Check the price of an exploit on the dark web
Name of program to check the price of
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
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.
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.
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.
const programs = ns.getDarkwebPrograms();
ns.tprint(`Available programs are: ${programs.split(", ")}`);
Get a list of enemies of a faction.
Name of faction.
Array containing the names of all enemies of the faction.
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 gain.
Name of faction.
Amount of favor you will gain for the specified faction when you reset by installing Augmentations.
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.
Name of the faction
Array of PlayerRequirement objects which must all be fulfilled to receive an invitation.
RAM cost: 3 GB * 16/4/1
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 a list of owned augmentation.
Optional purchased: booleanSpecifies 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.
Array containing the names (as strings) of all Augmentations you have.
RAM cost: 5 GB * 16/4/1
This function returns an array containing the names (as strings) of all Augmentations you have.
Get a list of acquired Source-Files.
Array containing an object with number and level of the source file.
RAM cost: 5 GB
Returns an array of source files
Workout at the gym.
Name of gym. You must be in the correct city for whatever gym you specify.
The stat you want to train.
Optional focus: booleanAcquire player focus on this gym workout. Optional. Defaults to true.
True if action is successfully started, false otherwise.
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.
Optional cbScript: stringThis 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.
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.
Check if the player is busy.
True if the player is currently performing an ‘action’, false otherwise.
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.
Purchase an augmentation
Name of faction to purchase Augmentation from.
Name of Augmentation to purchase.
True if the Augmentation is successfully purchased, and false otherwise.
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.
Name of program to purchase.
True if the specified program is purchased, and false otherwise.
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.
const programName = "BruteSSH.exe"
const success = ns.purchaseProgram(programName);
if (!success) ns.tprint("ERROR: Failed to purchase ${programName}")
Purchase the TOR router.
True if action is successful or if you already own TOR router, false otherwise.
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.
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.
RAM cost: 3 GB * 16/4/1
This function will finish work with the company provided and quit any jobs.
Soft reset the game.
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.
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.
True if the player’s action was ended, false if the player was not performing an action.
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:
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.
City to travel to.
True if action is successful, false otherwise.
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.
Name of university. You must be in the correct city for whatever university you specify.
Name of course.
Optional focus: booleanAcquire player focus on this class. Optional. Defaults to true.
True if action is successfully started, false otherwise.
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.
True if the player’s home computer cores is successfully upgraded, and false otherwise.
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.
True if the player’s home computer RAM is successfully upgraded, and false otherwise.
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.
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: booleanAcquire player focus on this work operation. Optional. Defaults to true.
True if the player starts working, and false otherwise.
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.
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.
Name of faction to work for.
Type of work to perform for the faction.
Optional focus: booleanAcquire player focus on this work operation. Optional. Defaults to true.
True if the player starts working, and false otherwise.
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.
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}.`)
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.