// Description:
//  Hubot script to have a conversation
// 
// Commands:
//   tinkurbot clean the house - chat about cleaning the house
//   tinkurbot jump - chat about jumping
//
// Author:
//   Created by Tinkurlab www.tinkurlab.com
//   based on examples at hubot-conversation
//

var Conversation = require('hubot-conversation');

module.exports = function (robot) {

    var switchBoard = new Conversation(robot);

    robot.respond(/clean the house/, function (msg) {
        var dialog = switchBoard.startDialog(msg);

        msg.reply('Sure, where should I start? Kitchen or Bathroom');
        dialog.addChoice(/kitchen/i, function (msg2) {
            msg2.reply('On it boss!');
        });
        dialog.addChoice(/bathroom/i, function (msg2) {
            msg.reply('Do I really have to?');
            dialog.addChoice(/yes/, function (msg3) {
                msg3.reply('Fine, Mom!');
            })
        });
    });

    robot.respond(/jump/, function (msg) {
        var dialog = switchBoard.startDialog(msg);
        msg.reply('Sure, How many times?');
        
        dialog.addChoice(/([0-9]+)/i, function (msg2) {
            var times = parseInt(msg2.match[1], 10);
            for (var i = 0; i < times; i++) {
                msg.emote("Jumps"); //We can use the original message too.
            }
        });
    });
    
    
  robot.respond(/.*the mission/, function (msg) {
        msg.reply('Your have 5 seconds to accept your mission, or this message will self-destruct');
        var dialog = switchBoard.startDialog(msg, 5000); //5 Second timeout
        dialog.timeout = function (msg2) {
            msg2.emote('Boom');
        }
        dialog.addChoice(/yes/i, function (msg2) {
            msg2.reply('Great! Here are the details...');
        });
    });
};
@@ -432,30 +432,33 @@
 espond(/
-clean the hous
+there is an outag
 e/, func
@@ -545,55 +545,50 @@
 ly('
-Sure, where should I start? Kitchen or Bathroom
+Oh no!  Should I notify everyone? (yes%7Cno)
 ');%0A
@@ -617,15 +617,11 @@
 ce(/
-kitchen
+yes
 /i, 
@@ -667,17 +667,33 @@
 y('O
-n it boss
+k, I told them what%5C's up
 !');
@@ -735,16 +735,10 @@
 ce(/
-bathroom
+no
 /i, 
@@ -782,142 +782,34 @@
 ly('
-Do I really have to?');%0A            dialog.addChoice(/yes/, function (msg3) %7B%0A                msg3.reply('Fine, Mom!');%0A            %7D)
+Whew!  You scared me...');
 %0A   

Change chatwithme.coffee for outage