From 7cde163a84a4ea579b940043d7f6f39e0c2b0e91 Mon Sep 17 00:00:00 2001 From: deicidus <> Date: Tue, 14 Jun 2022 08:28:43 -0700 Subject: [PATCH] updated readme and reduced frequency of fantasy messsages --- README.md | 4 +++- index.js | 7 +++++-- scripts/util.js | 4 ++-- scripts/welcome.js | 7 +------ 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 2370474..30ff555 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ These features work right now: * `ao-cli` can self-update to the newest version * Run AO unit tests to verify the up-to-spec functioning of the system's running AO API server * Easily view installed/running status of optional AO features -* Add `ao` alias for `ao-cli` (under Features→ao-cli) +* Add `ao` alias for `ao-cli` (under `Features→ao-cli`) * Detects your OS, with support for Debian/Ubuntu, Arch/Manjaro, and Fedora (MacOS planned) ## Upcoming Features @@ -46,6 +46,7 @@ These features are planned and many are mocked up in the menus: * Full interactive wizard to walk you through setting up and connecting new AO hardware resources to your AO server * Terminal spellbook to save and trade your favorite UNIX commands * AO server using AO features via ao-cli command line switches (with optional sound notifications on server computer) +* Enchant your 'cd' command to narrate your travels through the UNIX filesystem (under `Features→ao-cli`) (less annoying than it sounds, easy to disable) ## Important Locations @@ -60,6 +61,7 @@ These features are planned and many are mocked up in the menus: ## Version History +* 0.1.3 Added fantasy hook feature to bring the AO MUD aesthetic into the terminal * 0.1.2 Improved install wizard * 0.1.1 AO install wizard partway done, reorganized project repos, 'Check AO install' feature works * 0.1.0 View, create or recall, upboat and downboat priorities; partial AO install wizard diff --git a/index.js b/index.js index 62efd35..2a43513 100644 --- a/index.js +++ b/index.js @@ -13,7 +13,7 @@ import useAoMenu from './scripts/ao.js' import aoInstallWizard, { chooseAoVersion, checkAo } from './scripts/wizard.js' import testsMenu from './scripts/tests.js' import { headerStyle } from './scripts/styles.js' -import { sleep } from './scripts/util.js' +import { sleep, randomInt } from './scripts/util.js' import './scripts/strings.js' // Import AO modular features @@ -161,7 +161,10 @@ async function handleArgs(args) { return false case '--interstitial': case '-cd': - console.log(wander(args[1])) + // Don't say a message every time or it will annoy everybody + if(randomInt(0, 6) === 0) { + console.log(wander(args[1])) + } return false } return true diff --git a/scripts/util.js b/scripts/util.js index 835aa88..daa7ddc 100644 --- a/scripts/util.js +++ b/scripts/util.js @@ -1,7 +1,7 @@ // General helper functions // Returns a random int between min and max (inclusive) -function randomInt(min, max) { +export function randomInt(min, max) { min = Math.ceil(min); max = Math.floor(max); return Math.floor(Math.random() * (max - min + 1)) + min; @@ -17,4 +17,4 @@ export function sleep(ms = 550) { return new Promise((r) => setTimeout(r, ms)) } -export const isObject = (obj) => Object.prototype.toString.call(obj) === '[object Object]' \ No newline at end of file +export const isObject = (obj) => Object.prototype.toString.call(obj) === '[object Object]' diff --git a/scripts/welcome.js b/scripts/welcome.js index d769606..e7c85ec 100644 --- a/scripts/welcome.js +++ b/scripts/welcome.js @@ -98,10 +98,6 @@ export function farewell() { console.log(chalk.yellow.bold(selectRandom(farewellMessages))) } -export function wander() { - //console.lo(selectRa)) -} - // Asks the given yes or no answer returns true or false for their response export async function yesOrNo(prompt = 'Yes or no?', defaultAnswer = true) { const answer = await inquirer.prompt({ @@ -123,5 +119,4 @@ export async function askQuestionText(prompt = 'Please enter a string:', promptO Object.assign(options, promptOptions) const answer = await inquirer.prompt(options) return answer.text -} - +} \ No newline at end of file