Commit | Line | Data |
---|---|---|
d5bbca3f H |
1 | #!/bin/sh |
2 | #Artificial Pseudo Inteligence using megahal package :-) | |
3 | #More info: http://megahal.alioth.debian.org/ | |
a315ba6c H |
4 | |
5 | AI_LOUD=false #enable loud replies (otherwise will be learning only :-) | |
6 | AI_LOUD_UNAVAILABLE=true; #enable loud replies when not available :-) | |
230b1320 | 7 | AI_REMEMBER=true; #set false if you don't want MegaHAL to learn new phrases (this can prevent data corruption) |
a315ba6c | 8 | |
43863b1d | 9 | $AI_LOUD_UNAVAILABLE && [ "$ANSW_L_STATUS" != 'available' ] && AI_LOUD=true |
230b1320 H |
10 | $AI_LOUD || $AI_REMEMBER || exit 23; #No speaking + No learning = Exitus |
11 | ||
12 | AI_CMD_QUIT='#EXIT' | |
13 | $AI_REMEMBER && AI_CMD_QUIT='#QUIT' | |
230b1320 | 14 | AI_ANSW="$({ echo "$ANSW_MSG." | sed -e 's/#//g' && echo -e "\n$AI_CMD_QUIT\n"; } | timeout 23 megahal -p -b -w | tail -n1)" |
a315ba6c | 15 | $AI_LOUD && [ -n "$AI_ANSW" ] && echo -n "[MegaHALuz]: $AI_ANSW" |