message: fixed an execution order thing
diff: @@ -18,6 +18,7 @@ module.exports = function(controller) {
  * script and trigger services
  * ---------------------------------------------------------------- */
  +
  function genConfig(bot) {
  var config = {};
  @@ -308,7 +309,6 @@ module.exports = function(controller) {
  var thread = options.execute.thread;
  controller.studio.get(bot, script, convo.source_message.user, convo.source_message.channel, convo.source_message).then(function(new_convo){
  convo.stop('transitioning to ', script);
  - // new_convo.transcript = convo.transcript;
  new_convo.responses = convo.responses;
  new_convo.vars = convo.vars;
  new_convo.activate();
  @@ -507,6 +507,41 @@ module.exports = function(controller) {
  if (topics[t].script[m].action) {
  message.action = topics[t].script[m].action;
  + console.log('message.action: ', message.action);
  + console.log('message: ', message);
  + console.log('topics[t].script[m]: ', topics[t].script[m]);
  +
  +
  + if(message.action == 'execute_script'){
  + var options = topics[t].script[m];
  + console.log('options: ', options);
  + if(options.execute){
  + message.action = (function(options){
  + return function(convo){
  + console.log('///////////////////////////////////');
  + console.log('options: ', options);
  + console.log('old convo.source_message.text:', convo.source_message.text);
  + var script = options.execute.script;
  + var thread = options.execute.thread;
  + controller.studio.get(convo.context.bot, script, convo.source_message.user, convo.source_message.channel, convo.source_message).then(
  + function(new_convo){
  + console.log('new convo.source_message.text:', new_convo.source_message.text);
  + convo.next();
  + convo.stop('transitioning to ', script);
  + new_convo.responses = convo.responses;
  + new_convo.vars = convo.vars;
  + new_convo.activate();
  + new_convo.gotoThread(thread);
  + })
  + }
  +
  + })(options, convo);
  + }
  + }
  +
  +
  +
  +
  }
  // handle meta data
  