Connecting to openfire server

Hi

I am new to openfire and plugins. I created a chatterbot and when I ask it a question about time it tells me the duration we are speaking for. I now want to implement this bot into openfire and chat to it through spark. I know i have to use a plugin but I have no idea how to do this. Please can anyone help? I am using netbeans to code my bot.

Thanks