X-Git-Url: http://git.harvie.cz/?a=blobdiff_plain;f=purple%2Fanswerscripts.d%2F00-megahal.sh;h=825fbba429ef2d32aa9955f63a573377dce904c7;hb=10a3ed036e46943ef3c5b662d4b5299055f3b78a;hp=82c61f359471d1eda25882b35c24dea2353d7659;hpb=a315ba6cac5179b7dd51c5efe4eeecf6503ae150;p=mirrors%2Flibpurple-core-answerscripts.git diff --git a/purple/answerscripts.d/00-megahal.sh b/purple/answerscripts.d/00-megahal.sh index 82c61f3..825fbba 100755 --- 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_REMEMBER=true; #set false if you don't want MegaHAL to learn new phrases (this can prevent data corruption) $AI_LOUD_UNAVAILABLE && [ "$ANSW_L_STATUS" != 'available' ] && AI_LOUD=true -AI_ANSW="$({ echo "$ANSW_MSG" && echo -e '\n#quit\n'; } | timeout 23 megahal -p -b -w | tail -n1)" +$AI_LOUD || $AI_REMEMBER || exit 23; #No speaking + No learning = Exitus + +AI_CMD_QUIT='#EXIT' +$AI_REMEMBER && AI_CMD_QUIT='#QUIT' +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"