From 7846f80f11a307629753dd4b280a4bab90504b84 Mon Sep 17 00:00:00 2001 From: Raktbastr Date: Thu, 3 Apr 2025 11:23:51 -0500 Subject: [PATCH] We can finally rest... --- files/functions.js | 9 ++++++--- files/main.js | 4 ++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/files/functions.js b/files/functions.js index c96da68..e7632f9 100644 --- a/files/functions.js +++ b/files/functions.js @@ -2,7 +2,7 @@ import { createRequire } from 'module'; const require = createRequire(import.meta.url); var readlineSync = require('readline-sync'); - +const { exec } = require("child_process"); import { food, foodRate, health, healthCap, locationA, locationB, name, radPoints, radSeverity, walkRate } from "./variables.js"; @@ -82,6 +82,11 @@ export function calcLocation() { } } + +export function sleep(time) { + exec("sleep "+time); +} + function death() { let random = variables.randomNumber(1,3); if (random = 1) { deathScreen1(); } @@ -101,8 +106,6 @@ function death3() { } - - function timeDeath() { // The death screen for passing the time limit console.clear; console.log("Your PIP-Boy starts ringing...\n\n") diff --git a/files/main.js b/files/main.js index 0dd5252..79ebc19 100644 --- a/files/main.js +++ b/files/main.js @@ -1,5 +1,5 @@ // Program is started from here, runs functions from other files. -import { userInput, calcLocation, radPointsCalc, healthCapCalc, checkLose } from './functions.js'; +import { userInput, calcLocation, radPointsCalc, healthCapCalc, checkLose, sleep } from './functions.js'; import { pois, poiCounter } from './poiscreens.js'; import { name, prewarmoney } from './variables.js'; @@ -34,7 +34,7 @@ switch(mainMenuInput) { console.log("Quitting Game..."); break; case "4": - console.log(pois[poiCounter]); + sleep(5); break; }