@Override protected void processActionSuccess(MindAction a) { // unlock if (a.equals(lockAction)) lockAction = null; if (a.getSubject().equals("Sarah") && (a.getName().equals("Talk")) && (a.getParameters() != null) && (a.getParameters().size() > 0)) { String utterance = a.getParameters().get(0); if (utterance.toLowerCase().contains("hello")) executeAction(getTalkAction("Can I ask you a question?")); else if (utterance.toLowerCase().contains("sorry")) executeAction(getTalkAction("Migrating back, have a nice day.")); else if (utterance.toLowerCase().contains("thank you")) executeAction(getTalkAction("Migrating back, have a nice day.")); else if (utterance.toLowerCase().contains("migrating")) { executeAction(getEmotionAction("sleep")); executeAction(getMigrationAction("Screen")); } } }
@Override protected void processActionFailure(MindAction a) { // unlock if (a.equals(lockAction)) lockAction = null; }