diff options
author | Dipesh Amin <yaypunkrock@gmail.com> | 2011-09-05 21:07:51 +0100 |
---|---|---|
committer | Dipesh Amin <yaypunkrock@gmail.com> | 2011-09-05 21:07:51 +0100 |
commit | 559f0bcad608d547addbe78c02ba9e0e8661b592 (patch) | |
tree | 648a9e0f7068f6f3cdbbaa7d10e2f032b2b56a73 /main.py | |
parent | 837dc4bb388cc74a9ac4efcfd4a2726e27078a8f (diff) | |
download | manamarket-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-x | main.py | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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') |