From c5863c50a6615b2365509ed81eb5979abb8967e7 Mon Sep 17 00:00:00 2001 From: Harvie Date: Tue, 24 Aug 2010 02:54:13 +0200 Subject: [PATCH] Ported all scripts from PURPLE_ to ANSW_ prefix. Added examples to support STATUS values. Improved autokiss a bit. --- purple/answerscripts.d/autokiss.sh | 2 +- purple/answerscripts.d/debug.sh | 3 ++- purple/answerscripts.d/espeak.sh | 2 +- purple/answerscripts.d/menu.pl | 4 ++-- purple/answerscripts.d/repeat.sh | 2 +- 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/purple/answerscripts.d/autokiss.sh b/purple/answerscripts.d/autokiss.sh index b054c5c..46dc712 100755 --- a/purple/answerscripts.d/autokiss.sh +++ b/purple/answerscripts.d/autokiss.sh @@ -1,3 +1,3 @@ #!/bin/sh #AutoKiss :-* (just wanna be polite) -echo "$PURPLE_MSG" | grep -o ':-\*'; +echo $(echo "$ANSW_MSG" | grep -Eo ':-\*|\*IN LOVE\*|:-\{\}|\*KISSING\*'); diff --git a/purple/answerscripts.d/debug.sh b/purple/answerscripts.d/debug.sh index 021c713..ad2ddb7 100755 --- a/purple/answerscripts.d/debug.sh +++ b/purple/answerscripts.d/debug.sh @@ -1,3 +1,4 @@ #!/bin/sh #Debug -echo "<$PURPLE_FROM> $PURPLE_MSG" >&2; +echo "<$ANSW_FROM> $ANSW_MSG" >&2; +echo "($ANSW_STATUS: $ANSW_STATUS_MSG)" >&2; diff --git a/purple/answerscripts.d/espeak.sh b/purple/answerscripts.d/espeak.sh index c0dec78..0e785bf 100755 --- a/purple/answerscripts.d/espeak.sh +++ b/purple/answerscripts.d/espeak.sh @@ -1,3 +1,3 @@ #!/bin/sh #Say it loudly and proudly! -test -x "$(which espeak)" && echo "$PURPLE_MSG" | espeak -v $(echo "$LANG" | head -c 2) & +test -x "$(which espeak)" && echo "$ANSW_MSG" | espeak -v $(echo "$LANG" | head -c 2) & diff --git a/purple/answerscripts.d/menu.pl b/purple/answerscripts.d/menu.pl index 5c0c593..d7afa4e 100755 --- a/purple/answerscripts.d/menu.pl +++ b/purple/answerscripts.d/menu.pl @@ -4,10 +4,10 @@ use strict; use warnings; use Switch; -switch ($ENV{PURPLE_MSG}) { +switch ($ENV{ANSW_MSG}) { case /^!help$/ { print "What did you expected? A help?! :-P"; } case /^!ping$/ { print "PONG"; } - case /^!whoami$/ { print "You are: $ENV{PURPLE_FROM}"; } + case /^!whoami$/ { print "You are: $ENV{ANSW_FROM}"; } case /^!(reboot|reset|restart|halt)$/ { print "Broadcast message: The system is going down for reboot NOW !!"; } case /^!google/ { print "UTFG Yourself: http://google.com/"; } case /^!uptime$/ { print qx{uptime}; } diff --git a/purple/answerscripts.d/repeat.sh b/purple/answerscripts.d/repeat.sh index 0719cd8..ffd2076 100755 --- a/purple/answerscripts.d/repeat.sh +++ b/purple/answerscripts.d/repeat.sh @@ -1,3 +1,3 @@ #!/bin/sh #Dumb libpurple core-answerscripts script. Hello world! -echo "REPEAT:$PURPLE_FROM> $PURPLE_MSG"; +echo "REPEAT:$ANSW_FROM> $ANSW_MSG"; -- 2.30.2