GIT.Harvie.CZ
/
mirrors
/
libpurple-core-answerscripts.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
1c4a0e1
)
MegaHAL: Added option to prevent learning
author
Harvie
<tomas@mudrunka.cz>
Tue, 17 Jan 2012 05:40:18 +0000
(06:40 +0100)
committer
Harvie
<tomas@mudrunka.cz>
Tue, 17 Jan 2012 05:40:18 +0000
(06:40 +0100)
purple/answerscripts.d/00-megahal.sh
patch
|
blob
|
blame
|
history
diff --git
a/purple/answerscripts.d/00-megahal.sh
b/purple/answerscripts.d/00-megahal.sh
index 70cbe323560d04b09e79fcab7751ce6315e90599..800210df9c4d304c825a249ca766cc57fd13f40c 100755
(executable)
--- a/
purple/answerscripts.d/00-megahal.sh
+++ b/
purple/answerscripts.d/00-megahal.sh
@@
-4,7
+4,12
@@
AI_LOUD=false #enable loud replies (otherwise will be learning only :-)
AI_LOUD_UNAVAILABLE=true; #enable loud replies when not available :-)
AI_LOUD=false #enable loud replies (otherwise will be learning only :-)
AI_LOUD_UNAVAILABLE=true; #enable loud replies when not available :-)
+AI_REMEMBER=true; #set false if you don't want MegaHAL to learn new phrases (this can prevent data corruption)
+$AI_LOUD || $AI_REMEMBER || exit 23; #No speaking + No learning = Exitus
+
+AI_CMD_QUIT='#EXIT'
+$AI_REMEMBER && AI_CMD_QUIT='#QUIT'
$AI_LOUD_UNAVAILABLE && [ "$ANSW_L_STATUS" != 'available' ] && AI_LOUD=true
$AI_LOUD_UNAVAILABLE && [ "$ANSW_L_STATUS" != 'available' ] && AI_LOUD=true
-AI_ANSW="$({ echo "$ANSW_MSG." | sed -e 's/#//g' && echo -e
'\n#quit\n'
; } | timeout 23 megahal -p -b -w | tail -n1)"
+AI_ANSW="$({ echo "$ANSW_MSG." | sed -e 's/#//g' && echo -e
"\n$AI_CMD_QUIT\n"
; } | timeout 23 megahal -p -b -w | tail -n1)"
$AI_LOUD && [ -n "$AI_ANSW" ] && echo -n "[MegaHALuz]: $AI_ANSW"
$AI_LOUD && [ -n "$AI_ANSW" ] && echo -n "[MegaHALuz]: $AI_ANSW"
This page took
0.093938 seconds
and
4
git commands to generate.