clippyjs / clippy.js

Add Clippy or his friends to any website for instant nostalgia.
http://www.smore.com/clippy-js
Other
2.83k stars 334 forks source link

Pause between sentences #7

Open RicoP opened 12 years ago

RicoP commented 12 years ago

Hello,

so far there is no straight forward way to make the agent wait between multiple sentences.

this code will barely be readable for the user.

    agent.play("GetAttention"); 
    agent.speak("Hello World" );
    agent.speak("Foo Bar");
    agent.speak("Yo Momma");

I made a nasty hack to make the agent wait by introducing zero space characters at the end of the sentence

    var s = "\u2006\u200B";
    var space = s+s+s+s+s+s+s+s+s+s+s+s+s+s+s+s+s+s+s+s;
    agent.play("GetAttention"); 
    agent.speak("Hello World"  + space);
    agent.speak("Foo Bar" + space);
    agent.speak("Yo Momma" + space);

I think there should be a better way.

smore-inc commented 12 years ago

You can add a 2-3 seconds timeout in Balloon._sayWords before it calls complete(). Make a patch and we'll be happy to pull it :)