summaryrefslogtreecommitdiff
path: root/main.py
diff options
context:
space:
mode:
authorDipesh Amin <yaypunkrock@gmail.com>2011-09-05 21:07:51 +0100
committerDipesh Amin <yaypunkrock@gmail.com>2011-09-05 21:07:51 +0100
commit559f0bcad608d547addbe78c02ba9e0e8661b592 (patch)
tree648a9e0f7068f6f3cdbbaa7d10e2f032b2b56a73 /main.py
parent837dc4bb388cc74a9ac4efcfd4a2726e27078a8f (diff)
downloadmanamarket-559f0bcad608d547addbe78c02ba9e0e8661b592.tar.gz
manamarket-559f0bcad608d547addbe78c02ba9e0e8661b592.tar.bz2
manamarket-559f0bcad608d547addbe78c02ba9e0e8661b592.tar.xz
manamarket-559f0bcad608d547addbe78c02ba9e0e8661b592.zip
Add a chatbot for unrecognised responses.
Diffstat (limited to 'main.py')
-rwxr-xr-xmain.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/main.py b/main.py
index 133d7a2..2f0b71c 100755
--- a/main.py
+++ b/main.py
@@ -27,7 +27,9 @@ from net.packet_out import *
from player import *
import tradey
import utils
+import eliza
+chatbot = eliza.Agent([eliza.patternResps,eliza.defReplys])
shop_broadcaster = utils.Broadcast()
trader_state = utils.TraderState()
ItemDB = utils.ItemDB()
@@ -562,7 +564,8 @@ def process_whisper(nick, msg, mapserv):
mapserv.sendall(whisper(nick, "Where are you?!? I can't trade with somebody who isn't here!"))
trader_state.reset()
else:
- mapserv.sendall(whisper(nick, "Command not recognised, please whisper me !help for a full list of commands."))
+ mapserv.sendall(whisper(nick, chatbot.tell(msg.lower())))
+ #mapserv.sendall(whisper(nick, "Command not recognised, please whisper me !help for a full list of commands."))
def main():
logging.basicConfig(filename='data/logs/activity.log', level=logging.INFO, format='%(asctime)s: %(message)s', datefmt='%Y-%m-%d %H:%M:%S')