Closing a bot in AIML

Viewed 108

I've been programming a bot that can make an appointment for a dental clinic as an example. If the human tries to make an appointment in a day when there is no hours left, the robot asks if he/she would like another day. If the human says something like 'No', I would like to close the bot so it seems like the human or the robot have hanged up. Thank you in advance and if I haven't had explained me correctly ask anything you need.

1 Answers
//textLine is the human answer
    if ((textLine == null) || (textLine.length() < 1))
        textLine = MagicStrings.null_input;
    if (textLine.equals("no")) {
        System.exit(0);
    } else {
        String request = textLine;
        if (MagicBooleans.trace_mode)
            System.out.println("STATE=" + request + ":THAT=" + ((History) chatSession.thatHistory.get(0)).get(0) + ":TOPIC=" + chatSession.predicates.get("topic"));
        String response = chatSession.multisentenceRespond(request);
        while (response.contains("&lt;"))
            response = response.replace("&lt;", "<");
        while (response.contains("&gt;"))
            response = response.replace("&gt;", ">");
    }

System.out.println(response); //response is the bot response

this is my code in java if i send "no" the bot quit

Related