Skip to content

Commit

Permalink
Update terminal.js
Browse files Browse the repository at this point in the history
  • Loading branch information
MegaTheLEGEND authored Feb 4, 2024
1 parent 658865d commit 985a456
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion gs/terminal/terminal.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function ascii_art() {
let commandHistory = [];
let commandIndex = 0;

let YOUR_FUNCTIONS = ["SearchGitHubProfile", "printInfoAboutDev", "help", "demo_menu", "exit", "hello", "cool", "ifconfig", "date", "whoami", "clear", "pwd", "ping"];
let YOUR_FUNCTIONS = ["SearchGitHubProfile", "printInfoAboutDev", "help", "demo_menu", "exit", "hello", "cool", "ifconfig", "date", "whoami", "clear", "pwd", "ping","hackertyper"];

async function add_numbers() {
let number1 = await term3.input("First number to add");
Expand Down Expand Up @@ -93,6 +93,32 @@ function pwd() {
term3.output(`${window.location.href}`);
}

async function hackertyper() {
try {
const response = await fetch("https://www.o-bible.com/download/kjv.txt");

if (!response.ok) {
throw new Error(`Failed to fetch hacker typer text. Status: ${response.status}`);
}

const hackerText = await response.text();

const lines = hackerText.split('\n');

for (const line of lines) {
term3.output(line);
await new Promise(resolve => setTimeout(resolve, 1000)); // Adjust the delay as needed
}

term3.output("Hacking complete!");
} catch (error) {
term3.output(`Failed to load hacker typer text: ${error.message}`);
}
}




async function ping() {
try {
const host = await term3.input("Enter the host to ping:");
Expand Down

0 comments on commit 985a456

Please sign in to comment.