A Talking ChatBot using ScratchX

I had a great time at the Bett show last week, running a workshop on how to use Scratch to code an interactive talking ChatBot.

The ChatBot asks you questions, and then personalises a conversation with you, based on your responses. This is done using variables (to store information about you) and decisions (so that the ChatBot can decide what to say next).

ChatBot.png

Here’s how to code the beginnings of a ChatBot:

ChatBot code.png

I had a conversation at the workshop, in which someone commented that it’s a shame the ChatBot doesn’t actually speak.

Well with ScratchX, it can! ScratchX is a place to tinker with experimental Scratch extensions that connect with external hardware (such as electronic devices and robotics) and online resources (including web data and web services).

One of these is a text to speech extension, that includes a new ‘speak’ block to speak text that’s given to it. Clicking the ‘Text to Speech’ extension on the ScratchX homepage opens up the Scratch environment with the additional block in the ‘more blocks’ section. The new ‘speak’ block can then be added to the ChatBot’s code, so that it speaks text before  displaying it on the screen.

Here’s how the ChatBot works with the additional ‘speak’ blocks:

There are other extensions available, including ones to track the position of the ISS or to integrate tweets into Scratch projects!

ISS.png

Advertisements

2 thoughts on “A Talking ChatBot using ScratchX

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s