View Full Version : Creating a Robot as a Java ES extension
03-08-2008, 02:23 AM
Does anyone have information about creating a plugin that would greet users who enter the room and send / respond to messages (all simple text from predetermined lists).
I'm asking about the Java Extension functions and techniques to do this - not the AI aspect.
03-08-2008, 03:20 AM
If you extend BasePlugin, customizing these methods might do what you want:
1. userEnter : Do whatever you want to do when somebody is about to join the room. Return ChainAction.OkAndContinue at the end. If you want the new person to hear the text, then set a timer or have the client send a request after it gets the response about joining the room. See Multiple Delayed Executions at Various Times (http://www.es-wiki.com/index.php?title=ScheduledCallback#Multiple_Delayed _Executions_at_Various_Times)
2. userExit : Say goodbye.
3. userSendPublicMessage : respond to the message if you want to.
03-08-2008, 03:34 AM
Thankyou - this is very helpful. About option 3: would I be somehow creating an automated user and logging them in and having them send a message in response? How were you thinking I would respond to the message?
03-08-2008, 04:49 AM
Well, I was thinking of using getApi().sendPluginMessageToRoom, and having the clients interpret this as a public message.
03-12-2008, 01:36 AM
Could someone point me to a working example of using getApi().sendPluginMessageToRoom ?
03-12-2008, 03:03 AM
Look at installation folder/examples/PluginPublicMessage. The plugin uses
PluginPublicMessageResponse response = getApi().sendPluginMessageToRoom(getApi().getZoneI d(), getApi().getRoomId(), requestParameters);
03-13-2008, 08:49 AM
Thanks for all your help, Teresa - the robot is working great with test phrases!
I need to load the canned phrases from an xml file and I wrote a working parser but I'm wondering where text files should sit in the plugin structure. I am currently getting a file not found error with the xml file in the root of the extension's zip archive.
03-13-2008, 06:15 PM
(guessing) Try putting it in the config folder of the extension.
Powered by vBulletin® Version 4.1.6 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.