Ascend a gang member.
Name of member to ascend.
Object with info about the ascension results, or undefined if ascension did not occur.
RAM cost: 4 GB
Ascend the specified Gang Member.
Check if you can recruit a new gang member.
True if a member can currently be recruited, false otherwise.
RAM cost: 1 GB
Returns a boolean indicating whether a member can currently be recruited.
Once you have successfully created a gang by using the function createGang, you can immediately recruit a small number of members to your gang. After you have recruited the founding members, to recruit another member you must increase your respect. The more members you want to recruit, the more respect you require. If your gang has the maximum number of members, then this function would return false.
Get the result of an ascension without ascending.
Name of member.
Object with info about the ascension results, or undefined if ascension is not possible.
RAM cost: 2 GB
Get a GangMemberAscension result for ascending a gang member without performing the ascension.
Get bonus time.
Bonus time for the Gang mechanic in milliseconds.
RAM cost: 0 GB
Returns the amount of accumulated “bonus time” (milliseconds) for the Gang 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 25x the normal speed.
Get chance to win clash with other gang.
Target gang
Chance you have to win a clash with the specified gang.
RAM cost: 4 GB
Returns the chance you have to win a clash with the specified gang. The chance is returned in decimal form, not percentage
Get cost of equipment.
Name of equipment.
Cost to purchase the specified Equipment/Augmentation (number). Infinity for invalid arguments
RAM cost: 2 GB
Get the amount of money it takes to purchase a piece of Equipment or an Augmentation. If an invalid Equipment/Augmentation is specified, this function will return Infinity.
Get stats of an equipment.
Name of equipment.
A dictionary containing the stats of the equipment.
RAM cost: 2 GB
Get the specified equipment stats.
Get information about your gang.
Object containing general information about the gang.
RAM cost: 2 GB
Get general information about the gang.
Get the effect of an install on ascension multipliers without installing.
Name of member.
Object with info about the install results on ascension multipliers, or undefined if ascension is not possible.
RAM cost: 2 GB
Get GangMemberInstall effects on ascension multipliers for a gang member after installing without performing the install.
Get information about a specific gang member.
Name of member.
Object containing stat and equipment-related information about a Gang Member.
RAM cost: 2 GB
Get stat and equipment-related information about a Gang Member
Get information about the other gangs.
Object containing territory and power information about all gangs.
RAM cost: 2 GB
Get territory and power information about all gangs.
Get stats of a task.
Name of the task.
Detailed stats of a task.
RAM cost: 1 GB
Get the stats of a gang task stats. This is typically used to evaluate which action should be executed next.
Sleeps until the next Gang update has happened.
Promise that resolves to the number of milliseconds of Gang time that were processed in the previous update (2000 - 5000 ms).
RAM cost: 1 GB
The amount of real time spent asleep between updates can vary due to "bonus time".
while (true) {
const duration = await ns.gang.nextUpdate();
ns.print(`Gang completed ${ns.tFormat(duration)} of activity.`);
ns.print(`Bonus time remaining: ${ns.tFormat(ns.gang.getBonusTime())}`);
// Manage the Gang
}
Purchase an equipment for a gang member.
Name of Gang member to purchase the equipment for.
Name of Equipment/Augmentation to purchase.
True if the equipment was successfully purchased. False otherwise
RAM cost: 4 GB
Attempt to purchase the specified Equipment/Augmentation for the specified Gang member.
Recruit a new gang member.
Name of member to recruit.
True if the member was successfully recruited, false otherwise.
RAM cost: 2 GB
Attempt to recruit a new gang member.
Possible reasons for failure:
Rename a Gang member to a new unique name.
Name of the member to change.
New name for that gang member.
True if successful, and false if not.
RAM cost: 0 GB
Rename a Gang Member if none already has the new name.
Set gang member to task.
Name of Gang member to assign.
Task to assign.
True if the Gang Member was successfully assigned to the task, false otherwise.
RAM cost: 2 GB
Attempts to assign the specified Gang Member to the specified task. If an invalid task is specified, the Gang member will be set to idle (“Unassigned”).
Gang API
Remarks
If you are not in BitNode-2, then you must have Source-File 2 in order to use this API.