Fix tons of typos

This commit is contained in:
Olivier Gagnon 2022-10-09 01:25:31 -04:00
parent f8a3a046de
commit f6f023eeb4
110 changed files with 212 additions and 207 deletions

@ -7,5 +7,5 @@ presence, as indicated by the Bladeburners' ability to destroy it via force.
Also, hydroflame (irl) has stated that the glitch in Ishima is the physical Also, hydroflame (irl) has stated that the glitch in Ishima is the physical
location of the World Daemon in a node. When the player destroys a BitNode, it is location of the World Daemon in a node. When the player destroys a BitNode, it is
currently unknown what becomes of it, or the people trapped within. However, based currently unknown what becomes of it, or the people trapped within. However, based
on the way jump3r and Deadalus help the player to destroy it, doing so is somehow on the way jump3r and Daedalus help the player to destroy it, doing so is somehow
aligned with their goals. aligned with their goals.

@ -101,7 +101,7 @@ export function removeAlias(name: string): boolean {
export function substituteAliases(origCommand: string): string { export function substituteAliases(origCommand: string): string {
const commandArray = origCommand.split(" "); const commandArray = origCommand.split(" ");
if (commandArray.length > 0) { if (commandArray.length > 0) {
// For the alias and unalias commands, dont substite // For the alias and unalias commands, don't substitute
if (commandArray[0] === "unalias" || commandArray[0] === "alias") { if (commandArray[0] === "unalias" || commandArray[0] === "alias") {
return commandArray.join(" "); return commandArray.join(" ");
} }

@ -607,7 +607,7 @@ export class Augmentation {
return Generic_toJSON("Augmentation", this); return Generic_toJSON("Augmentation", this);
} }
// Initiatizes a Augmentation object from a JSON save state. // Initializes a Augmentation object from a JSON save state.
static fromJSON(value: IReviverValue): Augmentation { static fromJSON(value: IReviverValue): Augmentation {
return Generic_fromJSON(Augmentation, value.data); return Generic_fromJSON(Augmentation, value.data);
} }

@ -61,7 +61,7 @@ export function getGenericAugmentationPriceMultiplier(): number {
return Math.pow(getBaseAugmentationPriceMultiplier(), Player.queuedAugmentations.length); return Math.pow(getBaseAugmentationPriceMultiplier(), Player.queuedAugmentations.length);
} }
//Resets an Augmentation during (re-initizliation) //Resets an Augmentation during (re-initialization)
function resetAugmentation(aug: Augmentation): void { function resetAugmentation(aug: Augmentation): void {
aug.addToFactions(aug.factions); aug.addToFactions(aug.factions);
const name = aug.name; const name = aug.name;

@ -150,8 +150,8 @@ export const initSoAAugmentations = (): Augmentation[] => [
repCost: 1e4, repCost: 1e4,
moneyCost: 1e6, moneyCost: 1e6,
info: info:
"Extra-occular neurons taken from old martial art master. Injecting them gives the user the ability to " + "Extra-ocular neurons taken from old martial art master. Injecting them gives the user the ability to " +
"predict the enemy's attack before they even know it themself.", "predict the enemy's attack before they even know it themselves.",
stats: ( stats: (
<>This augmentation makes the Slash minigame easier by showing you via an indicator when the slash in coming.</> <>This augmentation makes the Slash minigame easier by showing you via an indicator when the slash in coming.</>
), ),
@ -617,7 +617,7 @@ export const initGeneralAugmentations = (): Augmentation[] => [
info: info:
"Electrical signals are used to induce a new, artificial form of myelinogenesis in the human body. " + "Electrical signals are used to induce a new, artificial form of myelinogenesis in the human body. " +
"This process results in the proliferation of new, synthetic myelin sheaths in the nervous " + "This process results in the proliferation of new, synthetic myelin sheaths in the nervous " +
"system. These myelin sheaths can propogate neuro-signals much faster than their organic " + "system. These myelin sheaths can propagate neuro-signals much faster than their organic " +
"counterparts, leading to greater processing speeds and better brain function.", "counterparts, leading to greater processing speeds and better brain function.",
hacking_speed: 1.03, hacking_speed: 1.03,
hacking_exp: 1.1, hacking_exp: 1.1,
@ -1519,7 +1519,7 @@ export const initGeneralAugmentations = (): Augmentation[] => [
moneyCost: 2e9, moneyCost: 2e9,
info: info:
"A 'Probability Computation Matrix' is installed in the frontal cortex. This implant " + "A 'Probability Computation Matrix' is installed in the frontal cortex. This implant " +
"uses advanced mathematical algorithims to rapidly identify and compute statistical " + "uses advanced mathematical algorithms to rapidly identify and compute statistical " +
"outcomes of nearly every situation.", "outcomes of nearly every situation.",
charisma: 1.0777, charisma: 1.0777,
charisma_exp: 1.0777, charisma_exp: 1.0777,
@ -1535,7 +1535,7 @@ export const initGeneralAugmentations = (): Augmentation[] => [
name: AugmentationNames.INFRARet, name: AugmentationNames.INFRARet,
repCost: 7.5e3, repCost: 7.5e3,
moneyCost: 3e7, moneyCost: 3e7,
info: "A tiny chip that sits behind the retinae. This implant lets the user visually detect infrared radiation.", info: "A tiny chip that sits behind the retina. This implant lets the user visually detect infrared radiation.",
crime_success: 1.25, crime_success: 1.25,
crime_money: 1.1, crime_money: 1.1,
dexterity: 1.1, dexterity: 1.1,
@ -1932,7 +1932,7 @@ export const initBladeburnerAugmentations = (): Augmentation[] => [
"weaponized by Bladeburner units to be used against Synthoids.", "weaponized by Bladeburner units to be used against Synthoids.",
stats: ( stats: (
<> <>
This augmentation allows you to perform Bladeburner actions and other actions (such as working, commiting This augmentation allows you to perform Bladeburner actions and other actions (such as working, committing
crimes, etc.) at the same time. crimes, etc.) at the same time.
</> </>
), ),

@ -36,7 +36,7 @@ const NeuroFluxDisplay = (): React.ReactElement => {
<Typography variant="h5">Bitburner blood donation community program</Typography> <Typography variant="h5">Bitburner blood donation community program</Typography>
<Typography> <Typography>
The blood donation program is a continuous real life event started on 2022-04-01. To participate simply go The blood donation program is a continuous real life event started on 2022-04-01. To participate simply go
donate blood, plasma, or platelets to your local organisation and take a picture as proof (hide your personal donate blood, plasma, or platelets to your local organization and take a picture as proof (hide your personal
information). Then send the proof to hydroflame on reddit or discord. information). Then send the proof to hydroflame on reddit or discord.
</Typography> </Typography>
<Typography>Currently accumulated {CONSTANTS.Donations} donations.</Typography> <Typography>Currently accumulated {CONSTANTS.Donations} donations.</Typography>

@ -83,7 +83,7 @@ export interface IBitNodeMultipliers {
/** /**
* Influences how much money is produced by Hacknet Nodes. * Influences how much money is produced by Hacknet Nodes.
* Influeces the hash rate of Hacknet Servers (unlocked in BitNode-9) * Influences the hash rate of Hacknet Servers (unlocked in BitNode-9)
*/ */
HacknetNodeMoney: number; HacknetNodeMoney: number;
@ -130,7 +130,7 @@ export interface IBitNodeMultipliers {
/** Influences the growth percentage per cycle against a server. */ /** Influences the growth percentage per cycle against a server. */
ServerGrowthRate: number; ServerGrowthRate: number;
/** Influences the maxmimum money that a server can grow to. */ /** Influences the maximum money that a server can grow to. */
ServerMaxMoney: number; ServerMaxMoney: number;
/** Influences the initial money that a server starts with. */ /** Influences the initial money that a server starts with. */

@ -299,7 +299,7 @@ function StanekMults({ mults }: IMultsProps): React.ReactElement {
const extraSize = mults.StaneksGiftExtraSize.toFixed(3); const extraSize = mults.StaneksGiftExtraSize.toFixed(3);
const rows: IBNMultRows = { const rows: IBNMultRows = {
StnakesGiftPowerMultiplier: { name: "Gift Power" }, StaneksGiftPowerMultiplier: { name: "Gift Power" },
StaneksGiftExtraSize: { StaneksGiftExtraSize: {
name: "Base Size Modifier", name: "Base Size Modifier",
content: `${mults.StaneksGiftExtraSize > defaultMultipliers.StaneksGiftExtraSize ? `+${extraSize}` : extraSize}`, content: `${mults.StaneksGiftExtraSize > defaultMultipliers.StaneksGiftExtraSize ? `+${extraSize}` : extraSize}`,

@ -696,7 +696,7 @@ export class Bladeburner {
// Set variables // Set variables
if (args.length === 4) { if (args.length === 4) {
const variable = args[1].toLowerCase(); // allows Action Type to be with or without capitalisation. const variable = args[1].toLowerCase(); // allows Action Type to be with or without capitalization.
const val = args[2]; const val = args[2];
let highLow = false; // True for high, false for low let highLow = false; // True for high, false for low
@ -1416,7 +1416,7 @@ export class Bladeburner {
this.resetAction(); // Stop regardless of success or fail this.resetAction(); // Stop regardless of success or fail
// Calculate team lossses // Calculate team losses
if (teamCount >= 1) { if (teamCount >= 1) {
const losses = getRandomInt(1, teamLossMax); const losses = getRandomInt(1, teamLossMax);
this.teamSize -= losses; this.teamSize -= losses;
@ -1645,7 +1645,7 @@ export class Bladeburner {
} }
// If the previous action went past its completion time, add to the next action // If the previous action went past its completion time, add to the next action
// This is not added inmediatly in case the automation changes the action // This is not added immediately in case the automation changes the action
this.actionTimeCurrent += seconds + this.actionTimeOverflow; this.actionTimeCurrent += seconds + this.actionTimeOverflow;
this.actionTimeOverflow = 0; this.actionTimeOverflow = 0;
if (this.actionTimeCurrent >= this.actionTimeToComplete) { if (this.actionTimeCurrent >= this.actionTimeToComplete) {
@ -2382,7 +2382,7 @@ export class Bladeburner {
return Generic_toJSON("Bladeburner", this); return Generic_toJSON("Bladeburner", this);
} }
/** Initiatizes a Bladeburner object from a JSON save state. */ /** Initializes a Bladeburner object from a JSON save state. */
static fromJSON(value: IReviverValue): Bladeburner { static fromJSON(value: IReviverValue): Bladeburner {
return Generic_fromJSON(Bladeburner, value.data); return Generic_fromJSON(Bladeburner, value.data);
} }

@ -59,7 +59,7 @@ export class City {
improvePopulationEstimateByCount(n: number): void { improvePopulationEstimateByCount(n: number): void {
if (isNaN(n)) { if (isNaN(n)) {
throw new Error("NaN passeed into City.improvePopulationEstimateByCount()"); throw new Error("NaN passed into City.improvePopulationEstimateByCount()");
} }
if (this.popEst < this.pop) { if (this.popEst < this.pop) {
this.popEst += n; this.popEst += n;
@ -162,7 +162,7 @@ export class City {
return Generic_toJSON("City", this); return Generic_toJSON("City", this);
} }
/** Initiatizes a City object from a JSON save state. */ /** Initializes a City object from a JSON save state. */
static fromJSON(value: IReviverValue): City { static fromJSON(value: IReviverValue): City {
return Generic_fromJSON(City, value.data); return Generic_fromJSON(City, value.data);
} }

@ -57,7 +57,7 @@ export const BlackOperations: {
<> <>
Several months ago Titan Laboratories' Bioengineering department was infiltrated by Synthoids. As far as we Several months ago Titan Laboratories' Bioengineering department was infiltrated by Synthoids. As far as we
know, Titan Laboratories' management has no knowledge about this. We don't know what the Synthoids are up to, know, Titan Laboratories' management has no knowledge about this. We don't know what the Synthoids are up to,
but the research that they could be conducting using Titan Laboraties' vast resources is potentially very but the research that they could be conducting using Titan Laboratories' vast resources is potentially very
dangerous. dangerous.
<br /> <br />
<br /> <br />
@ -215,7 +215,7 @@ export const BlackOperations: {
desc: ( desc: (
<> <>
DreamSense Technologies is an advertising company that uses special technology to transmit their ads into the DreamSense Technologies is an advertising company that uses special technology to transmit their ads into the
people's dreams and subconcious. They do this using broadcast transmitter towers. Based on information from our people's dreams and subconscious. They do this using broadcast transmitter towers. Based on information from our
agents and informants in {CityName.Chongqing}, we have reason to believe that one of the broadcast towers there agents and informants in {CityName.Chongqing}, we have reason to believe that one of the broadcast towers there
has been compromised by Synthoids and is being used to spread pro-Synthoid propaganda. has been compromised by Synthoids and is being used to spread pro-Synthoid propaganda.
<br /> <br />

@ -79,7 +79,7 @@ export function Stats(props: IProps): React.ReactElement {
<br /> <br />
Once your stamina falls below 50% of its max value, it begins to negatively affect the success rate of Once your stamina falls below 50% of its max value, it begins to negatively affect the success rate of
your contracts/operations. This penalty is shown in the overview panel. If the penalty is 15%, then this your contracts/operations. This penalty is shown in the overview panel. If the penalty is 15%, then this
means your success rate would be multipled by 85% (100 - 15). means your success rate would be multiplied by 85% (100 - 15).
<br /> <br />
<br /> <br />
Your max stamina and stamina gain rate can also be increased by training, or through skills and Your max stamina and stamina gain rate can also be increased by training, or through skills and
@ -123,7 +123,8 @@ export function Stats(props: IProps): React.ReactElement {
<Tooltip <Tooltip
title={ title={
<Typography> <Typography>
This is your Bladeburner divison's estimate of how many Synthoid communities exist in your current city. This is your Bladeburner division's estimate of how many Synthoid communities exist in your current
city.
</Typography> </Typography>
} }
> >

@ -70,7 +70,7 @@ export class Blackjack extends React.Component<Record<string, never>, State> {
return; return;
} }
// Take money from player right away so that player's dont just "leave" to avoid the loss (I mean they could // Take money from player right away so that players don't just "leave" to avoid the loss (I mean they could
// always reload without saving but w.e) TODO: Save/Restore the RNG state to limit the value of save-scumming. // always reload without saving but w.e) TODO: Save/Restore the RNG state to limit the value of save-scumming.
win(-this.state.bet); win(-this.state.bet);
@ -128,7 +128,7 @@ export class Blackjack extends React.Component<Record<string, never>, State> {
valuesUnder21.sort((a, b) => a - b); valuesUnder21.sort((a, b) => a - b);
return valuesUnder21[valuesUnder21.length - 1]; return valuesUnder21[valuesUnder21.length - 1];
} else { } else {
// Just return the first value. It doesnt really matter anyways since hand is buted // Just return the first value. It doesn't really matter anyways since hand is busted.
return handValues[0]; return handValues[0];
} }
}; };
@ -248,7 +248,7 @@ export class Blackjack extends React.Component<Record<string, never>, State> {
bet: 0, bet: 0,
betInput, betInput,
wagerInvalid: true, wagerInvalid: true,
wagerInvalidHelperText: "Must bet a postive amount", wagerInvalidHelperText: "Must bet a positive amount",
}); });
} else if (wager > MAX_BET) { } else if (wager > MAX_BET) {
this.setState({ this.setState({

@ -21,7 +21,7 @@ export class Deck {
return this.cards.shift() as Card; // Guaranteed to return a Card since we throw an Error if array is empty return this.cards.shift() as Card; // Guaranteed to return a Card since we throw an Error if array is empty
} }
// Draws a card, resetting the deck beforehands if the Deck is empty // Draws a card, resetting the deck beforehand if the Deck is empty
safeDrawCard(): Card { safeDrawCard(): Card {
if (this.cards.length === 0) { if (this.cards.length === 0) {
this.reset(); this.reset();

@ -166,7 +166,7 @@ export class CodingContract {
return Generic_toJSON("CodingContract", this); return Generic_toJSON("CodingContract", this);
} }
/** Initiatizes a CodingContract from a JSON save state. */ /** Initializes a CodingContract from a JSON save state. */
static fromJSON(value: IReviverValue): CodingContract { static fromJSON(value: IReviverValue): CodingContract {
return Generic_fromJSON(CodingContract, value.data); return Generic_fromJSON(CodingContract, value.data);
} }

@ -137,7 +137,7 @@ export class Company {
return Generic_toJSON("Company", this); return Generic_toJSON("Company", this);
} }
/** Initiatizes a Company from a JSON save state. */ /** Initializes a Company from a JSON save state. */
static fromJSON(value: IReviverValue): Company { static fromJSON(value: IReviverValue): Company {
return Generic_fromJSON(Company, value.data); return Generic_fromJSON(Company, value.data);
} }

@ -4,7 +4,7 @@ import * as posNames from "./companypositionnames";
export const companyPositionMetadata: IConstructorParams[] = [ export const companyPositionMetadata: IConstructorParams[] = [
{ {
name: posNames.SoftwareCompanyPositions[0], // Software Enginering Intern name: posNames.SoftwareCompanyPositions[0], // Software Engineering Intern
nextPosition: posNames.SoftwareCompanyPositions[1], // Junior Software Engineer nextPosition: posNames.SoftwareCompanyPositions[1], // Junior Software Engineer
baseSalary: 33, baseSalary: 33,
charismaEffectiveness: 15, charismaEffectiveness: 15,
@ -168,7 +168,7 @@ export const companyPositionMetadata: IConstructorParams[] = [
}, },
{ {
name: posNames.NetworkEngineerCompanyPositions[0], // Network Engineer name: posNames.NetworkEngineerCompanyPositions[0], // Network Engineer
nextPosition: posNames.NetworkEngineerCompanyPositions[1], // Network Adminsitrator nextPosition: posNames.NetworkEngineerCompanyPositions[1], // Network Administrator
baseSalary: 121, baseSalary: 121,
charismaEffectiveness: 15, charismaEffectiveness: 15,
charismaExpGain: 0.05, charismaExpGain: 0.05,

@ -61,7 +61,7 @@ export class Corporation {
addFunds(amt: number): void { addFunds(amt: number): void {
if (!isFinite(amt)) { if (!isFinite(amt)) {
console.error("Trying to add invalid amount of funds. Report to a developper."); console.error("Trying to add invalid amount of funds. Report to a developer.");
return; return;
} }
this.funds = this.funds + amt; this.funds = this.funds + amt;
@ -451,7 +451,7 @@ export class Corporation {
return Generic_toJSON("Corporation", this); return Generic_toJSON("Corporation", this);
} }
/** Initiatizes a Corporation object from a JSON save state. */ /** Initializes a Corporation object from a JSON save state. */
static fromJSON(value: IReviverValue): Corporation { static fromJSON(value: IReviverValue): Corporation {
return Generic_fromJSON(Corporation, value.data); return Generic_fromJSON(Corporation, value.data);
} }

@ -32,7 +32,7 @@ export class CorporationState {
return Generic_toJSON("CorporationState", this); return Generic_toJSON("CorporationState", this);
} }
// Initiatizes a CorporationState object from a JSON save state. // Initializes a CorporationState object from a JSON save state.
static fromJSON(value: IReviverValue): CorporationState { static fromJSON(value: IReviverValue): CorporationState {
return Generic_fromJSON(CorporationState, value.data); return Generic_fromJSON(CorporationState, value.data);
} }

@ -85,7 +85,7 @@ export class Employee {
const prodBase = this.mor * this.hap * this.ene * 1e-6; const prodBase = this.mor * this.hap * this.ene * 1e-6;
let prodMult = 0; let prodMult = 0;
switch (this.pos) { switch (this.pos) {
//Calculate productivity based on position. This is multipled by prodBase //Calculate productivity based on position. This is multiplied by prodBase
//to get final value //to get final value
case EmployeePositions.Operations: case EmployeePositions.Operations:
prodMult = 0.6 * effInt + 0.1 * effCha + this.exp + 0.5 * effCre + effEff; prodMult = 0.6 * effInt + 0.1 * effCha + this.exp + 0.5 * effCre + effEff;

@ -39,7 +39,7 @@ export class Industry {
/* The following are factors for how much production/other things are increased by /* The following are factors for how much production/other things are increased by
different factors. The production increase always has diminishing returns, different factors. The production increase always has diminishing returns,
and they are all reprsented by exponentials of < 1 (e.g x ^ 0.5, x ^ 0.8) and they are all represented by exponentials of < 1 (e.g x ^ 0.5, x ^ 0.8)
The number for these represent the exponential. A lower number means more The number for these represent the exponential. A lower number means more
diminishing returns */ diminishing returns */
reFac = 0; //Real estate Factor reFac = 0; //Real estate Factor
@ -386,7 +386,7 @@ export class Industry {
this.state = state; this.state = state;
//At the start of a cycle, store and reset revenue/expenses //At the start of a cycle, store and reset revenue/expenses
//Then calculate salaries and processs the markets //Then calculate salaries and process the markets
if (state === "START") { if (state === "START") {
if (isNaN(this.thisCycleRevenue) || isNaN(this.thisCycleExpenses)) { if (isNaN(this.thisCycleRevenue) || isNaN(this.thisCycleExpenses)) {
console.error("NaN in Corporation's computed revenue/expenses"); console.error("NaN in Corporation's computed revenue/expenses");
@ -895,7 +895,7 @@ export class Industry {
// Make sure theres enough space in warehouse // Make sure theres enough space in warehouse
if (expWarehouse.sizeUsed >= expWarehouse.size) { if (expWarehouse.sizeUsed >= expWarehouse.size) {
// Warehouse at capacity. Exporting doesnt // Warehouse at capacity. Exporting doesn't
// affect revenue so just return 0's // affect revenue so just return 0's
return [0, 0]; return [0, 0];
} else { } else {
@ -1079,7 +1079,7 @@ export class Industry {
// Reverse engineer the 'maxSell' formula // Reverse engineer the 'maxSell' formula
// 1. Set 'maxSell' = prod // 1. Set 'maxSell' = prod
// 2. Substitute formula for 'markup' // 2. Substitute formula for 'markup'
// 3. Solve for 'sCost'roduct.pCost = sCost // 3. Solve for 'sCost', product.pCost = sCost
const numerator = markupLimit; const numerator = markupLimit;
const sqrtNumerator = prod; const sqrtNumerator = prod;
const sqrtDenominator = const sqrtDenominator =
@ -1289,7 +1289,7 @@ export class Industry {
const researchTree = IndustryResearchTrees[this.type]; const researchTree = IndustryResearchTrees[this.type];
if (researchTree === undefined) throw new Error(`Invalid industry "${this.type}"`); if (researchTree === undefined) throw new Error(`Invalid industry "${this.type}"`);
// Since ResearchTree data isnt saved, we'll update the Research Tree data // Since ResearchTree data isn't saved, we'll update the Research Tree data
// based on the stored 'researched' property in the Industry object // based on the stored 'researched' property in the Industry object
if (Object.keys(researchTree.researched).length !== Object.keys(this.researched).length) { if (Object.keys(researchTree.researched).length !== Object.keys(this.researched).length) {
for (const research of Object.keys(this.researched)) { for (const research of Object.keys(this.researched)) {
@ -1374,7 +1374,7 @@ export class Industry {
return Generic_toJSON("Industry", this); return Generic_toJSON("Industry", this);
} }
/** Initiatizes a Industry object from a JSON save state. */ /** Initializes a Industry object from a JSON save state. */
static fromJSON(value: IReviverValue): Industry { static fromJSON(value: IReviverValue): Industry {
return Generic_fromJSON(Industry, value.data); return Generic_fromJSON(Industry, value.data);
} }

@ -233,7 +233,7 @@ export class Material {
return Generic_toJSON("Material", this); return Generic_toJSON("Material", this);
} }
// Initiatizes a Material object from a JSON save state. // Initializes a Material object from a JSON save state.
static fromJSON(value: IReviverValue): Material { static fromJSON(value: IReviverValue): Material {
return Generic_fromJSON(Material, value.data); return Generic_fromJSON(Material, value.data);
} }

@ -49,7 +49,7 @@ export class Product {
// Variables for handling the creation process of this Product // Variables for handling the creation process of this Product
fin = false; // Whether this Product has finished being created fin = false; // Whether this Product has finished being created
prog = 0; // Creation progress - A number betwee 0-100 representing percentage prog = 0; // Creation progress - A number between 0-100 representing percentage
createCity = ""; // City in which the product is/was being created createCity = ""; // City in which the product is/was being created
designCost = 0; // How much money was invested into designing this Product designCost = 0; // How much money was invested into designing this Product
advCost = 0; // How much money was invested into advertising this Product advCost = 0; // How much money was invested into advertising this Product
@ -267,7 +267,7 @@ export class Product {
return Generic_toJSON("Product", this); return Generic_toJSON("Product", this);
} }
// Initiatizes a Product object from a JSON save state. // Initializes a Product object from a JSON save state.
static fromJSON(value: IReviverValue): Product { static fromJSON(value: IReviverValue): Product {
return Generic_fromJSON(Product, value.data); return Generic_fromJSON(Product, value.data);
} }

@ -63,7 +63,7 @@ export class Node {
return this; return this;
} }
// Recursively search chilren // Recursively search children
let res = null; let res = null;
for (let i = 0; i < this.children.length; ++i) { for (let i = 0; i < this.children.length; ++i) {
res = this.children[i].findNode(text); res = this.children[i].findNode(text);

@ -108,7 +108,7 @@ export class Warehouse {
return Generic_toJSON("Warehouse", this); return Generic_toJSON("Warehouse", this);
} }
// Initiatizes a Warehouse object from a JSON save state. // Initializes a Warehouse object from a JSON save state.
static fromJSON(value: IReviverValue): Warehouse { static fromJSON(value: IReviverValue): Warehouse {
return Generic_fromJSON(Warehouse, value.data); return Generic_fromJSON(Warehouse, value.data);
} }

@ -18,7 +18,7 @@ export enum CorporationUnlockUpgradeIndex {
} }
// Corporation Unlock Upgrades // Corporation Unlock Upgrades
// Upgrades for entire corporation, unlocks features, either you have it or you dont // Upgrades for entire corporation, unlocks features, either you have it or you don't.
export const CorporationUnlockUpgrades: Record<CorporationUnlockUpgradeIndex, CorporationUnlockUpgrade> = { export const CorporationUnlockUpgrades: Record<CorporationUnlockUpgradeIndex, CorporationUnlockUpgrade> = {
//Lets you export goods //Lets you export goods
[CorporationUnlockUpgradeIndex.Export]: { [CorporationUnlockUpgradeIndex.Export]: {

@ -24,7 +24,7 @@ export const researchMetadata: IConstructorParams[] = [
name: "Automatic Drug Administration", name: "Automatic Drug Administration",
cost: 10e3, cost: 10e3,
desc: desc:
"Research how to automatically administer performance-enhacing drugs to all of " + "Research how to automatically administer performance-enhancing drugs to all of " +
"your employees. This unlocks Drug-related Research.", "your employees. This unlocks Drug-related Research.",
}, },
{ {

@ -121,7 +121,7 @@ function ManualManagement(props: IProps): React.ReactElement {
props.rerender(); props.rerender();
} }
// Numeraljs formatter // Numeral.js formatter
const nf = "0.000"; const nf = "0.000";
// Employee stats (after applying multipliers) // Employee stats (after applying multipliers)

@ -132,7 +132,7 @@ export function IndustryOverview(props: IProps): React.ReactElement {
<Tooltip <Tooltip
title={ title={
<> <>
<Typography>Total multiplier for this industrys sales due to its awareness and popularity</Typography> <Typography>Total multiplier for this industry's sales due to its awareness and popularity</Typography>
<StatsTable <StatsTable
rows={[ rows={[
["Awareness Bonus:", "x" + numeralWrapper.formatReallyBigNumber(Math.pow(awarenessFac, 0.85))], ["Awareness Bonus:", "x" + numeralWrapper.formatReallyBigNumber(Math.pow(awarenessFac, 0.85))],

@ -48,9 +48,9 @@ export function MaterialElem(props: IMaterialProps): React.ReactElement {
throw new Error(`Could not get OfficeSpace object for this city (${city})`); throw new Error(`Could not get OfficeSpace object for this city (${city})`);
} }
// Numeraljs formatter // Numeral.js formatter
const nf = "0.000"; const nf = "0.000";
const nfB = "0.000a"; // For numbers that might be biger const nfB = "0.000a"; // For numbers that might be bigger
// Total gain or loss of this material (per second) // Total gain or loss of this material (per second)
const totalGain = mat.buy + mat.prd + mat.imp - mat.sll - mat.totalExp; const totalGain = mat.buy + mat.prd + mat.imp - mat.sll - mat.totalExp;

@ -38,7 +38,7 @@ export function ProductElem(props: IProductProps): React.ReactElement {
const city = props.city; const city = props.city;
const product = props.product; const product = props.product;
// Numeraljs formatters // Numeral.js formatters
const nf = "0.000"; const nf = "0.000";
const nfB = "0.000a"; // For numbers that might be big const nfB = "0.000a"; // For numbers that might be big

@ -61,9 +61,9 @@ export class ActiveFragment {
return this.fragment().fullAt(worldX - this.x, worldY - this.y, this.rotation); return this.fragment().fullAt(worldX - this.x, worldY - this.y, this.rotation);
} }
neighboors(): number[][] { neighbors(): number[][] {
return this.fragment() return this.fragment()
.neighboors(this.rotation) .neighbors(this.rotation)
.map((cell) => [this.x + cell[0], this.y + cell[1]]); .map((cell) => [this.x + cell[0], this.y + cell[1]]);
} }
@ -76,7 +76,7 @@ export class ActiveFragment {
return Generic_toJSON("ActiveFragment", this); return Generic_toJSON("ActiveFragment", this);
} }
/** Initializes an acive fragment from a JSON save state */ /** Initializes an active fragment from a JSON save state */
static fromJSON(value: IReviverValue): ActiveFragment { static fromJSON(value: IReviverValue): ActiveFragment {
return Generic_fromJSON(ActiveFragment, value.data); return Generic_fromJSON(ActiveFragment, value.data);
} }

@ -47,8 +47,8 @@ export class Fragment {
return this.shape[0].length; return this.shape[0].length;
} }
// List of direct neighboors of this fragment. // List of direct neighbors of this fragment.
neighboors(rotation: number): number[][] { neighbors(rotation: number): number[][] {
const candidates: number[][] = []; const candidates: number[][] = [];
const add = (x: number, y: number): void => { const add = (x: number, y: number): void => {
@ -58,7 +58,7 @@ export class Fragment {
}; };
for (let y = 0; y < this.height(rotation); y++) { for (let y = 0; y < this.height(rotation); y++) {
for (let x = 0; x < this.width(rotation); x++) { for (let x = 0; x < this.width(rotation); x++) {
// This cell is full, add all it's neighboors. // This cell is full, add all it's neighbors.
if (!this.fullAt(x, y, rotation)) continue; if (!this.fullAt(x, y, rotation)) continue;
add(x - 1, y); add(x - 1, y);
add(x + 1, y); add(x + 1, y);

@ -58,19 +58,19 @@ export class StaneksGift extends BaseGift {
} }
effect(fragment: ActiveFragment): number { effect(fragment: ActiveFragment): number {
// Find all the neighbooring cells // Find all the neighboring cells
const cells = fragment.neighboors(); const cells = fragment.neighbors();
// find the neighbooring active fragments. // find the neighboring active fragments.
const maybeFragments = cells.map((n) => this.fragmentAt(n[0], n[1])); const maybeFragments = cells.map((n) => this.fragmentAt(n[0], n[1]));
// Filter out undefined with typescript "Type guard". Whatever // Filter out undefined with typescript "Type guard". Whatever
let neighboors = maybeFragments.filter((v: ActiveFragment | undefined): v is ActiveFragment => !!v); let neighbors = maybeFragments.filter((v: ActiveFragment | undefined): v is ActiveFragment => !!v);
neighboors = neighboors.filter((fragment) => fragment.fragment().type === FragmentType.Booster); neighbors = neighbors.filter((fragment) => fragment.fragment().type === FragmentType.Booster);
let boost = 1; let boost = 1;
neighboors = neighboors.filter((v, i, s) => s.indexOf(v) === i); neighbors = neighbors.filter((v, i, s) => s.indexOf(v) === i);
for (const neighboor of neighboors) { for (const neighboor of neighbors) {
boost *= neighboor.fragment().power; boost *= neighboor.fragment().power;
} }
return CalculateEffect(fragment.highestCharge, fragment.numCharge, fragment.fragment().power, boost); return CalculateEffect(fragment.highestCharge, fragment.numCharge, fragment.fragment().power, boost);

@ -1,10 +1,10 @@
/* /*
The game cannot block every possible exploits. Specially since one of them is The game cannot block every possible exploits. Specially since one of them is
that you can just edit your save file and that's impragmatic to prevent. that you can just edit your save file and that's impractical to prevent.
So instead we have source file minus 1. It is not obtained by destroying a So instead we have source file minus 1. It is not obtained by destroying a
BitNode but instead it is awarded when the player finds innovative ways to break BitNode but instead it is awarded when the player finds innovative ways to break
the game, this serves 2 purpose, [one] the developpers don't have to spend time the game, this serves 2 purpose, [one] the developers don't have to spend time
trying to implement anti-cheat measures and [two] finding ways to break a trying to implement anti-cheat measures and [two] finding ways to break a
hacking game is very much in the spirit of the game. hacking game is very much in the spirit of the game.
Source-File minus 1 is extremely weak because it can be fully level up quickly. Source-File minus 1 is extremely weak because it can be fully level up quickly.

@ -65,7 +65,7 @@ export class Faction {
return Generic_toJSON("Faction", this); return Generic_toJSON("Faction", this);
} }
/** Initiatizes a Faction object from a JSON save state. */ /** Initializes a Faction object from a JSON save state. */
static fromJSON(value: IReviverValue): Faction { static fromJSON(value: IReviverValue): Faction {
return Generic_fromJSON(Faction, value.data); return Generic_fromJSON(Faction, value.data);
} }

@ -26,7 +26,7 @@ export const MiscPage = (): React.ReactElement => {
<> <>
Improved Bash emulation mode. Setting this to 1 enables several new Terminal shortcuts and features that Improved Bash emulation mode. Setting this to 1 enables several new Terminal shortcuts and features that
more closely resemble a real Bash-style shell. Note that when this mode is enabled, the default browser more closely resemble a real Bash-style shell. Note that when this mode is enabled, the default browser
shortcuts are overriden by the new Bash shortcuts. shortcuts are overridden by the new Bash shortcuts.
</> </>
} }
/> />

@ -62,7 +62,7 @@ export class Gang {
// limit is reached, and then calculates and applies the gains only at that limit // limit is reached, and then calculates and applies the gains only at that limit
this.storedCycles = 0; this.storedCycles = 0;
// Separate variable to keep track of cycles for Territry + Power gang, which // Separate variable to keep track of cycles for Territory + Power gang, which
// happens on a slower "clock" than normal processing // happens on a slower "clock" than normal processing
this.storedTerritoryAndPowerCycles = 0; this.storedTerritoryAndPowerCycles = 0;
@ -399,7 +399,7 @@ export class Gang {
return Generic_toJSON("Gang", this); return Generic_toJSON("Gang", this);
} }
/** Initiatizes a Gang object from a JSON save state. */ /** Initializes a Gang object from a JSON save state. */
static fromJSON(value: IReviverValue): Gang { static fromJSON(value: IReviverValue): Gang {
return Generic_fromJSON(Gang, value.data); return Generic_fromJSON(Gang, value.data);
} }

@ -324,7 +324,7 @@ export class GangMember {
return Generic_toJSON("GangMember", this); return Generic_toJSON("GangMember", this);
} }
/** Initiatizes a GangMember object from a JSON save state. */ /** Initializes a GangMember object from a JSON save state. */
static fromJSON(value: IReviverValue): GangMember { static fromJSON(value: IReviverValue): GangMember {
return Generic_fromJSON(GangMember, value.data); return Generic_fromJSON(GangMember, value.data);
} }

@ -57,9 +57,9 @@ export class GangMemberTask {
this.difficulty = params.difficulty ? params.difficulty : 1; this.difficulty = params.difficulty ? params.difficulty : 1;
// Territory Factors. Exponential factors that dictate how territory affects gains // Territory Factors. Exponential factors that dictate how territory affects gains
// Formula: Territory Mutiplier = (Territory * 100) ^ factor / 100 // Formula: Territory Multiplier = (Territory * 100) ^ factor / 100
// So factor should be > 1 if something should scale exponentially with territory // So factor should be > 1 if something should scale exponentially with territory
// and should be < 1 if it should have diminshing returns // and should be < 1 if it should have diminishing returns
this.territory = params.territory ? params.territory : { money: 1, respect: 1, wanted: 1 }; this.territory = params.territory ? params.territory : { money: 1, respect: 1, wanted: 1 };
} }
} }

@ -400,9 +400,9 @@ function processAllHacknetServerEarnings(numCycles: number): number {
// hacknetNodes array only contains the IP addresses of the servers. // hacknetNodes array only contains the IP addresses of the servers.
// Also, update the hash rate before processing // Also, update the hash rate before processing
const ip = Player.hacknetNodes[i]; const ip = Player.hacknetNodes[i];
if (ip instanceof HacknetNode) throw new Error(`player nodes should not be HacketNode`); if (ip instanceof HacknetNode) throw new Error(`player nodes should not be HacknetNode`);
const hserver = GetServer(ip); const hserver = GetServer(ip);
if (!(hserver instanceof HacknetServer)) throw new Error(`player nodes shoud not be Server`); if (!(hserver instanceof HacknetServer)) throw new Error(`player nodes should not be Server`);
hserver.updateHashRate(Player.mults.hacknet_node_money); hserver.updateHashRate(Player.mults.hacknet_node_money);
const h = hserver.process(numCycles); const h = hserver.process(numCycles);
hashes += h; hashes += h;
@ -536,7 +536,7 @@ export function purchaseHashUpgrade(upgName: string, upgTarget: string, count =
break; break;
} }
case "Exchange for Bladeburner Rank": { case "Exchange for Bladeburner Rank": {
// This will throw if player isnt in Bladeburner // This will throw if player isn't in Bladeburner
const bladeburner = Player.bladeburner; const bladeburner = Player.bladeburner;
if (bladeburner === null) { if (bladeburner === null) {
Player.hashManager.refundUpgrade(upgName, count); Player.hashManager.refundUpgrade(upgName, count);
@ -546,7 +546,7 @@ export function purchaseHashUpgrade(upgName: string, upgTarget: string, count =
break; break;
} }
case "Exchange for Bladeburner SP": { case "Exchange for Bladeburner SP": {
// This will throw if player isnt in Bladeburner // This will throw if player isn't in Bladeburner
const bladeburner = Player.bladeburner; const bladeburner = Player.bladeburner;
if (bladeburner === null) { if (bladeburner === null) {
Player.hashManager.refundUpgrade(upgName, count); Player.hashManager.refundUpgrade(upgName, count);

@ -125,7 +125,7 @@ export class HacknetNode implements IHacknetNode {
return Generic_toJSON("HacknetNode", this); return Generic_toJSON("HacknetNode", this);
} }
/** Initiatizes a HacknetNode object from a JSON save state. */ /** Initializes a HacknetNode object from a JSON save state. */
static fromJSON(value: IReviverValue): HacknetNode { static fromJSON(value: IReviverValue): HacknetNode {
return Generic_fromJSON(HacknetNode, value.data); return Generic_fromJSON(HacknetNode, value.data);
} }

@ -50,7 +50,7 @@ export class HacknetServer extends BaseServer implements IHacknetNode {
// Total number of hashes earned by this server // Total number of hashes earned by this server
totalHashesGenerated = 0; totalHashesGenerated = 0;
// Flag indicating wehther this is a purchased server // Flag indicating whether this is a purchased server
purchasedByPlayer = true; purchasedByPlayer = true;
constructor(params: IConstructorParams = { hostname: "", ip: createRandomIp() }) { constructor(params: IConstructorParams = { hostname: "", ip: createRandomIp() }) {

@ -150,7 +150,7 @@ export class HashManager {
return Generic_toJSON("HashManager", this); return Generic_toJSON("HashManager", this);
} }
// Initiatizes a HashManager object from a JSON save state. // Initializes a HashManager object from a JSON save state.
static fromJSON(value: IReviverValue): HashManager { static fromJSON(value: IReviverValue): HashManager {
return Generic_fromJSON(HashManager, value.data); return Generic_fromJSON(HashManager, value.data);
} }

@ -14,7 +14,7 @@ interface IProps {
export function GameTimer(props: IProps): React.ReactElement { export function GameTimer(props: IProps): React.ReactElement {
const [v, setV] = useState(100); const [v, setV] = useState(100);
const totalMillis = const totalMillis =
(!props.ignoreAugment_WKSharmonizer && player.hasAugmentation(AugmentationNames.WKSharmonizer, true) ? 1.3 : 1) * (!props.ignoreAugment_WKSharmonizer && Player.hasAugmentation(AugmentationNames.WKSharmonizer, true) ? 1.3 : 1) *
props.millis; props.millis;
const tick = 200; const tick = 200;

@ -94,11 +94,11 @@ export const Literatures: Record<string, Literature> = {};
"productivity and bolstering the global economy. Stemming from humanity's desire for technological advancement, optimism " + "productivity and bolstering the global economy. Stemming from humanity's desire for technological advancement, optimism " +
"and excitement about the future had never been higher.<br><br>" + "and excitement about the future had never been higher.<br><br>" +
"All of that excitement and optimism quickly turned to fear, panic, and dread in 2070, when a terrorist group " + "All of that excitement and optimism quickly turned to fear, panic, and dread in 2070, when a terrorist group " +
`called Ascendis Totalis hacked into ${FactionNames.OmniTekIncorporated} and uploaded a rogue AI into severeal of their Synthoid manufacturing facilities. ` + `called Ascendis Totalis hacked into ${FactionNames.OmniTekIncorporated} and uploaded a rogue AI into several of their Synthoid manufacturing facilities. ` +
`This hack went undetected and for months ${FactionNames.OmniTekIncorporated} unknowingly churned out legions of Synthoids embedded with this ` + `This hack went undetected and for months ${FactionNames.OmniTekIncorporated} unknowingly churned out legions of Synthoids embedded with this ` +
"rogue AI. Then, on December 24th, 2070, Omnica activated dormant protocols in the rogue AI, causing all of the " + "rogue AI. Then, on December 24th, 2070, Omnica activated dormant protocols in the rogue AI, causing all of the " +
"infected Synthoids to immediately launch a military campaign to seek and destroy all of humanity.<br><br>" + "infected Synthoids to immediately launch a military campaign to seek and destroy all of humanity.<br><br>" +
"What ensued was the deadlist conflict in human history. This crisis, now commonly known as the Synthoid Uprising, " + "What ensued was the deadliest conflict in human history. This crisis, now commonly known as the Synthoid Uprising, " +
"resulted in almost ten billion deaths over the course of a year. Despite the nations of the world banding together " + "resulted in almost ten billion deaths over the course of a year. Despite the nations of the world banding together " +
"to combat the threat, the MK-VI Synthoids were simply stronger, faster, more intelligent, and more adaptable than humans, " + "to combat the threat, the MK-VI Synthoids were simply stronger, faster, more intelligent, and more adaptable than humans, " +
"outsmarting them at every turn.<br><br>" + "outsmarting them at every turn.<br><br>" +
@ -170,7 +170,7 @@ export const Literatures: Record<string, Literature> = {};
"Proponents for this simulated reality theory often point to how advanced our technology has become, " + "Proponents for this simulated reality theory often point to how advanced our technology has become, " +
"as well as the incredibly fast pace at which it has advanced over the past decades. The amount of computing " + "as well as the incredibly fast pace at which it has advanced over the past decades. The amount of computing " +
"power available to us has increased over 100-fold since 2060 due to the development of nanoprocessors and " + "power available to us has increased over 100-fold since 2060 due to the development of nanoprocessors and " +
"quantum computers. Artifical Intelligence has advanced to the point where our entire lives are controlled " + "quantum computers. Artificial Intelligence has advanced to the point where our entire lives are controlled " +
"by robots and machines that handle our day-to-day activities such as autonomous transportation and scheduling. " + "by robots and machines that handle our day-to-day activities such as autonomous transportation and scheduling. " +
"If we consider the pace at which this technology has advanced and assume that these developments continue, it's " + "If we consider the pace at which this technology has advanced and assume that these developments continue, it's " +
"reasonable to assume that at some point in the future our technology would be advanced enough that " + "reasonable to assume that at some point in the future our technology would be advanced enough that " +
@ -246,7 +246,7 @@ export const Literatures: Record<string, Literature> = {};
"CIA director David Glarow says it's too early to know " + "CIA director David Glarow says it's too early to know " +
"whether these figures indicate the beginning of a sustained increase in crime rates, or whether " + "whether these figures indicate the beginning of a sustained increase in crime rates, or whether " +
"the year was just an unfortunate outlier. He states that many intelligence and law enforcement " + "the year was just an unfortunate outlier. He states that many intelligence and law enforcement " +
"agents have noticed an increase in organized crime activites, and believes that these figures may " + "agents have noticed an increase in organized crime activities, and believes that these figures may " +
`be the result of an uprising from criminal organizations such as ${FactionNames.TheSyndicate} or the ${FactionNames.SlumSnakes}.`; `be the result of an uprising from criminal organizations such as ${FactionNames.TheSyndicate} or the ${FactionNames.SlumSnakes}.`;
Literatures[fn] = new Literature(title, fn, txt); Literatures[fn] = new Literature(title, fn, txt);
@ -260,7 +260,7 @@ export const Literatures: Record<string, Literature> = {};
"that the Singularity would arrive by 2045. " + "that the Singularity would arrive by 2045. " +
"And yet here we are, more than three decades later, where most would agree that we have not " + "And yet here we are, more than three decades later, where most would agree that we have not " +
"yet reached a point where computers and machines are vastly more intelligent than we are. So what gives?<br><br>" + "yet reached a point where computers and machines are vastly more intelligent than we are. So what gives?<br><br>" +
"The answer is that we have reached the Singularity, just not in the way we expected. The artifical superintelligence " + "The answer is that we have reached the Singularity, just not in the way we expected. The artificial superintelligence " +
"that was predicted by Kurzweil and others exists in the world today - in the form of Augmentations. " + "that was predicted by Kurzweil and others exists in the world today - in the form of Augmentations. " +
"Yes, those Augmentations that the rich and powerful keep to themselves enable humans " + "Yes, those Augmentations that the rich and powerful keep to themselves enable humans " +
"to become superintelligent beings. The Singularity did not lead to a world where " + "to become superintelligent beings. The Singularity did not lead to a world where " +
@ -426,7 +426,7 @@ export const Literatures: Record<string, Literature> = {};
"continent.<br><br>" + "continent.<br><br>" +
`Not much else is known about the ${FactionNames.Tetrads}, or about the efforts the Asian governments and corporations are making ` + `Not much else is known about the ${FactionNames.Tetrads}, or about the efforts the Asian governments and corporations are making ` +
`to take down this large new crime organization. Many believe that the ${FactionNames.Tetrads} have infiltrated the governments ` + `to take down this large new crime organization. Many believe that the ${FactionNames.Tetrads} have infiltrated the governments ` +
"and powerful corporations in Asia, which has helped faciliate their recent rapid rise."; "and powerful corporations in Asia, which has helped facilitate their recent rapid rise.";
Literatures[fn] = new Literature(title, fn, txt); Literatures[fn] = new Literature(title, fn, txt);
title = "The Secret War"; title = "The Secret War";

@ -215,7 +215,7 @@ export function SpecialLocation(props: IProps): React.ReactElement {
<Typography> <Typography>
<i> <i>
Allison "Mother" Stanek: ..can ...you hear them too ...? Come now, don't be shy and let me get a closer Allison "Mother" Stanek: ..can ...you hear them too ...? Come now, don't be shy and let me get a closer
look at you. Yes wonderful, I see my creation has taken root without consquence or much ill effect it look at you. Yes wonderful, I see my creation has taken root without consequence or much ill effect it
seems. Curious, Just how much of a machine's soul do you house in that body? seems. Curious, Just how much of a machine's soul do you house in that body?
</i> </i>
</Typography> </Typography>

@ -22,11 +22,13 @@ function sendMessage(msg: Message, forced = false): void {
function showMessage(name: MessageFilenames): void { function showMessage(name: MessageFilenames): void {
const msg = Messages[name]; const msg = Messages[name];
if (!(msg instanceof Message)) throw new Error("trying to display unexistent message"); if (!(msg instanceof Message)) throw new Error("trying to display nonexistent message");
dialogBoxCreate( dialogBoxCreate(
<> <>
Message received from unknown sender:<i>{msg.msg}</i>This message was saved as {msg.filename} onto your home Message received from unknown sender:
computer. <br />
<br />
<i>{msg.msg}</i>This message was saved as {msg.filename} onto your home computer.
</>, </>,
); );
} }

@ -40,7 +40,7 @@ function wrapFunction(
const functionPath = tree.join("."); const functionPath = tree.join(".");
const functionName = tree.pop(); const functionName = tree.pop();
if (typeof functionName !== "string") { if (typeof functionName !== "string") {
throw helpers.makeBasicErrorMsg(workerScript, "Failure occured while wrapping netscript api", "INITIALIZATION"); throw helpers.makeBasicErrorMsg(workerScript, "Failure occurred while wrapping netscript api", "INITIALIZATION");
} }
const ctx = { const ctx = {
workerScript, workerScript,
@ -89,7 +89,7 @@ export function wrapAPILayer(
function setNestedProperty(root: any, value: unknown, ...tree: string[]): void { function setNestedProperty(root: any, value: unknown, ...tree: string[]): void {
let target = root; let target = root;
const key = tree.pop(); const key = tree.pop();
if (!key) throw new Error("Failure occured while wrapping netscript api (setNestedProperty)"); if (!key) throw new Error("Failure occurred while wrapping netscript api (setNestedProperty)");
for (const branch of tree) { for (const branch of tree) {
target[branch] ??= {}; target[branch] ??= {};
target = target[branch]; target = target[branch];

@ -2,7 +2,7 @@ import { workerScripts } from "./WorkerScripts";
let pidCounter = 1; let pidCounter = 1;
/** Find and return the next availble PID for a script */ /** Find and return the next available PID for a script */
export function generateNextPid(): number { export function generateNextPid(): number {
let tempCounter = pidCounter; let tempCounter = pidCounter;

@ -24,7 +24,7 @@ import {
numCycleForGrowth, numCycleForGrowth,
numCycleForGrowthCorrected, numCycleForGrowthCorrected,
processSingleServerGrowth, processSingleServerGrowth,
safetlyCreateUniqueServer, safelyCreateUniqueServer,
} from "./Server/ServerHelpers"; } from "./Server/ServerHelpers";
import { getPurchaseServerCost, getPurchaseServerLimit, getPurchaseServerMaxRam } from "./Server/ServerPurchases"; import { getPurchaseServerCost, getPurchaseServerLimit, getPurchaseServerMaxRam } from "./Server/ServerPurchases";
import { Server } from "./Server/Server"; import { Server } from "./Server/Server";
@ -1363,7 +1363,7 @@ const base: InternalAPI<NS> = {
helpers.log(ctx, () => `Not enough money to purchase server. Need ${numeralWrapper.formatMoney(cost)}`); helpers.log(ctx, () => `Not enough money to purchase server. Need ${numeralWrapper.formatMoney(cost)}`);
return ""; return "";
} }
const newServ = safetlyCreateUniqueServer({ const newServ = safelyCreateUniqueServer({
ip: createUniqueRandomIp(), ip: createUniqueRandomIp(),
hostname: hostnameStr, hostname: hostnameStr,
organizationName: "", organizationName: "",

@ -786,7 +786,7 @@ export function NetscriptSingularity(): InternalAPI<ISingularity> {
return false; return false;
} }
// Make sure player is actually employed at the comapny // Make sure player is actually employed at the company
if (!Object.keys(Player.jobs).includes(companyName)) { if (!Object.keys(Player.jobs).includes(companyName)) {
helpers.log(ctx, () => `You do not have a job at '${companyName}'`); helpers.log(ctx, () => `You do not have a job at '${companyName}'`);
return false; return false;
@ -815,7 +815,7 @@ export function NetscriptSingularity(): InternalAPI<ISingularity> {
Player.stopFocusing(); Player.stopFocusing();
Router.toTerminal(); Router.toTerminal();
} }
helpers.log(ctx, () => `Began working at '${companyName}' as a '${companyPositionName}'`); helpers.log(ctx, () => `Began working at '${companyName}' with position '${companyPositionName}'`);
return true; return true;
}, },
applyToCompany: (ctx: NetscriptContext) => applyToCompany: (ctx: NetscriptContext) =>
@ -878,7 +878,10 @@ export function NetscriptSingularity(): InternalAPI<ISingularity> {
// return false; // return false;
// } // }
if (res) { if (res) {
helpers.log(ctx, () => `You were offered a new job at '${companyName}' as a '${Player.jobs[companyName]}'`); helpers.log(
ctx,
() => `You were offered a new job at '${companyName}' with position '${Player.jobs[companyName]}'`,
);
} else { } else {
helpers.log(ctx, () => `You failed to get a new job/promotion at '${companyName}' in the '${field}' field.`); helpers.log(ctx, () => `You failed to get a new job/promotion at '${companyName}' in the '${field}' field.`);
} }

@ -25,7 +25,7 @@ export async function compile(script: Script, scripts: Script[]): Promise<Script
//If we're already in the middle of compiling (script.module has not resolved yet), wait for the previous compilation to finish //If we're already in the middle of compiling (script.module has not resolved yet), wait for the previous compilation to finish
//If script.module is null, this does nothing. //If script.module is null, this does nothing.
await script.module; await script.module;
//If multiple compiles were called on the same script before a compilation could be completed this ensures only one complilation is actually performed. //If multiple compiles were called on the same script before a compilation could be completed this ensures only one compilation is actually performed.
if (!script.queueCompile) return script.module as Promise<ScriptModule>; if (!script.queueCompile) return script.module as Promise<ScriptModule>;
script.queueCompile = false; script.queueCompile = false;
script.updateRamUsage(scripts); script.updateRamUsage(scripts);

@ -124,7 +124,7 @@ async function startNetscript1Script(workerScript: WorkerScript): Promise<void>
} }
/* Since the JS Interpreter used for Netscript 1.0 only supports ES5, the keyword /* Since the JS Interpreter used for Netscript 1.0 only supports ES5, the keyword
'import' throws an error. However, since we want to support import funtionality 'import' throws an error. However, since we want to support import functionality
we'll implement it ourselves by parsing the Nodes in the AST out. we'll implement it ourselves by parsing the Nodes in the AST out.
@param code - The script's code @param code - The script's code
@ -338,7 +338,7 @@ function createAndAddWorkerScript(runningScriptObj: RunningScript, server: BaseS
// Once the code finishes (either resolved or rejected, doesnt matter), set its // Once the code finishes (either resolved or rejected, doesnt matter), set its
// running status to false // running status to false
.then(function () { .then(function () {
// On natural death, the earnings are transfered to the parent if it still exists. // On natural death, the earnings are transferred to the parent if it still exists.
if (parent && !parent.env.stopFlag) { if (parent && !parent.env.stopFlag) {
parent.scriptRef.onlineExpGained += runningScriptObj.onlineExpGained; parent.scriptRef.onlineExpGained += runningScriptObj.onlineExpGained;
parent.scriptRef.onlineMoneyMade += runningScriptObj.onlineMoneyMade; parent.scriptRef.onlineMoneyMade += runningScriptObj.onlineMoneyMade;
@ -448,7 +448,7 @@ export function runScriptFromScript(
// Check if the script exists and if it does run it // Check if the script exists and if it does run it
for (let i = 0; i < server.scripts.length; ++i) { for (let i = 0; i < server.scripts.length; ++i) {
if (!areFilesEqual(server.scripts[i].filename, scriptname)) continue; if (!areFilesEqual(server.scripts[i].filename, scriptname)) continue;
// Check for admin rights and that there is enough RAM availble to run // Check for admin rights and that there is enough RAM available to run
const script = server.scripts[i]; const script = server.scripts[i];
let ramUsage = script.ramUsage; let ramUsage = script.ramUsage;
threads = Math.floor(Number(threads)); threads = Math.floor(Number(threads));

@ -164,7 +164,7 @@ export class PlayerObject extends Person {
return Generic_toJSON("PlayerObject", this); return Generic_toJSON("PlayerObject", this);
} }
/** Initiatizes a PlayerObject object from a JSON save state. */ /** Initializes a PlayerObject object from a JSON save state. */
static fromJSON(value: IReviverValue): PlayerObject { static fromJSON(value: IReviverValue): PlayerObject {
return Generic_fromJSON(PlayerObject, value.data); return Generic_fromJSON(PlayerObject, value.data);
} }

@ -26,7 +26,7 @@ import { isSleeveCompanyWork } from "../Sleeve/Work/SleeveCompanyWork";
import { calculateSkillProgress as calculateSkillProgressF, ISkillProgress } from "../formulas/skill"; import { calculateSkillProgress as calculateSkillProgressF, ISkillProgress } from "../formulas/skill";
import { GetServer, AddToAllServers, createUniqueRandomIp } from "../../Server/AllServers"; import { GetServer, AddToAllServers, createUniqueRandomIp } from "../../Server/AllServers";
import { Server } from "../../Server/Server"; import { Server } from "../../Server/Server";
import { safetlyCreateUniqueServer } from "../../Server/ServerHelpers"; import { safelyCreateUniqueServer } from "../../Server/ServerHelpers";
import { SpecialServers } from "../../Server/data/SpecialServers"; import { SpecialServers } from "../../Server/data/SpecialServers";
import { applySourceFile } from "../../SourceFile/applySourceFile"; import { applySourceFile } from "../../SourceFile/applySourceFile";
@ -48,7 +48,7 @@ import { serverMetadata } from "../../Server/data/servers";
export function init(this: PlayerObject): void { export function init(this: PlayerObject): void {
/* Initialize Player's home computer */ /* Initialize Player's home computer */
const t_homeComp = safetlyCreateUniqueServer({ const t_homeComp = safelyCreateUniqueServer({
adminRights: true, adminRights: true,
hostname: "home", hostname: "home",
ip: createUniqueRandomIp(), ip: createUniqueRandomIp(),
@ -279,7 +279,7 @@ export function applyForJob(this: PlayerObject, entryPosType: CompanyPosition, s
if (!this.isQualified(company, pos)) { if (!this.isQualified(company, pos)) {
if (!sing) { if (!sing) {
dialogBoxCreate("Unfortunately, you do not qualify for this position<br>" + getJobRequirementText(company, pos)); dialogBoxCreate("Unfortunately, you do not qualify for this position\n" + getJobRequirementText(company, pos));
} }
return false; return false;
} }
@ -305,7 +305,7 @@ export function applyForJob(this: PlayerObject, entryPosType: CompanyPosition, s
dialogBoxCreate("You are already at the highest position for your field! No promotion available"); dialogBoxCreate("You are already at the highest position for your field! No promotion available");
} else { } else {
const reqText = getJobRequirementText(company, nextPos); const reqText = getJobRequirementText(company, nextPos);
dialogBoxCreate("Unfortunately, you do not qualify for a promotion<br>" + reqText); dialogBoxCreate("Unfortunately, you do not qualify for a promotion\n" + reqText);
} }
} }
return false; return false;
@ -314,7 +314,7 @@ export function applyForJob(this: PlayerObject, entryPosType: CompanyPosition, s
this.jobs[company.name] = pos.name; this.jobs[company.name] = pos.name;
if (!sing) { if (!sing) {
dialogBoxCreate("Congratulations! You were offered a new job at " + company.name + " as a " + pos.name + "!"); dialogBoxCreate(`Congratulations! You were offered a new job at ${company.name} for position ${pos.name}!`);
} }
return true; return true;
} }
@ -781,7 +781,7 @@ export function checkForFactionInvitations(this: PlayerObject): Faction[] {
invitedFactions.push(kuaigonginternationalFac); invitedFactions.push(kuaigonginternationalFac);
} }
//Fulcrum Secret Technologies - If u've unlocked fulcrum secret technolgoies server and have a high rep with the company //Fulcrum Secret Technologies - If you've unlocked fulcrum secret technologies server and have a high rep with the company
const fulcrumsecrettechonologiesFac = Factions[FactionNames.FulcrumSecretTechnologies]; const fulcrumsecrettechonologiesFac = Factions[FactionNames.FulcrumSecretTechnologies];
const fulcrumSecretServer = GetServer(SpecialServers.FulcrumSecretTechnologies); const fulcrumSecretServer = GetServer(SpecialServers.FulcrumSecretTechnologies);
if (!(fulcrumSecretServer instanceof Server)) if (!(fulcrumSecretServer instanceof Server))

@ -54,7 +54,7 @@ export class Sleeve extends Person {
/** /**
* Sleeve shock. Number between 0 and 100 * Sleeve shock. Number between 0 and 100
* Trauma/shock that comes with being in a sleeve. Experience earned * Trauma/shock that comes with being in a sleeve. Experience earned
* is multipled by shock%. This gets applied before synchronization * is multiplied by shock%. This gets applied before synchronization
* *
* Reputation earned is also multiplied by shock% * Reputation earned is also multiplied by shock%
*/ */
@ -482,7 +482,7 @@ export class Sleeve extends Person {
return Generic_toJSON("Sleeve", this); return Generic_toJSON("Sleeve", this);
} }
/** Initiatizes a Sleeve object from a JSON save state. */ /** Initializes a Sleeve object from a JSON save state. */
static fromJSON(value: IReviverValue): Sleeve { static fromJSON(value: IReviverValue): Sleeve {
return Generic_fromJSON(Sleeve, value.data); return Generic_fromJSON(Sleeve, value.data);
} }

@ -80,7 +80,7 @@ export class SleeveBladeburnerWork extends Work {
return Generic_toJSON("SleeveBladeburnerWork", this); return Generic_toJSON("SleeveBladeburnerWork", this);
} }
/** Initiatizes a BladeburnerWork object from a JSON save state. */ /** Initializes a BladeburnerWork object from a JSON save state. */
static fromJSON(value: IReviverValue): SleeveBladeburnerWork { static fromJSON(value: IReviverValue): SleeveBladeburnerWork {
return Generic_fromJSON(SleeveBladeburnerWork, value.data); return Generic_fromJSON(SleeveBladeburnerWork, value.data);
} }

@ -50,7 +50,7 @@ export class SleeveClassWork extends Work {
return Generic_toJSON("SleeveClassWork", this); return Generic_toJSON("SleeveClassWork", this);
} }
/** Initiatizes a ClassWork object from a JSON save state. */ /** Initializes a ClassWork object from a JSON save state. */
static fromJSON(value: IReviverValue): SleeveClassWork { static fromJSON(value: IReviverValue): SleeveClassWork {
return Generic_fromJSON(SleeveClassWork, value.data); return Generic_fromJSON(SleeveClassWork, value.data);
} }

@ -54,7 +54,7 @@ export class SleeveCompanyWork extends Work {
return Generic_toJSON("SleeveCompanyWork", this); return Generic_toJSON("SleeveCompanyWork", this);
} }
/** Initiatizes a CompanyWork object from a JSON save state. */ /** Initializes a CompanyWork object from a JSON save state. */
static fromJSON(value: IReviverValue): SleeveCompanyWork { static fromJSON(value: IReviverValue): SleeveCompanyWork {
return Generic_fromJSON(SleeveCompanyWork, value.data); return Generic_fromJSON(SleeveCompanyWork, value.data);
} }

@ -73,7 +73,7 @@ export class SleeveCrimeWork extends Work {
return Generic_toJSON("SleeveCrimeWork", this); return Generic_toJSON("SleeveCrimeWork", this);
} }
/** Initiatizes a RecoveryWork object from a JSON save state. */ /** Initializes a RecoveryWork object from a JSON save state. */
static fromJSON(value: IReviverValue): SleeveCrimeWork { static fromJSON(value: IReviverValue): SleeveCrimeWork {
return Generic_fromJSON(SleeveCrimeWork, value.data); return Generic_fromJSON(SleeveCrimeWork, value.data);
} }

@ -83,7 +83,7 @@ export class SleeveFactionWork extends Work {
return Generic_toJSON("SleeveFactionWork", this); return Generic_toJSON("SleeveFactionWork", this);
} }
/** Initiatizes a FactionWork object from a JSON save state. */ /** Initializes a FactionWork object from a JSON save state. */
static fromJSON(value: IReviverValue): SleeveFactionWork { static fromJSON(value: IReviverValue): SleeveFactionWork {
return Generic_fromJSON(SleeveFactionWork, value.data); return Generic_fromJSON(SleeveFactionWork, value.data);
} }

@ -41,7 +41,7 @@ export class SleeveInfiltrateWork extends Work {
return Generic_toJSON("SleeveInfiltrateWork", this); return Generic_toJSON("SleeveInfiltrateWork", this);
} }
/** Initiatizes a BladeburnerWork object from a JSON save state. */ /** Initializes a BladeburnerWork object from a JSON save state. */
static fromJSON(value: IReviverValue): SleeveInfiltrateWork { static fromJSON(value: IReviverValue): SleeveInfiltrateWork {
return Generic_fromJSON(SleeveInfiltrateWork, value.data); return Generic_fromJSON(SleeveInfiltrateWork, value.data);
} }

@ -27,7 +27,7 @@ export class SleeveRecoveryWork extends Work {
return Generic_toJSON("SleeveRecoveryWork", this); return Generic_toJSON("SleeveRecoveryWork", this);
} }
/** Initiatizes a RecoveryWork object from a JSON save state. */ /** Initializes a RecoveryWork object from a JSON save state. */
static fromJSON(value: IReviverValue): SleeveRecoveryWork { static fromJSON(value: IReviverValue): SleeveRecoveryWork {
return Generic_fromJSON(SleeveRecoveryWork, value.data); return Generic_fromJSON(SleeveRecoveryWork, value.data);
} }

@ -30,7 +30,7 @@ export class SleeveSupportWork extends Work {
return Generic_toJSON("SleeveSupportWork", this); return Generic_toJSON("SleeveSupportWork", this);
} }
/** Initiatizes a BladeburnerWork object from a JSON save state. */ /** Initializes a BladeburnerWork object from a JSON save state. */
static fromJSON(value: IReviverValue): SleeveSupportWork { static fromJSON(value: IReviverValue): SleeveSupportWork {
return Generic_fromJSON(SleeveSupportWork, value.data); return Generic_fromJSON(SleeveSupportWork, value.data);
} }

@ -28,7 +28,7 @@ export class SleeveSynchroWork extends Work {
return Generic_toJSON("SleeveSynchroWork", this); return Generic_toJSON("SleeveSynchroWork", this);
} }
/** Initiatizes a SynchroWork object from a JSON save state. */ /** Initializes a SynchroWork object from a JSON save state. */
static fromJSON(value: IReviverValue): SleeveSynchroWork { static fromJSON(value: IReviverValue): SleeveSynchroWork {
return Generic_fromJSON(SleeveSynchroWork, value.data); return Generic_fromJSON(SleeveSynchroWork, value.data);
} }

@ -230,7 +230,7 @@ export function prestigeSourceFile(flume: boolean): void {
} }
} }
// Give levels of NeuroFluxGoverner for Source-File 12. Must be done here before Augmentations are recalculated // Give levels of NeuroFluxGovernor for Source-File 12. Must be done here before Augmentations are recalculated
if (Player.sourceFileLvl(12) > 0) { if (Player.sourceFileLvl(12) > 0) {
Player.augmentations.push({ Player.augmentations.push({
name: AugmentationNames.NeuroFluxGovernor, name: AugmentationNames.NeuroFluxGovernor,

@ -32,7 +32,7 @@ import { pushGameSaved } from "./Electron";
import { defaultMonacoTheme } from "./ScriptEditor/ui/themes"; import { defaultMonacoTheme } from "./ScriptEditor/ui/themes";
import { FactionNames } from "./Faction/data/FactionNames"; import { FactionNames } from "./Faction/data/FactionNames";
import { Faction } from "./Faction/Faction"; import { Faction } from "./Faction/Faction";
import { safetlyCreateUniqueServer } from "./Server/ServerHelpers"; import { safelyCreateUniqueServer } from "./Server/ServerHelpers";
import { SpecialServers } from "./Server/data/SpecialServers"; import { SpecialServers } from "./Server/data/SpecialServers";
import { v2APIBreak } from "./utils/v2APIBreak"; import { v2APIBreak } from "./utils/v2APIBreak";
@ -461,7 +461,7 @@ function evaluateVersionCompatibility(ver: string | number): void {
// Create the darkweb for everyone but it won't be linked // Create the darkweb for everyone but it won't be linked
const dw = GetServer(SpecialServers.DarkWeb); const dw = GetServer(SpecialServers.DarkWeb);
if (!dw) { if (!dw) {
const darkweb = safetlyCreateUniqueServer({ const darkweb = safelyCreateUniqueServer({
ip: createUniqueRandomIp(), ip: createUniqueRandomIp(),
hostname: SpecialServers.DarkWeb, hostname: SpecialServers.DarkWeb,
organizationName: "", organizationName: "",

@ -41,7 +41,7 @@ export class Script {
dependencies: ScriptUrl[] = []; dependencies: ScriptUrl[] = [];
dependents: ScriptReference[] = []; dependents: ScriptReference[] = [];
// Amount of RAM this Script requres to run // Amount of RAM this Script requires to run
ramUsage = 0; ramUsage = 0;
ramUsageEntries?: RamUsageEntry[]; ramUsageEntries?: RamUsageEntry[];

@ -339,7 +339,7 @@ export interface HacknetNodeConstants {
BaseCost: number; BaseCost: number;
/** Base cost per level */ /** Base cost per level */
LevelBaseCost: number; LevelBaseCost: number;
/** Base cost to incrase RAM */ /** Base cost to increase RAM */
RamBaseCost: number; RamBaseCost: number;
/** Base cost to increase cores */ /** Base cost to increase cores */
CoreBaseCost: number; CoreBaseCost: number;
@ -1297,7 +1297,7 @@ export interface TIX {
* Cancel order for stocks. * Cancel order for stocks.
* @remarks * @remarks
* RAM cost: 2.5 GB * RAM cost: 2.5 GB
* Cancels an oustanding Limit or Stop order on the stock market. * Cancels an outstanding Limit or Stop order on the stock market.
* *
* The ability to use limit and stop orders is **not** immediately available to the player and * The ability to use limit and stop orders is **not** immediately available to the player and
* must be unlocked later on in the game. * must be unlocked later on in the game.
@ -1777,9 +1777,9 @@ export interface Singularity {
* RAM cost: 3 GB * 16/4/1 * RAM cost: 3 GB * 16/4/1
* *
* *
* Returns an array with the name of all Factions you currently have oustanding invitations from. * Returns an array with the name of all Factions you currently have outstanding invitations from.
* *
* @returns Array with the name of all Factions you currently have oustanding invitations from. * @returns Array with the name of all Factions you currently have outstanding invitations from.
*/ */
checkFactionInvitations(): string[]; checkFactionInvitations(): string[];
@ -1969,10 +1969,10 @@ export interface Singularity {
* RAM cost: 5 GB * 16/4/1 * RAM cost: 5 GB * 16/4/1
* *
* *
* This function returns your chance of success at commiting the specified crime. * This function returns your chance of success at committing the specified crime.
* *
* @param crime - Name of crime. * @param crime - Name of crime.
* @returns Chance of success at commiting the specified crime. * @returns Chance of success at committing the specified crime.
*/ */
getCrimeChance(crime: string): number; getCrimeChance(crime: string): number;
@ -2621,7 +2621,7 @@ export interface Hacknet {
* @param upgName - Name of the upgrade of Hacknet Node. * @param upgName - Name of the upgrade of Hacknet Node.
* @param upgTarget - Object to which upgrade applies. Required for certain upgrades. * @param upgTarget - Object to which upgrade applies. Required for certain upgrades.
* @param count - Number of upgrades to buy at once. Defaults to 1 if not specified. * @param count - Number of upgrades to buy at once. Defaults to 1 if not specified.
* For compatability reasons, upgTarget must be specified, even if it is not used, in order to specify count. * For compatibility reasons, upgTarget must be specified, even if it is not used, in order to specify count.
* @returns True if the upgrade is successfully purchased, and false otherwise. * @returns True if the upgrade is successfully purchased, and false otherwise.
*/ */
spendHashes(upgName: string, upgTarget?: string, count?: number): boolean; spendHashes(upgName: string, upgTarget?: string, count?: number): boolean;
@ -3599,7 +3599,7 @@ export interface Sleeve {
* *
* Returns false if an invalid action is specified. * Returns false if an invalid action is specified.
* *
* @param sleeveNumber - Index of the sleeve to start commiting crime. * @param sleeveNumber - Index of the sleeve to start committing crime.
* @param name - Name of the crime. Must be an exact match. * @param name - Name of the crime. Must be an exact match.
* @returns True if this action was set successfully, false otherwise. * @returns True if this action was set successfully, false otherwise.
*/ */
@ -6155,7 +6155,7 @@ export interface NS {
* @remarks * @remarks
* RAM cost: 0 GB * RAM cost: 0 GB
* *
* Deleta all data from the underlying queue. * Delete all data from the underlying queue.
* *
* @param handle - Port to clear. * @param handle - Port to clear.
*/ */
@ -6397,8 +6397,8 @@ export interface NS {
* *
* see: https://github.com/alexei/sprintf.js * see: https://github.com/alexei/sprintf.js
* @param format - String to format. * @param format - String to format.
* @param args - Formating arguments. * @param args - Formatting arguments.
* @returns Formated text. * @returns Formatted text.
*/ */
sprintf(format: string, ...args: any[]): string; sprintf(format: string, ...args: any[]): string;
@ -6409,8 +6409,8 @@ export interface NS {
* *
* see: https://github.com/alexei/sprintf.js * see: https://github.com/alexei/sprintf.js
* @param format - String to format. * @param format - String to format.
* @param args - Formating arguments. * @param args - Formatting arguments.
* @returns Formated text. * @returns Formatted text.
*/ */
vsprintf(format: string, args: any[]): string; vsprintf(format: string, args: any[]): string;
@ -6420,13 +6420,13 @@ export interface NS {
* RAM cost: 0 GB * RAM cost: 0 GB
* *
* Converts a number into a string with the specified formatter. * Converts a number into a string with the specified formatter.
* This uses the numeraljs library, so the formatters must be compatible with that. * This uses the numeral.js library, so the formatters must be compatible with that.
* This is the same function that the game itself uses to display numbers. * This is the same function that the game itself uses to display numbers.
* *
* see: http://numeraljs.com/ * see: http://numeraljs.com/
* @param n - Number to format. * @param n - Number to format.
* @param format - Formatter. * @param format - Formatter.
* @returns Formated number. * @returns Formatted number.
*/ */
nFormat(n: number, format: string): string; nFormat(n: number, format: string): string;
@ -7187,7 +7187,7 @@ interface CorporationInfo {
numShares: number; numShares: number;
/** Cooldown until shares can be sold again */ /** Cooldown until shares can be sold again */
shareSaleCooldown: number; shareSaleCooldown: number;
/** Amount of aqcuirable shares. */ /** Amount of acquirable shares. */
issuedShares: number; issuedShares: number;
/** Price of the shares */ /** Price of the shares */
sharePrice: number; sharePrice: number;

@ -221,7 +221,7 @@ export function Root(props: IProps): React.ReactElement {
}); });
} catch {} } catch {}
} else if (!options.vim) { } else if (!options.vim) {
// Whem vim mode is disabled // When vim mode is disabled
vimEditor?.dispose(); vimEditor?.dispose();
setVimEditor(null); setVimEditor(null);
} }

@ -95,7 +95,7 @@ export function createUniqueRandomIp(): string {
return ip; return ip;
} }
// Saftely add a Server to the AllServers map // Safely add a Server to the AllServers map
export function AddToAllServers(server: Server | HacknetServer): void { export function AddToAllServers(server: Server | HacknetServer): void {
if (GetServer(server.hostname)) { if (GetServer(server.hostname)) {
console.warn(`Hostname of the server thats being added: ${server.hostname}`); console.warn(`Hostname of the server thats being added: ${server.hostname}`);

@ -49,7 +49,7 @@ export abstract class BaseServer {
// IP Address. Must be unique // IP Address. Must be unique
ip = ""; ip = "";
// Flag indicating whether player is curently connected to this server // Flag indicating whether player is currently connected to this server
isConnectedTo = false; isConnectedTo = false;
// RAM (GB) available on this server // RAM (GB) available on this server
@ -90,7 +90,7 @@ export abstract class BaseServer {
// Text files on this server // Text files on this server
textFiles: TextFile[] = []; textFiles: TextFile[] = [];
// Flag indicating wehther this is a purchased server // Flag indicating whether this is a purchased server
purchasedByPlayer = false; purchasedByPlayer = false;
constructor(params: IConstructorParams = { hostname: "", ip: createRandomIp() }) { constructor(params: IConstructorParams = { hostname: "", ip: createRandomIp() }) {
@ -232,7 +232,6 @@ export abstract class BaseServer {
this.maxRam = ram; this.maxRam = ram;
} }
// eslint-disable-next-line @typescript-eslint/no-unused-vars
updateRamUsed(ram: number): void { updateRamUsed(ram: number): void {
this.ramUsed = ram; this.ramUsed = ram;
} }
@ -252,7 +251,7 @@ export abstract class BaseServer {
/** /**
* Write to a script file * Write to a script file
* Overwrites existing files. Creates new files if the script does not eixst * Overwrites existing files. Creates new files if the script does not exist.
*/ */
writeToScriptFile(fn: string, code: string): writeResult { writeToScriptFile(fn: string, code: string): writeResult {
const ret = { success: false, overwritten: false }; const ret = { success: false, overwritten: false };

@ -15,7 +15,7 @@ import { isValidNumber } from "../utils/helpers/isValidNumber";
* Constructs a new server, while also ensuring that the new server * Constructs a new server, while also ensuring that the new server
* does not have a duplicate hostname/ip. * does not have a duplicate hostname/ip.
*/ */
export function safetlyCreateUniqueServer(params: IConstructorParams): Server { export function safelyCreateUniqueServer(params: IConstructorParams): Server {
let hostname: string = params.hostname.replace(/ /g, `-`); let hostname: string = params.hostname.replace(/ /g, `-`);
if (params.ip != null && ipExists(params.ip)) { if (params.ip != null && ipExists(params.ip)) {
@ -118,7 +118,7 @@ export function numCycleForGrowthCorrected(server: Server, targetMoney: number,
* *
* A change of variable will do. The idea is to add an equation introducing a new variable (w here) in the form c = f(w) (for some f) * A change of variable will do. The idea is to add an equation introducing a new variable (w here) in the form c = f(w) (for some f)
* With this equation we will eliminate all references to c, then solve for w and plug the result in the new equation to get c. * With this equation we will eliminate all references to c, then solve for w and plug the result in the new equation to get c.
* The change of variable performed here should get rid of the unwanted terms mentionned above, c = w/(ln(b)*t) - o should help. * The change of variable performed here should get rid of the unwanted terms mentioned above, c = w/(ln(b)*t) - o should help.
* This change of variable is allowed because whatever the value of c is, there is a value of w such that this equation holds: * This change of variable is allowed because whatever the value of c is, there is a value of w such that this equation holds:
* w = (c + o)*ln(b)*t (see how we used the terms we wanted to eliminate in order to build this variable change) * w = (c + o)*ln(b)*t (see how we used the terms we wanted to eliminate in order to build this variable change)
* *
@ -130,7 +130,7 @@ export function numCycleForGrowthCorrected(server: Server, targetMoney: number,
* Finally we invert the variable change: c = W(n * ln(b) * t * b^(o*t))/(ln(b)*t) - o * Finally we invert the variable change: c = W(n * ln(b) * t * b^(o*t))/(ln(b)*t) - o
* *
* There is still an issue left: b^(o*t) doesn't fit inside a double precision float * There is still an issue left: b^(o*t) doesn't fit inside a double precision float
* because the typical amount of money on servers is arround 10^6~10^9 * because the typical amount of money on servers is around 10^6~10^9
* We need to get an approximation of W without computing the power when o is huge * We need to get an approximation of W without computing the power when o is huge
* Thankfully an approximation giving ~30% error uses log immediately so we will use * Thankfully an approximation giving ~30% error uses log immediately so we will use
* W(n * ln(b) * t * b^(o*t)) ~= log(n * ln(b) * t * b^(o*t)) = log(n * ln(b) * t) + log(exp(ln(b) * o * t)) * W(n * ln(b) * t * b^(o*t)) ~= log(n * ln(b) * t * b^(o*t)) = log(n * ln(b) * t) + log(exp(ln(b) * o * t))
@ -179,7 +179,7 @@ export function numCycleForGrowthCorrected(server: Server, targetMoney: number,
* The main question to ask when using this method is "does it converges?" * The main question to ask when using this method is "does it converges?"
* (are the approximations getting better?), if it does then it does quickly. * (are the approximations getting better?), if it does then it does quickly.
* DOES IT CONVERGES? In the present case it does. The reason why doesn't help explaining the algorithm. * DOES IT CONVERGES? In the present case it does. The reason why doesn't help explaining the algorithm.
* If you are intrested then check out the wikipedia page. * If you are interested then check out the wikipedia page.
*/ */
const bt = exponentialBase ** threadMultiplier; const bt = exponentialBase ** threadMultiplier;
let corr = Infinity; let corr = Infinity;

@ -3,7 +3,7 @@
* the home computer * the home computer
*/ */
import { AddToAllServers, createUniqueRandomIp } from "./AllServers"; import { AddToAllServers, createUniqueRandomIp } from "./AllServers";
import { safetlyCreateUniqueServer } from "./ServerHelpers"; import { safelyCreateUniqueServer } from "./ServerHelpers";
import { BitNodeMultipliers } from "../BitNode/BitNodeMultipliers"; import { BitNodeMultipliers } from "../BitNode/BitNodeMultipliers";
import { CONSTANTS } from "../Constants"; import { CONSTANTS } from "../Constants";
@ -75,7 +75,7 @@ export function purchaseServer(hostname: string, ram: number, cost: number): voi
} }
// Create server // Create server
const newServ = safetlyCreateUniqueServer({ const newServ = safelyCreateUniqueServer({
adminRights: true, adminRights: true,
hostname: hostname, hostname: hostname,
ip: createUniqueRandomIp(), ip: createUniqueRandomIp(),

@ -33,7 +33,7 @@ export class Order {
invalidArgs = true; invalidArgs = true;
} }
if (invalidArgs) { if (invalidArgs) {
throw new Error(`Invalid constructor paramters for Order`); throw new Error(`Invalid constructor parameters for Order`);
} }
this.stockSymbol = stockSymbol; this.stockSymbol = stockSymbol;

@ -1,5 +1,5 @@
/** /**
* How many stock market 'ticks' before a 'cycle' is triggered. * How many stock market 'ticks' before a 'cycle' is triggered.
* A 'tick' is whenver stock prices update * A 'tick' is whenever stock prices update
*/ */
export const TicksPerCycle = 75; export const TicksPerCycle = 75;

@ -35,7 +35,7 @@ export function getBuyTransactionCost(stock: Stock, shares: number, posType: Pos
* Calculate the TOTAL amount of money gained from a sale (NOT net profit). This accounts * Calculate the TOTAL amount of money gained from a sale (NOT net profit). This accounts
* for spread and commission. * for spread and commission.
* @param {Stock} stock - Stock being sold * @param {Stock} stock - Stock being sold
* @param {number} shares - Number of sharse being transacted * @param {number} shares - Number of shares being transacted
* @param {PositionTypes} posType - Long or short position * @param {PositionTypes} posType - Long or short position
* @returns {number | null} Amount of money gained from transaction. Returns null for an invalid transaction * @returns {number | null} Amount of money gained from transaction. Returns null for an invalid transaction
*/ */
@ -64,7 +64,7 @@ export function getSellTransactionGain(stock: Stock, shares: number, posType: Po
* Processes a stock's change in forecast & second-order forecast * Processes a stock's change in forecast & second-order forecast
* whenever it is transacted * whenever it is transacted
* @param {Stock} stock - Stock being sold * @param {Stock} stock - Stock being sold
* @param {number} shares - Number of sharse being transacted * @param {number} shares - Number of shares being transacted
* @param {PositionTypes} posType - Long or short position * @param {PositionTypes} posType - Long or short position
*/ */
export function processTransactionForecastMovement(stock: Stock, shares: number): void { export function processTransactionForecastMovement(stock: Stock, shares: number): void {

@ -180,7 +180,7 @@ export function StockTicker(props: IProps): React.ReactElement {
function handleOrderTypeChange(e: SelectChangeEvent<string>): void { function handleOrderTypeChange(e: SelectChangeEvent<string>): void {
const val = e.target.value; const val = e.target.value;
// The select value returns a string. Afaik TypeScript doesnt make it easy // The select value returns a string. Afaik TypeScript doesn't make it easy
// to convert that string back to an enum type so we'll just do this for now // to convert that string back to an enum type so we'll just do this for now
switch (val) { switch (val) {
case SelectorOrderType.Limit: case SelectorOrderType.Limit:

@ -20,7 +20,7 @@ type IProps = {
function LongPosition(props: IProps): React.ReactElement { function LongPosition(props: IProps): React.ReactElement {
const stock = props.stock; const stock = props.stock;
// Caculate total returns // Calculate total returns
const totalCost = stock.playerShares * stock.playerAvgPx; const totalCost = stock.playerShares * stock.playerAvgPx;
const gains = (stock.getBidPrice() - stock.playerAvgPx) * stock.playerShares; const gains = (stock.getBidPrice() - stock.playerAvgPx) * stock.playerShares;
let percentageGains = gains / totalCost; let percentageGains = gains / totalCost;
@ -57,7 +57,7 @@ function LongPosition(props: IProps): React.ReactElement {
function ShortPosition(props: IProps): React.ReactElement { function ShortPosition(props: IProps): React.ReactElement {
const stock = props.stock; const stock = props.stock;
// Caculate total returns // Calculate total returns
const totalCost = stock.playerShortShares * stock.playerAvgShortPx; const totalCost = stock.playerShortShares * stock.playerAvgShortPx;
const gains = (stock.playerAvgShortPx - stock.getAskPrice()) * stock.playerShortShares; const gains = (stock.playerAvgShortPx - stock.getAskPrice()) * stock.playerShortShares;
let percentageGains = gains / totalCost; let percentageGains = gains / totalCost;

@ -47,7 +47,7 @@ export function StockTickers(props: IProps): React.ReactElement {
for (const stockMarketProp of Object.keys(props.stockMarket)) { for (const stockMarketProp of Object.keys(props.stockMarket)) {
const val = props.stockMarket[stockMarketProp]; const val = props.stockMarket[stockMarketProp];
if (val instanceof Stock) { if (val instanceof Stock) {
// Skip if there's a filter and the stock isnt in that filter // Skip if there's a filter and the stock isn't in that filter
if (watchlistSymbols.length > 0 && !watchlistSymbols.includes(val.symbol)) { if (watchlistSymbols.length > 0 && !watchlistSymbols.includes(val.symbol)) {
continue; continue;
} }
@ -57,7 +57,7 @@ export function StockTickers(props: IProps): React.ReactElement {
orders = []; orders = [];
} }
// Skip if we're in portfolio mode and the player doesnt own this or have any active orders // Skip if we're in portfolio mode and the player doesn't own this or have any active orders
if (tickerDisplayMode === TickerDisplayMode.Portfolio) { if (tickerDisplayMode === TickerDisplayMode.Portfolio) {
if (val.playerShares === 0 && val.playerShortShares === 0 && orders.length === 0) { if (val.playerShares === 0 && val.playerShortShares === 0 && orders.length === 0) {
continue; continue;

@ -1,7 +1,7 @@
/** /**
* React component for the tickers configuration section of the Stock Market UI. * React component for the tickers configuration section of the Stock Market UI.
* This config lets you change the way stock tickers are displayed (watchlist, * This config lets you change the way stock tickers are displayed (watchlist,
* all/portoflio mode, etc) * all/portfolio mode, etc)
*/ */
import * as React from "react"; import * as React from "react";
import Typography from "@mui/material/Typography"; import Typography from "@mui/material/Typography";

@ -2,7 +2,7 @@ import { KEY } from "../utils/helpers/keyCodes";
import { substituteAliases } from "../Alias"; import { substituteAliases } from "../Alias";
// Helper function to parse individual arguments into number/boolean/string as appropriate // Helper function to parse individual arguments into number/boolean/string as appropriate
function parseArg(arg: string): string | number | boolean { function parseArg(arg: string): string | number | boolean {
// Handles all numbers including hexadecimal, octal, and binary representations, returning NaN on an unparseable string // Handles all numbers including hexadecimal, octal, and binary representations, returning NaN on an unparsable string
const asNumber = Number(arg); const asNumber = Number(arg);
if (!isNaN(asNumber)) { if (!isNaN(asNumber)) {
return asNumber; return asNumber;

@ -464,7 +464,7 @@ export class Terminal {
this.contractOpen = true; this.contractOpen = true;
const res = await contract.prompt(); const res = await contract.prompt();
//Check if the contract still exists by the time the promise is fullfilled //Check if the contract still exists by the time the promise is fulfilled
if (serv.getContract(contractName) == null) { if (serv.getContract(contractName) == null) {
this.contractOpen = false; this.contractOpen = false;
return this.error("Contract no longer exists (Was it solved by a script?)"); return this.error("Contract no longer exists (Was it solved by a script?)");

@ -60,7 +60,7 @@ export function cp(args: (string | number | boolean)[], server: BaseServer): voi
return; return;
} }
if (tRes.overwritten) { if (tRes.overwritten) {
Terminal.print(`WARNING: ${dst} already exists and will be overwriten`); Terminal.print(`WARNING: ${dst} already exists and will be overwritten`);
Terminal.print(`${dst} overwritten`); Terminal.print(`${dst} overwritten`);
return; return;
} }

@ -50,7 +50,7 @@ export function mv(args: (string | number | boolean)[], server: BaseServer): voi
return; return;
} }
// Command doesnt work if script is running // Command doesn't work if script is running
if (server.isRunning(sourcePath)) { if (server.isRunning(sourcePath)) {
Terminal.error(`Cannot use 'mv' on a script that is running`); Terminal.error(`Cannot use 'mv' on a script that is running`);
return; return;
@ -59,7 +59,7 @@ export function mv(args: (string | number | boolean)[], server: BaseServer): voi
if (destFile != null) { if (destFile != null) {
// Already exists, will be overwritten, so we'll delete it // Already exists, will be overwritten, so we'll delete it
// Command doesnt work if script is running // Command doesn't work if script is running
if (server.isRunning(destPath)) { if (server.isRunning(destPath)) {
Terminal.error(`Cannot use 'mv' on a script that is running`); Terminal.error(`Cannot use 'mv' on a script that is running`);
return; return;

@ -44,7 +44,7 @@ export function runScript(commandArgs: (string | number | boolean)[], server: Ba
if (server.scripts[i].filename !== scriptName) { if (server.scripts[i].filename !== scriptName) {
continue; continue;
} }
// Check for admin rights and that there is enough RAM availble to run // Check for admin rights and that there is enough RAM available to run
const script = server.scripts[i]; const script = server.scripts[i];
script.server = server.hostname; script.server = server.hostname;
const ramUsage = script.ramUsage * numThreads; const ramUsage = script.ramUsage * numThreads;

@ -41,7 +41,7 @@ export function scp(args: (string | number | boolean)[], server: BaseServer): vo
return; return;
} }
if (tRes.overwritten) { if (tRes.overwritten) {
Terminal.print(`WARNING: ${scriptname} already exists on ${destServer.hostname} and will be overwriten`); Terminal.print(`WARNING: ${scriptname} already exists on ${destServer.hostname} and will be overwritten`);
Terminal.print(`${scriptname} overwritten on ${destServer.hostname}`); Terminal.print(`${scriptname} overwritten on ${destServer.hostname}`);
return; return;
} }

@ -197,7 +197,7 @@ export async function determineAllPossibilitiesForTabCompletion(
if (evaledParentDirPath === "/") { if (evaledParentDirPath === "/") {
evaledParentDirPath = null; evaledParentDirPath = null;
} else if (evaledParentDirPath == null) { } else if (evaledParentDirPath == null) {
// do nothing for some reason tests dont like this? // do nothing for some reason tests don't like this?
// return allPos; // Invalid path // return allPos; // Invalid path
} else { } else {
evaledParentDirPath += "/"; evaledParentDirPath += "/";

@ -60,7 +60,7 @@ export function tabCompletion(
const longestStartSubstr = longestCommonStart(allPossibilities); const longestStartSubstr = longestCommonStart(allPossibilities);
/** /**
* If the longest common starting substring of remaining possibilities is the same * If the longest common starting substring of remaining possibilities is the same
* as whatevers already in terminal, just list all possible options. Otherwise, * as whatever's already in terminal, just list all possible options. Otherwise,
* change the input in the terminal to the longest common starting substr * change the input in the terminal to the longest common starting substr
*/ */
if (arg === "") { if (arg === "") {

@ -67,7 +67,7 @@ export class TextFile {
this.text = txt; this.text = txt;
} }
/** Initiatizes a TextFile from a JSON save state. */ /** Initializes a TextFile from a JSON save state. */
static fromJSON(value: IReviverValue): TextFile { static fromJSON(value: IReviverValue): TextFile {
return Generic_fromJSON(TextFile, value.data); return Generic_fromJSON(TextFile, value.data);
} }

@ -193,7 +193,7 @@ export class ClassWork extends Work {
return Generic_toJSON("ClassWork", this); return Generic_toJSON("ClassWork", this);
} }
/** Initiatizes a ClassWork object from a JSON save state. */ /** Initializes a ClassWork object from a JSON save state. */
static fromJSON(value: IReviverValue): ClassWork { static fromJSON(value: IReviverValue): ClassWork {
return Generic_fromJSON(ClassWork, value.data); return Generic_fromJSON(ClassWork, value.data);
} }

@ -75,7 +75,7 @@ export class CompanyWork extends Work {
return Generic_toJSON("CompanyWork", this); return Generic_toJSON("CompanyWork", this);
} }
/** Initiatizes a CompanyWork object from a JSON save state. */ /** Initializes a CompanyWork object from a JSON save state. */
static fromJSON(value: IReviverValue): CompanyWork { static fromJSON(value: IReviverValue): CompanyWork {
return Generic_fromJSON(CompanyWork, value.data); return Generic_fromJSON(CompanyWork, value.data);
} }

@ -112,7 +112,7 @@ export class CreateProgramWork extends Work {
return Generic_toJSON("CreateProgramWork", this); return Generic_toJSON("CreateProgramWork", this);
} }
/** Initiatizes a CreateProgramWork object from a JSON save state. */ /** Initializes a CreateProgramWork object from a JSON save state. */
static fromJSON(value: IReviverValue): CreateProgramWork { static fromJSON(value: IReviverValue): CreateProgramWork {
return Generic_fromJSON(CreateProgramWork, value.data); return Generic_fromJSON(CreateProgramWork, value.data);
} }

@ -141,7 +141,7 @@ export class CrimeWork extends Work {
return Generic_toJSON("CrimeWork", this); return Generic_toJSON("CrimeWork", this);
} }
/** Initiatizes a CrimeWork object from a JSON save state. */ /** Initializes a CrimeWork object from a JSON save state. */
static fromJSON(value: IReviverValue): CrimeWork { static fromJSON(value: IReviverValue): CrimeWork {
return Generic_fromJSON(CrimeWork, value.data); return Generic_fromJSON(CrimeWork, value.data);
} }

@ -90,7 +90,7 @@ export class FactionWork extends Work {
return Generic_toJSON("FactionWork", this); return Generic_toJSON("FactionWork", this);
} }
/** Initiatizes a FactionWork object from a JSON save state. */ /** Initializes a FactionWork object from a JSON save state. */
static fromJSON(value: IReviverValue): FactionWork { static fromJSON(value: IReviverValue): FactionWork {
return Generic_fromJSON(FactionWork, value.data); return Generic_fromJSON(FactionWork, value.data);
} }

@ -96,7 +96,7 @@ export class GraftingWork extends Work {
return Generic_toJSON("GraftingWork", this); return Generic_toJSON("GraftingWork", this);
} }
/** Initiatizes a GraftingWork object from a JSON save state. */ /** Initializes a GraftingWork object from a JSON save state. */
static fromJSON(value: IReviverValue): GraftingWork { static fromJSON(value: IReviverValue): GraftingWork {
return Generic_fromJSON(GraftingWork, value.data); return Generic_fromJSON(GraftingWork, value.data);
} }

@ -1444,7 +1444,7 @@ export const codingContractTypesMetadata: ICodingContractTypeMetadata[] = [
coloring[initialVertex] = 0; coloring[initialVertex] = 0;
const frontier: number[] = [initialVertex]; const frontier: number[] = [initialVertex];
//Propogate the coloring throughout the component containing v greedily //Propagate the coloring throughout the component containing v greedily
while (frontier.length > 0) { while (frontier.length > 0) {
const v: number = frontier.pop() || 0; const v: number = frontier.pop() || 0;
const neighbors: number[] = neighbourhood(v); const neighbors: number[] = neighbourhood(v);
@ -1728,7 +1728,7 @@ export const codingContractTypesMetadata: ICodingContractTypeMetadata[] = [
return [ return [
"Vigenère cipher is a type of polyalphabetic substitution. It uses ", "Vigenère cipher is a type of polyalphabetic substitution. It uses ",
"the Vigenère square to encrypt and decrypt plaintext with a keyword.\n\n", "the Vigenère square to encrypt and decrypt plaintext with a keyword.\n\n",
"&nbsp;&nbsp;Vignenère square:\n", "&nbsp;&nbsp;Vigenère square:\n",
"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;A B C D E F G H I J K L M N O P Q R S T U V W X Y Z \n", "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;A B C D E F G H I J K L M N O P Q R S T U V W X Y Z \n",
"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; +----------------------------------------------------\n", "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; +----------------------------------------------------\n",
"&nbsp;&nbsp;&nbsp;&nbsp; A | A B C D E F G H I J K L M N O P Q R S T U V W X Y Z \n", "&nbsp;&nbsp;&nbsp;&nbsp; A | A B C D E F G H I J K L M N O P Q R S T U V W X Y Z \n",

@ -196,7 +196,7 @@ function ansiCodeStyle(code: string | null): Record<string, any> {
} else if (codePart == 4) { } else if (codePart == 4) {
style.textDecoration = "underline"; style.textDecoration = "underline";
} }
// Forground Color (x8) // Foreground Color (x8)
else if (30 <= codePart && codePart < 38) { else if (30 <= codePart && codePart < 38) {
if (COLOR_MAP_BRIGHT[codePart % 10]) { if (COLOR_MAP_BRIGHT[codePart % 10]) {
style.color = COLOR_MAP_BRIGHT[codePart % 10]; style.color = COLOR_MAP_BRIGHT[codePart % 10];
@ -208,7 +208,7 @@ function ansiCodeStyle(code: string | null): Record<string, any> {
style.backgroundColor = COLOR_MAP_DARK[codePart % 10]; style.backgroundColor = COLOR_MAP_DARK[codePart % 10];
} }
} }
// Forground Color (x256) // Foreground Color (x256)
else if (codePart == 38) { else if (codePart == 38) {
nextStyleKey = "color"; nextStyleKey = "color";
} }

@ -156,10 +156,10 @@ function LogWindow(props: IProps): React.ReactElement {
// setTimeout(() => { // setTimeout(() => {
// const server = GetServer(script.server); // const server = GetServer(script.server);
// if (server === null) return; // if (server === null) return;
// const exisitingScript = findRunningScript(script.filename, script.args, server); // const existingScript = findRunningScript(script.filename, script.args, server);
// if (exisitingScript) { // if (existingScript) {
// exisitingScript.logs = script.logs.concat(exisitingScript.logs) // existingScript.logs = script.logs.concat(existingScript.logs)
// setScript(exisitingScript) // setScript(existingScript)
// } // }
// rerender(); // rerender();
// }, 100) // }, 100)

Some files were not shown because too many files have changed in this diff Show More