multiple session
This commit is contained in:
parent
322118f81d
commit
792710fa78
1
.bot.cfg
1
.bot.cfg
@ -43,3 +43,4 @@ PONG :irc.tripadvisor.com
|
|||||||
PONG :irc.tripadvisor.com
|
PONG :irc.tripadvisor.com
|
||||||
PONG :irc.tripadvisor.com
|
PONG :irc.tripadvisor.com
|
||||||
PONG :irc.tripadvisor.com
|
PONG :irc.tripadvisor.com
|
||||||
|
PONG :card.freenode.net
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
server="irc.tripadvisor.com"
|
server="card.freenode.net"
|
||||||
channel="interns"
|
channel="tahackers"
|
||||||
nick="elizabot2"
|
nick="elizabot"
|
||||||
user="elizabot2 elizabot2 elizabot2 : elizabot2"
|
user="elizabot elizabot elizabot : elizabot"
|
||||||
|
2
bot.sh
2
bot.sh
@ -42,7 +42,7 @@ do
|
|||||||
from=$who
|
from=$who
|
||||||
fi
|
fi
|
||||||
com=$(echo "$will" | grep -Eio "[a-z]*" | head -n1 | tail -n1)
|
com=$(echo "$will" | grep -Eio "[a-z]*" | head -n1 | tail -n1)
|
||||||
if [ -z "$(ls modules/ | grep -i -- "$com.sh")" ]
|
if [ -z "$(ls modules/*.sh | grep -i -- "$com.sh")" ]
|
||||||
then
|
then
|
||||||
./modules/help.sh $who $from >> $input
|
./modules/help.sh $who $from >> $input
|
||||||
continue
|
continue
|
||||||
|
BIN
eliza_bot/eliza_java.jar
Normal file
BIN
eliza_bot/eliza_java.jar
Normal file
Binary file not shown.
BIN
eliza_java.jar
BIN
eliza_java.jar
Binary file not shown.
Binary file not shown.
@ -1 +0,0 @@
|
|||||||
bye
|
|
@ -1,10 +1,23 @@
|
|||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
|
|
||||||
arg1=$1
|
|
||||||
arg2=$2
|
|
||||||
|
|
||||||
shift 2
|
arg1=$1 # sender (the person I am talking to)
|
||||||
echo "$@" >> input
|
arg2=$2 # unclear????
|
||||||
cat input | java -jar ./eliza_java.jar > output
|
|
||||||
|
|
||||||
echo "PRIVMSG $arg2 :$arg1: `tail -n 1 output`"
|
user_dir=eliza_bot/$1
|
||||||
|
if [ ! -d "$user_dir" ]; then
|
||||||
|
mkdir $user_dir
|
||||||
|
fi
|
||||||
|
|
||||||
|
shift 2 # chop off the first two args
|
||||||
|
echo "$@" >> $user_dir/input
|
||||||
|
cat $user_dir/input | java -jar eliza_bot/eliza_java.jar > $user_dir/output
|
||||||
|
|
||||||
|
# retcode of value 1 means the user said goodbye
|
||||||
|
retcode="${PIPESTATUS[1]}"
|
||||||
|
|
||||||
|
echo "PRIVMSG $arg2 :$arg1: `tail -n 1 $user_dir/output`"
|
||||||
|
|
||||||
|
if [ $retcode -eq "1" ]; then
|
||||||
|
echo "PRIVMSG $arg2 :$arg1: That was a joke! It's free to talk to me. But we do accept donations! ;D"
|
||||||
|
fi
|
Loading…
x
Reference in New Issue
Block a user