import com.cmlabs.air.JavaAIRPlug; import com.cmlabs.air.Message; public class Alice { /*---------------------------------------------- --------- Member variables -------------- ----------------------------------------------*/ private JavaAIRPlug m_obPlug = new JavaAIRPlug( "Alice", "localhost", 10000 ); /*---------------------------------------------- ----------- Constructors -------------- ----------------------------------------------*/ /*---------------------------------------------- ---------- Get & Set Functions ---------- ----------------------------------------------*/ /*---------------------------------------------- ------------ Functions -------------- ----------------------------------------------*/ public void runModule() { while(true) { Message obMessage = m_obPlug.waitForNewMessage( 100 ); if( obMessage != null) { if( obMessage.type.equalsIgnoreCase( "Intro.AI.Communication.Greeting") ) { handleHello(); } } } } private void handleHello() { m_obPlug.postMessage( "WB1", "Intro.AI.Communication.Greeting.Response", "Hi there", "English", "" ); } public static void main( String[] args ) { Alice obAlice = new Alice(); obAlice.runModule(); } }