LoudPacks Posted November 5, 2016 Posted November 5, 2016 (edited) Library jar: http://www.mediafire.com/file/i5c5fkni41m78d9/ChatterBotLib.jar Snippet: ChatterBotFactory factory = new ChatterBotFactory(); ChatterBot bot = factory.create(ChatterBotType.CLEVERBOT); ChatterBotSession botSession = bot.createSession(); String response = botSession.think("Text you want to respond to."); System.out.println(response); Sample: Now if you want it for your scripts just put it into the onMessage maybe with some conditions about when it should respond / who it should respond to, etc. I would run it on a separate thread incase the response takes a little while to complete. Edited November 5, 2016 by LoudPacks 8
Aiban Posted November 5, 2016 Posted November 5, 2016 (edited) You are a God Edit:: The bot is Edited November 5, 2016 by Aiban
House Posted November 5, 2016 Posted November 5, 2016 (edited) Might want put it into a separate thread though? Pretty sure response times are a little while EDIT: also its done before but turned out as a bad idea im pretty sure xD Edited November 5, 2016 by House
LoudPacks Posted November 5, 2016 Author Posted November 5, 2016 Might want put it into a separate thread though? Pretty sure response times are a little while EDIT: also its done before but turned out as a bad idea im pretty sure xD Yes that would be a good idea, usually its instant but sometimes it can take a few seconds.
Token Posted November 5, 2016 Posted November 5, 2016 Responses are not instant, I'm using the same API as you. CleverBot generates a limited set of responses for every message you give. I use a recursive algorithm with a variable depth to ensure a larger pool of messages. You should query CleverBot on a separate thread using a Callable<String> to provide a Future<String> for when the processing is done.
LoudPacks Posted November 5, 2016 Author Posted November 5, 2016 (edited) Responses are not instant, I'm using the same API as you. CleverBot generates a limited set of responses for every message you give. I use a recursive algorithm with a variable depth to ensure a larger pool of messages. You should query CleverBot on a separate thread using a Callable<String> to provide a Future<String> for when the processing is done. I mean I set up 2 bots talking to each other and response times were ~<= 1s apart (every so often it would take a couple seconds). It would still be a good idea though none the less. I would assume users would only be sending one message at a time. Edited November 5, 2016 by LoudPacks