Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .github/workflows/Create deploy-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: "Deploy new pages build"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems accidental? In any case, revert - we already have one of these.


on:
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: "pages"
cancel-in-progress: true

jobs:
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- run: npm ci
- run: npm run build
- uses: actions/upload-pages-artifact@v3
with:
path: ".app"
- name: Deploy to gh pages
id: deployment
uses: actions/deploy-pages@v4
8 changes: 4 additions & 4 deletions src/DarkWeb/DarkWeb.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export function buyDarkwebItem(itemName: string): void {

// return if the player already has it.
if (Player.hasProgram(item.program)) {
Terminal.print("You already have the " + item.program + " program");
Terminal.warn("You already have the " + item.program + " program");
return;
}

Expand All @@ -79,7 +79,7 @@ export function buyDarkwebItem(itemName: string): void {
Player.finishWork(true);
}

Terminal.print(
Terminal.success(
"You have purchased the " + item.program + " program. The new program can be found on your home computer.",
);
}
Expand All @@ -101,12 +101,12 @@ export function buyAllDarkwebItems(): void {
}

if (itemsToBuy.length === 0) {
Terminal.print("All available programs have been purchased already.");
Terminal.warn("All available programs have been purchased already.");
return;
}

if (itemsToBuy.length > 0) {
Terminal.print("All programs have been purchased.");
Terminal.success("All programs have been purchased.");
return;
}
}
89 changes: 57 additions & 32 deletions src/Programs/Programs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,18 @@ export const Programs: Record<CompletedProgramName, Program> = {
return;
}
if (server.hasAdminRights) {
Terminal.print("You already have root access to this computer. There is no reason to run NUKE.exe");
Terminal.print("You can now run scripts on this server.");
Terminal.warn("You already have root access to this computer. There is no reason to run NUKE.exe");
Terminal.success("You can now run scripts on this server.");
return;
}
if (server.openPortCount >= server.numOpenPortsRequired) {
server.hasAdminRights = true;
Terminal.print("NUKE successful! Gained root access to " + server.hostname);
Terminal.print("You can now run scripts on this server.");
Terminal.success("NUKE successful! Gained root access to " + server.hostname);
Terminal.success("You can now run scripts on this server.");
return;
}

Terminal.print("NUKE unsuccessful. Not enough ports have been opened");
Terminal.error("NUKE unsuccessful. Not enough ports have been opened");
},
}),
[CompletedProgramName.bruteSsh]: new Program({
Expand All @@ -70,12 +70,12 @@ export const Programs: Record<CompletedProgramName, Program> = {
return;
}
if (server.sshPortOpen) {
Terminal.print("SSH Port (22) is already open!");
Terminal.warn("SSH Port (22) is already open!");
return;
}

server.sshPortOpen = true;
Terminal.print("Opened SSH Port(22)!");
Terminal.success("Opened SSH Port(22)!");
server.openPortCount++;
},
}),
Expand All @@ -93,12 +93,12 @@ export const Programs: Record<CompletedProgramName, Program> = {
return;
}
if (server.ftpPortOpen) {
Terminal.print("FTP Port (21) is already open!");
Terminal.warn("FTP Port (21) is already open!");
return;
}

server.ftpPortOpen = true;
Terminal.print("Opened FTP Port (21)!");
Terminal.success("Opened FTP Port (21)!");
server.openPortCount++;
},
}),
Expand All @@ -116,12 +116,12 @@ export const Programs: Record<CompletedProgramName, Program> = {
return;
}
if (server.smtpPortOpen) {
Terminal.print("SMTP Port (25) is already open!");
Terminal.warn("SMTP Port (25) is already open!");
return;
}

server.smtpPortOpen = true;
Terminal.print("Opened SMTP Port (25)!");
Terminal.success("Opened SMTP Port (25)!");
server.openPortCount++;
},
}),
Expand All @@ -139,12 +139,12 @@ export const Programs: Record<CompletedProgramName, Program> = {
return;
}
if (server.httpPortOpen) {
Terminal.print("HTTP Port (80) is already open!");
Terminal.warn("HTTP Port (80) is already open!");
return;
}

server.httpPortOpen = true;
Terminal.print("Opened HTTP Port (80)!");
Terminal.success("Opened HTTP Port (80)!");
server.openPortCount++;
},
}),
Expand All @@ -162,12 +162,12 @@ export const Programs: Record<CompletedProgramName, Program> = {
return;
}
if (server.sqlPortOpen) {
Terminal.print("SQL Port (1433) is already open!");
Terminal.warn("SQL Port (1433) is already open!");
return;
}

server.sqlPortOpen = true;
Terminal.print("Opened SQL Port (1433)!");
Terminal.success("Opened SQL Port (1433)!");
server.openPortCount++;
},
}),
Expand All @@ -180,8 +180,8 @@ export const Programs: Record<CompletedProgramName, Program> = {
time: CONSTANTS.MillisecondsPerQuarterHour,
},
run: (): void => {
Terminal.print("This executable cannot be run.");
Terminal.print("DeepscanV1.exe lets you run 'scan-analyze' with a depth up to 5.");
Terminal.error("This executable cannot be run.");
Terminal.warn("DeepscanV1.exe lets you run 'scan-analyze' with a depth up to 5.");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't feel like a warning to me.

},
}),
[CompletedProgramName.deepScan2]: new Program({
Expand All @@ -193,8 +193,8 @@ export const Programs: Record<CompletedProgramName, Program> = {
time: CONSTANTS.MillisecondsPer2Hours,
},
run: (): void => {
Terminal.print("This executable cannot be run.");
Terminal.print("DeepscanV2.exe lets you run 'scan-analyze' with a depth up to 10.");
Terminal.error("This executable cannot be run.");
Terminal.warn("DeepscanV2.exe lets you run 'scan-analyze' with a depth up to 10.");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same.

},
}),
[CompletedProgramName.serverProfiler]: new Program({
Expand Down Expand Up @@ -222,9 +222,34 @@ export const Programs: Record<CompletedProgramName, Program> = {
return;
}

Terminal.print(targetServer.hostname + ":");
if (targetServer.hasAdminRights) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Admin rights are not relevant to hacking. We should leave this out, to avoid furthering this misconception.

Terminal.success("Server has admin rights.");
Terminal.success(targetServer.hostname + ":");
} else {
Terminal.error("Server has no admin rights.");
Terminal.error(targetServer.hostname + ":");
}
Terminal.print("Server base security level: " + targetServer.baseDifficulty);
Terminal.print("Server current security level: " + targetServer.hackDifficulty);
if (targetServer.hackDifficulty > targetServer.baseDifficulty) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is complicated and I'm not sure that it's a good idea. Let's revert this part for now, and do a different PR later that focuses on augmenting ServerProfiler if you still want to later. (The built-in.exe tools are intentionally crude to nudge you towards writing your own.)

Terminal.warn(
"Server security level: " +
targetServer.hackDifficulty +
" (+" +
(targetServer.hackDifficulty - targetServer.baseDifficulty) +
")",
);
}
if (targetServer.hackDifficulty < targetServer.baseDifficulty) {
Terminal.success(
"Server security level: " +
targetServer.hackDifficulty +
" (-" +
(targetServer.baseDifficulty - targetServer.hackDifficulty) +
")",
);
} else if (targetServer.hackDifficulty === targetServer.baseDifficulty) {
Terminal.print("Server security level: " + targetServer.hackDifficulty);
}
Terminal.print("Server growth rate: " + targetServer.serverGrowth);
Terminal.print(
`Netscript hack() execution time: ${convertTimeMsToTimeElapsedString(
Expand Down Expand Up @@ -255,9 +280,9 @@ export const Programs: Record<CompletedProgramName, Program> = {
time: CONSTANTS.MillisecondsPerQuarterHour,
},
run: (): void => {
Terminal.print("This executable cannot be run.");
Terminal.print("AutoLink.exe lets you automatically connect to other servers when using 'scan-analyze'.");
Terminal.print("When using scan-analyze, click on a server's hostname to connect to it.");
Terminal.error("This executable cannot be run.");
Terminal.warn("AutoLink.exe lets you automatically connect to other servers when using 'scan-analyze'.");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm going to comment on all of the following simply with "info" to say that these are informational messages only so I don't think it's appropriate to use .warn

Terminal.warn("When using scan-analyze, click on a server's hostname to connect to it.");
},
}),
[CompletedProgramName.formulas]: new Program({
Expand All @@ -269,8 +294,8 @@ export const Programs: Record<CompletedProgramName, Program> = {
time: CONSTANTS.MillisecondsPer4Hours,
},
run: (): void => {
Terminal.print("This executable cannot be run.");
Terminal.print("Formulas.exe lets you use the formulas API.");
Terminal.error("This executable cannot be run.");
Terminal.warn("Formulas.exe lets you use the formulas API.");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Info

},
}),
[CompletedProgramName.bitFlume]: new Program({
Expand Down Expand Up @@ -300,19 +325,19 @@ export const Programs: Record<CompletedProgramName, Program> = {
Player.augmentations.length >= numAugReq && Player.money >= 1e11 && Player.skills.hacking >= 2500;
if (!fulfilled) {
if (Player.augmentations.length >= numAugReq) {
Terminal.print(`[x] Augmentations: ${Player.augmentations.length} / ${numAugReq}`);
Terminal.success(`[x] Augmentations: ${Player.augmentations.length} / ${numAugReq}`);
} else {
Terminal.print(`[ ] Augmentations: ${Player.augmentations.length} / ${numAugReq}`);
Terminal.warn(`[ ] Augmentations: ${Player.augmentations.length} / ${numAugReq}`);
}
if (Player.money >= 1e11) {
Terminal.print(`[x] Money: ${formatMoney(Player.money)} / ${formatMoney(1e11)}`);
Terminal.success(`[x] Money: ${formatMoney(Player.money)} / ${formatMoney(1e11)}`);
} else {
Terminal.print(`[ ] Money: ${formatMoney(Player.money)} / ${formatMoney(1e11)}`);
Terminal.warn(`[ ] Money: ${formatMoney(Player.money)} / ${formatMoney(1e11)}`);
}
if (Player.skills.hacking >= 2500) {
Terminal.print(`[x] Hacking skill: ${Player.skills.hacking} / 2500`);
Terminal.success(`[x] Hacking skill: ${Player.skills.hacking} / 2500`);
} else {
Terminal.print(`[ ] Hacking skill: ${Player.skills.hacking} / 2500`);
Terminal.warn(`[ ] Hacking skill: ${Player.skills.hacking} / 2500`);
}
return;
}
Expand Down
Loading
Loading