marvvin

[archived] IRC bot
git clone https://hhvn.uk/marvvin
git clone git://hhvn.uk/marvvin
Log | Files | Refs | README | LICENSE

say (904B)


      1 #!/bin/bash
      2 
      3 [ -z $1 ] && echo "say <greeting> to <user>
      4 Greetings: hi, goodbye, bye, goodday, morning, goodnight, night"
      5 
      6 replies3=(
      7 	"Bye $3"
      8 	"See you later $3"
      9 	"$3: bye bye!"
     10 	"Goodbye $3"
     11 	"Til next time, $3"
     12 	"Later $3"
     13 )
     14 
     15 replies2=(
     16 	"Night night, $3"
     17 	"$3: have a good sleep."
     18 	"See you tommorow, $3"
     19 	"*Tucks in $3* heh, he looks cute sleeping..."
     20 	"Goodnight! Don't let the bed bugs bite!"
     21 	"Have a good one."
     22 	"Sleep tight."
     23 	"ACTION watches $3 breathing"
     24 )
     25 
     26 replies1=(
     27 	"h h h hi t there $3"
     28 	"$3: Good day!"
     29 	"Hiya $3"
     30 	"Heyo $3"
     31 	"Hi $3!"
     32 	"$3: Hey!"
     33 	"$3: Hey, how are you?"
     34 )
     35 
     36 case "$1" in
     37 	hi|goodday|morning) echo ${replies1[$((RANDOM % ${#replies1[@]}))]}
     38 		cat data/ascii/say-hi ;;
     39 	goodnight|night) echo ${replies2[$((RANDOM % ${#replies2[@]}))]}
     40 		cat data/ascii/say-goodnight ;;
     41 	goodbye|bye) echo ${replies3[$((RANDOM % ${#replies2[@]}))]}
     42 		cat data/ascii/say-goodbye ;;
     43 esac