.println("Parameters: <senderAccount> <senderPassword> <chatroomname>. e.g. sender@gmail.com senderpassword mychatroom");
return new Integer(-1);
}
senderAccount = originalArgs[0];
// Create client
final XMPPChatRoomClient client = new XMPPChatRoomClient(this);
// connect to senderAccount using senderPassword
client.connect(senderAccount, originalArgs[1]);
// get chat room
final IChatRoomContainer chatRoomContainer = client.createChatRoom(originalArgs[2]);
// join/connect to chat room
chatRoomContainer.connect(client.getChatRoomInfo().getRoomID(), null);
System.out.println("ECF chat room robot sender=" + senderAccount + " Connected to room: " + client.getChatRoomInfo().getRoomID().getName());
// Add message listener to chat room
chatRoomContainer.addMessageListener(this);
// Get chat room message sender
sender = chatRoomContainer.getChatRoomMessageSender();
sender.sendMessage("Hi, I'm a robot. To get rid of me, send me a direct message.");