From 4dba502f2d91f7e823193b0fdc4b9db24ca308b4 Mon Sep 17 00:00:00 2001 From: mollusk Date: Mon, 29 Oct 2018 23:18:17 -0700 Subject: [PATCH] lochat.sh: did some shit Former-commit-id: 849f25c34ffd3bc87f099aa39d27abd2d9ad3476 --- lochat.sh | 65 ++++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 57 insertions(+), 8 deletions(-) diff --git a/lochat.sh b/lochat.sh index d5e2d4b..0c17c8f 100755 --- a/lochat.sh +++ b/lochat.sh @@ -16,38 +16,87 @@ LPURPLE="\033[1;35m" BWHITE="\e[1m" NC='\033[0m' # No Color -VOICEON="false" +VOICEON="true" #VoicControl (){ if [ "${VOICEON}" = "true" ];then MODE="espeak" elif [ "${VOICEON}" = "false" ];then - MODE="echo" + MODE="" fi #} printf "${LBLUE}What is the name of person 1?:${NC} " read person1 -${MODE} "${person1} Joined the chat" +if [ "${MODE}" = "espeak" ];then + + espeak "${person1} Joined the chat" & + echo "${person1} Joined the chat" +else + + echo "${person1} Joined the chat" +fi printf "${LPURPLE}What is the name of person 2?:${NC} " read person2 -${MODE} "${person2} joined the chat" + +if [ "${MODE}" = "espeak" ];then + espeak "${person2} Joined the chat" & + echo "${person2} Joined the chat" +else + + echo "${person2} Joined the chat" +fi + +echo -e "${LCYAN}Type 'quit' to exit the chat${NC}\n" while true;do - printf "${LGREEN}${person1}:${NC} " - read something1 + #printf "${LGREEN}${person1}:${NC} " + read something1 + + if [ ! -z "${something1}" ];then + echo -e "${LGREEN}${person1}: ${something1}${NC}\n" + + + continue + + elif [ "${something1}" = "quit" ];then + + echo -e "${LRED}${person1} exited the chat!${NC}\n" + exit 0 + + else + continue + fi - printf "${YELLOW}${person2}:${NC} " - read something2 + #printf "${YELLOW}${person2}:${NC} " + read something2 + + if [ ! -z "${something2}" ];then + echo -e "${YELLOW}${person2}: ${something2}${NC}\n" + + + continue + + + + + elif [ "${something2}" = "quit" ];then + + echo -e "${LRED}${person2} exited the chat!${NC}\n" + exit 0 + + else + continue + fi done